forked from bazelbuild/bazel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Create no-op builtins stubs for py_runtime, PyRuntimeInfo, and PyInfo
Subsequent changes will begin adding actual functionality. This just creates stubs than lets the `--experimental_builtins_bzl_path` and `--experimental_builtins_injection_override` flags allow working with the builtins code. Work towards bazelbuild#15897 PiperOrigin-RevId: 483066291 Change-Id: If297913ddbef3e32aada41e7d319c87213921f9d
- Loading branch information
1 parent
3e8514c
commit 7190f22
Showing
4 changed files
with
61 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
src/main/starlark/builtins_bzl/common/python/providers.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Copyright 2022 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Providers for Python rules.""" | ||
PyRuntimeInfo = _builtins.toplevel.PyRuntimeInfo | ||
PyInfo = _builtins.toplevel.PyInfo |
22 changes: 22 additions & 0 deletions
22
src/main/starlark/builtins_bzl/common/python/py_runtime_macro.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
# Copyright 2022 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Macro to wrap the py_runtime rule.""" | ||
|
||
load(":common/python/py_runtime_rule.bzl", py_runtime_rule = "py_runtime") | ||
|
||
# NOTE: The function name is purposefully selected to match the underlying | ||
# rule name so that e.g. 'generator_function' shows as the same name so | ||
# that it is less confusing to users. | ||
def py_runtime(**kwargs): | ||
py_runtime_rule(**kwargs) |
18 changes: 18 additions & 0 deletions
18
src/main/starlark/builtins_bzl/common/python/py_runtime_rule.bzl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Copyright 2022 The Bazel Authors. All rights reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
"""Implementation of py_runtime rule.""" | ||
|
||
# Bind to the name "py_runtime" to preserve the kind/rule_class it shows up | ||
# as elsewhere. | ||
py_runtime = _builtins.native.py_runtime |