-
Notifications
You must be signed in to change notification settings - Fork 541
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add runtime_env toolchain suite to replace "autodetecting" tool…
…chain (#2018) This adds a more comprehensive replacement for the "autodetecting" toolchain. Specifically, it defines all our toolchain types so that they take precedence when specified. This prevents the hermetic toolchains (registered by default) from accidentally being used when undesired. To keep the behavior backwards compatible, an alias is added for the autodetecting toolchain with a deprecation notice. The name `runtime_env` was chosen instead of "autodetecting" so that it's more clear these toolchains are not "automatic" or "detecting" anything -- they're just taking a value from the runtime environment and using it. --------- Co-authored-by: Ignas Anikevicius <240938+aignas@users.noreply.github.com>
- Loading branch information
Showing
18 changed files
with
363 additions
and
95 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
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
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
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,38 @@ | ||
:::{default-domain} bzl | ||
::: | ||
:::{bzl:currentfile} //python/runtime_env_toolchain:BUILD.bazel | ||
::: | ||
|
||
# //python/runtime_env_toolchain | ||
|
||
::::{target} all | ||
|
||
A set of toolchains that invoke `python3` from the runtime environment. | ||
|
||
Note that this toolchain provides no build-time information, which makes it of | ||
limited utility. This is because the invocation of `python3` is done when a | ||
program is run, not at build time. | ||
|
||
This is only provided to aid migration off the builtin Bazel toolchain | ||
(`@bazel_tools//python:autodetecting_toolchain`), and is largely only applicable | ||
to WORKSPACE builds. | ||
|
||
To use this target, register it as a toolchain in WORKSPACE or MODULE.bazel: | ||
|
||
::: | ||
register_toolchains("@rules_python//python/runtime_env_toolchains:all") | ||
::: | ||
|
||
The benefit of this target over the legacy targets is this defines additional | ||
toolchain types that rules_python needs. This prevents toolchain resolution from | ||
continuing to search elsewhere (e.g. potentially incurring a download of the | ||
hermetic runtimes when they won't be used). | ||
|
||
:::{deprecated} 0.34.0 | ||
|
||
Switch to using a hermetic toolchain or manual toolchain configuration instead. | ||
::: | ||
|
||
:::{versionadded} 0.34.0 | ||
::: | ||
:::: |
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
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
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
This file was deleted.
Oops, something went wrong.
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
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
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
Oops, something went wrong.