-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(toolchain): disable exec toolchain by default #1968
Conversation
FYI @fmeum, @meteorcloudy, I think this should fix the dependence on the hermetic toolchain, but I did not have time to check with bazelbuild/bazel#22718 yet and I am not sure when I'll get to it. You could check the toolchain dependencies upon the failing targets like I described in #1967 if you would like confirmation that this was indeed a cause. |
With this change we set the `target_settings` to something that is not going to be ever matched if the `precompile` flag is not enabled. Users wanting to use the `precompile` feature will need to set the config_setting value to `enabled` instead of `auto`. Fixes #1967
5af53e6
to
2fd24d7
Compare
I think my toolchain-fu ends here, I am not sure how to create a toolchain that is only compatible with Maybe the right way to fix this is to actually have an autodetecting toolchain for the py compilation? We could have a noop compilation toolchain that never compiles anything. |
That sounds like the right approach to me! |
I'm going to continue discussion on the issue. I'm not sure there's any particularly great solution if what's happening is what I think it is. I'll post more on the issue. |
…t have a way to opt-out" This reverts commit 6d11c19.
…a way to opt-out" This reverts commit f6a37f9.
… optional toolchains" This reverts commit 2fd24d7.
…al toolchains" This reverts commit c914a9e.
…chains" This reverts commit 7db60b1.
…e callstack Stil not working: ``` $ bazel cquery 'deps(@dev_pip//charset_normalizer)' --transitions=lite --extra_toolchains=@bazel_tools//tools/python:autodetecting_toolchain | grep "toolchain dependency" Computing main repo mapping: Loading: Loading: 0 packages loaded WARNING: Build option --extra_toolchains has changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed). Analyzing: target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 0 targets configured) INFO: Analyzed target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (1 packages loaded, 1530 targets configured). INFO: Found 1 target... [toolchain dependency]#@@_main~python~python_3_11_x86_64-unknown-linux-gnu//:py_exec_tools_toolchain#NoTransition -> [toolchain dependency]#@bazel_tools//tools/python:_autodetecting_py_runtime_pair#NoTransition -> INFO: Elapsed time: 0.342s, Critical Path: 0.00s INFO: 0 processes. INFO: Build completed successfully, 0 total actions ```
With this we can finally be correct with how we deal with the precompile toolchains. This is done in two ways: 1. Add a config_setting that explicitly enableds/disables the precompile toolchains. 2. Add an autodetecting toolchain for precompile in cases where users may want to use the autodetecting toolchain and we would like to ensure that the hermetic toolchain is not pulled in because it exists and is used in the target. To keep the behaviour backwards compatible, add an alias to the autodetecting toolchain with a deprecation notice. The API is new in 0.33.0 and it is unfortunate that we have to do this, but the users should still be able to use the code as is. Fixes #1967.
Thanks to @rickeylev commenting in #1967, I think we have a workable solution moving forward: $ bazel cquery --@rules_python//python/config_settings:precompile_toolchain=enabled 'deps(@dev_pip//charset_normalizer)' --transitions=lite --extra_toolchains=@rules_python//python/autodetecting_toolchain:all | grep "toolchain dependency"
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
WARNING: Build options --//python/config_settings:precompile_toolchain and --extra_toolchains have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
Analyzing: target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 0 targets configured)
INFO: Analyzed target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (2 packages loaded, 1537 targets configured).
INFO: Found 1 target...
[toolchain dependency]#//python/autodetecting_toolchain:_autodetecting_py3_exec_toolchain#NoTransition ->
[toolchain dependency]#//python/autodetecting_toolchain:_autodetecting_py_runtime_pair#NoTransition ->
INFO: Elapsed time: 1.120s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 0 total actions
aignas@panda ~/src/github/aignas/rules_python fix/precompile-toolchain-dep
$ bazel cquery 'deps(@dev_pip//charset_normalizer)' --transitions=lite --extra_toolchains=@bazel_tools//tools/python:autodetecting_toolchain | grep "toolchain dependency"
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
WARNING: Build options --//python/config_settings:precompile_toolchain and --extra_toolchains have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
Analyzing: target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 0 targets configured)
INFO: Analyzed target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 1527 targets configured).
INFO: Found 1 target...
[toolchain dependency]#@bazel_tools//tools/python:_autodetecting_py_runtime_pair#NoTransition ->
INFO: Elapsed time: 0.600s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 0 total actions
aignas@panda ~/src/github/aignas/rules_python fix/precompile-toolchain-dep
$ bazel cquery --@rules_python//python/config_settings:precompile_toolchain=enabled 'deps(@dev_pip//charset_normalizer)' --transitions=lite | grep "toolchain dependency"
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
WARNING: Build options --//python/config_settings:precompile_toolchain and --extra_toolchains have changed, discarding analysis cache (this can be expensive, see https://bazel.build/advanced/performance/iteration-speed).
Analyzing: target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 0 targets configured)
INFO: Analyzed target @@_main~pip_internal~dev_pip//charset_normalizer:charset_normalizer (0 packages loaded, 3888 targets configured).
INFO: Found 1 target...
[toolchain dependency]#@@_main~python~python_3_11_x86_64-unknown-linux-gnu//:py_exec_tools_toolchain#NoTransition ->
[toolchain dependency]#@@_main~python~python_3_11_x86_64-unknown-linux-gnu//:python_runtimes#NoTransition ->
INFO: Elapsed time: 0.692s, Critical Path: 0.00s
INFO: 0 processes.
INFO: Build completed successfully, 0 total actions So the latest iteration adds:
|
This essentially removes the `python_version` from `flag_values` and reduces the number of targets we create by a lot because we no longer need to create all of the micro version combinations when we want to match e.g. `3.10` by using a trick I've learned in bazelbuild#1968: ```starlark select({ "is_python_3.x": "my_config_setting" "//conditions:default": "is_python_3.x" }) ``` The config settings targets in `//tests/private/pip_config_settings/...` where we have multiple python versions is changing: * ":is_*" - 995 to 996 (the extra addition being `is_python_default`) * ":_*is_*" - 28272 to 2480 CHANGELOG: - (bzlmod): optimize the creation of config settings used in pip to reduce the total number of targets.
Remove the `python_version` from `flag_values` and reduces the number of targets we create by a lot because we no longer need to create all of the micro version combinations to also match when we want to match e.g. 3.10 on a particular platform by using a trick I've learned in #1968: ```starlark select({ "is_python_3.x": "my_config_setting" "//conditions:default": "is_python_3.x" }) ``` Then further optimization was done on how we create the aliases and config settings and optimizing the usage of `pip_whl` flag finally reduced the internal number targets. The number config settings targets in `//tests/private/pip_config_settings/...` where we have multiple python versions has changed: * `:is_*` - from **995** to **996** (the extra addition being is_python_default). * `:_.*is_*` - from **28272** to **2480** (just python version) and then to **496** (final). Work towards #260
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this PR. I think this has the core of what we have to do -- add a constraint on the toolchain to prevent it from matching.
I'm going to rename the flag from precompile_toolchain to enable_exec_tools_toolchain (the toolchain isn't just for precompiling).
I'm going to remove the autodetecting toolchain impl, too. The impl itself looks fine, I just don't want to continue calling it "autodetecting", since it doesn't actually automatically do anything or detect anything.
# (target_settings AND is_precompile_enabled) | ||
target_settings = select({ | ||
is_precompile_enabled: target_settings, | ||
"//conditions:default": [is_precompile_enabled], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't figure out what the conditions:default branch here is doing.
It's saying...
If the --precompile_toolchain=enabled, then use target_settings for the toolchain.
Otherwise, use --precompile_toolchain=enabled for the target settings. i.e. this toolchain will only match if --precompile_toolchain=enabled, but that's covered by the condition above.
is this a copy/paste error?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not, I whish I could write:
target_settings = select({
is_precompile_enabled: target_settings,
"//conditions:default": ["@platforms//:incompatible"],
})
However, that does not work, or maybe I am missing something. The code above is the simplest way to have a list of target_settings
that is not empty and that will ensure that nothing will be matched.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. Yeah, that code is exactly what I was going to rewrite it to. It doesn't work? What error does it give?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idea: maybe because @platforms//:incompatible
is a constraint-thing (from the constraint()
rule, which are like...a different subtly of constraint that config settings 🤷) instead of config_setting? I'll give that a try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah. I see. That's annoying. target_settings
apparently can only accept config_settings, so the incompatible target can't be used. Meanwhile, target_compatible_with
can't be used because its nonconfigurable.
So I get the trick the original code was doing. Clever!
* remove autodetecting toolchain impl * rename flag * some small doc/comment improvements
…on into fix/precompile-toolchain-dep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated it as I described earlier. LGTM
And just to verify: I ran the cquery commands with the flag enabled/disabled and confirmed the hermetic runtime dependency isn't there by default |
This makes the exec tools toolchain disabled by default to prevent toolchain resolution from matching it and inadvertently pulling in a dependency on the hermetic runtimes. While the hermetic runtime wouldn't actually be used (precompiling is disabled by default), the dependency triggered downloading of the runtimes, which breaks environments which forbid remote downloads they haven't vetted (such a case is Bazel's own build process). To fix this, a flag is added to control if the exec tools toolchain is enabled or not. When disabled (the default), the toolchain won't match, and the remote dependency isn't triggered. Fixes #1967. Cherry-pick of cf1f36d. --------- Co-authored-by: Richard Levasseur <rlevasseur@google.com>
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [rules_python](https://togithub.com/bazelbuild/rules_python) | http_archive | minor | `0.33.2` -> `0.34.0` | --- ### Release Notes <details> <summary>bazelbuild/rules_python (rules_python)</summary> ### [`v0.34.0`](https://togithub.com/bazelbuild/rules_python/releases/tag/0.34.0) [Compare Source](https://togithub.com/bazelbuild/rules_python/compare/0.33.2...0.34.0) #### Using Bzlmod with Bazel 6 **NOTE: bzlmod support is still beta. APIs subject to change.** Add to your `MODULE.bazel` file: ```starlark bazel_dep(name = "rules_python", version = "0.34.0") pip = use_extension("@​rules_python//python/extensions:pip.bzl", "pip") pip.parse( hub_name = "pip", python_version = "3.11", requirements_lock = "//:requirements_lock.txt", ) use_repo(pip, "pip") ``` #### Using WORKSPACE Paste this snippet into your `WORKSPACE` file: ```starlark load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_python", sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618", strip_prefix = "rules_python-0.34.0", url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz", ) load("@​rules_python//python:repositories.bzl", "py_repositories") py_repositories() ``` ##### Gazelle plugin Paste this snippet into your `WORKSPACE` file: ```starlark load("@​bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") http_archive( name = "rules_python_gazelle_plugin", sha256 = "778aaeab3e6cfd56d681c89f5c10d7ad6bf8d2f1a72de9de55b23081b2d31618", strip_prefix = "rules_python-0.34.0/gazelle", url = "https://github.com/bazelbuild/rules_python/releases/download/0.34.0/rules_python-0.34.0.tar.gz", ) ### To compile the rules_python gazelle extension from source, ### we must fetch some third-party go dependencies that it uses. load("@​rules_python_gazelle_plugin//:deps.bzl", _py_gazelle_deps = "gazelle_deps") _py_gazelle_deps() ``` #### What's Changed - fix: Remove transitive legacy struct provider usage by [@​fmeum](https://togithub.com/fmeum) in [https://github.com/bazelbuild/rules_python/pull/1957](https://togithub.com/bazelbuild/rules_python/pull/1957) - docs: fix doc for how to use new bootstrap impl by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1959](https://togithub.com/bazelbuild/rules_python/pull/1959) - chore: various cleanups to make google imports/patching easier by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1958](https://togithub.com/bazelbuild/rules_python/pull/1958) - build(deps): bump idna from 3.4 to 3.7 in /tools/publish by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1849](https://togithub.com/bazelbuild/rules_python/pull/1849) - build(deps): bump cryptography from 41.0.6 to 42.0.4 in /tools/publish by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1772](https://togithub.com/bazelbuild/rules_python/pull/1772) - ci: add a custom dependabot file by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/1960](https://togithub.com/bazelbuild/rules_python/pull/1960) - build(deps): bump pygments from 2.17.2 to 2.18.0 in /docs/sphinx by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1966](https://togithub.com/bazelbuild/rules_python/pull/1966) - build(deps): bump actions/checkout from 2 to 4 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1961](https://togithub.com/bazelbuild/rules_python/pull/1961) - build(deps): bump actions/stale from 3 to 9 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1962](https://togithub.com/bazelbuild/rules_python/pull/1962) - build(deps): bump markupsafe from 2.1.3 to 2.1.5 in /docs/sphinx by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1964](https://togithub.com/bazelbuild/rules_python/pull/1964) - build(deps): bump softprops/action-gh-release from 1 to 2 by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1963](https://togithub.com/bazelbuild/rules_python/pull/1963) - build(deps): bump typing-extensions from 4.9.0 to 4.12.2 in /docs/sphinx by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1965](https://togithub.com/bazelbuild/rules_python/pull/1965) - fix(bzlmod): use same target in requirement('foo') and all_requirements by [@​jvolkman](https://togithub.com/jvolkman) in [https://github.com/bazelbuild/rules_python/pull/1973](https://togithub.com/bazelbuild/rules_python/pull/1973) - refactor(bzlmod): generate fewer targets for pip_config_settings by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/1974](https://togithub.com/bazelbuild/rules_python/pull/1974) - chore: access ctx.version_file to inform Bazel stamping info is needed by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1952](https://togithub.com/bazelbuild/rules_python/pull/1952) - build(deps): bump urllib3 from 1.26.18 to 1.26.19 in /tools/publish by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1981](https://togithub.com/bazelbuild/rules_python/pull/1981) - build(deps): bump babel from 2.13.1 to 2.15.0 in /docs/sphinx by [@​dependabot](https://togithub.com/dependabot) in [https://github.com/bazelbuild/rules_python/pull/1983](https://togithub.com/bazelbuild/rules_python/pull/1983) - docs: Fix a few typos in docs and function names by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1978](https://togithub.com/bazelbuild/rules_python/pull/1978) - fix: enable auto exec groups using attribute by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1986](https://togithub.com/bazelbuild/rules_python/pull/1986) - docs: Remove proposals by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/1990](https://togithub.com/bazelbuild/rules_python/pull/1990) - chore: use `**` globs instead of explcit BUILD.bazel reference in distribution filegroups by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1991](https://togithub.com/bazelbuild/rules_python/pull/1991) - refactor(internal): allow setting linking mode for internal cc_details APIs by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1982](https://togithub.com/bazelbuild/rules_python/pull/1982) - fix(toolchain): disable exec toolchain by default by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/1968](https://togithub.com/bazelbuild/rules_python/pull/1968) - fix: Resolve the test manifest with the runfiles lib. by [@​lberki](https://togithub.com/lberki) in [https://github.com/bazelbuild/rules_python/pull/1993](https://togithub.com/bazelbuild/rules_python/pull/1993) - fix: allow creating PyRuntimeInfo without specifying interpreter_version_info by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1992](https://togithub.com/bazelbuild/rules_python/pull/1992) - doc: Changelog updates for 0.33.2 by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/1995](https://togithub.com/bazelbuild/rules_python/pull/1995) - refactor!: Remove entrypoint by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/1987](https://togithub.com/bazelbuild/rules_python/pull/1987) - refactor: lookup exec interpreter using toolchain resolution by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/1997](https://togithub.com/bazelbuild/rules_python/pull/1997) - fix: Add `configure=True` for internal_config_repo by [@​meteorcloudy](https://togithub.com/meteorcloudy) in [https://github.com/bazelbuild/rules_python/pull/1998](https://togithub.com/bazelbuild/rules_python/pull/1998) - chore: remove dead code from whl_target_platforms by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2001](https://togithub.com/bazelbuild/rules_python/pull/2001) - fix(bzlmod): pass only non-default values to whl_library by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2002](https://togithub.com/bazelbuild/rules_python/pull/2002) - refactor: move PyPI related extension and repository_rule setup to its own dir by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2003](https://togithub.com/bazelbuild/rules_python/pull/2003) - docs: Removes dead link after docs were migrated to sphinx by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/2005](https://togithub.com/bazelbuild/rules_python/pull/2005) - refactor: Remove unused template substitution by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/2004](https://togithub.com/bazelbuild/rules_python/pull/2004) - refactor: move the remaining PyPI related functions to private/pypi by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2006](https://togithub.com/bazelbuild/rules_python/pull/2006) - chore: adjust CODEOWNERS by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2008](https://togithub.com/bazelbuild/rules_python/pull/2008) - fix: make first default output the executable again by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/2010](https://togithub.com/bazelbuild/rules_python/pull/2010) - refactor: call a function to define internal pypi flags instead of listcomp by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/2011](https://togithub.com/bazelbuild/rules_python/pull/2011) - chore: bump sphinxdocs deps by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2013](https://togithub.com/bazelbuild/rules_python/pull/2013) - fix(whl_library): correctly handle arch-specific deps in wheels by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/2007](https://togithub.com/bazelbuild/rules_python/pull/2007) - fix(multiplatform): Add i386 Linux support by [@​nicbadiu](https://togithub.com/nicbadiu) in [https://github.com/bazelbuild/rules_python/pull/1999](https://togithub.com/bazelbuild/rules_python/pull/1999) - fix: Fix broken logger statement in parse_requirements.bzl by [@​mark-thm](https://togithub.com/mark-thm) in [https://github.com/bazelbuild/rules_python/pull/2017](https://togithub.com/bazelbuild/rules_python/pull/2017) - feat: add runtime_env toolchain suite to replace "autodetecting" toolchain by [@​rickeylev](https://togithub.com/rickeylev) in [https://github.com/bazelbuild/rules_python/pull/2018](https://togithub.com/bazelbuild/rules_python/pull/2018) - fix(bzlmod): only expose common packages via the requirements constants by [@​aignas](https://togithub.com/aignas) in [https://github.com/bazelbuild/rules_python/pull/1955](https://togithub.com/bazelbuild/rules_python/pull/1955) - feat(gazelle): Add directives for label format & normalisation by [@​wingsofovnia](https://togithub.com/wingsofovnia) in [https://github.com/bazelbuild/rules_python/pull/1976](https://togithub.com/bazelbuild/rules_python/pull/1976) - chore: Remove unused renovate.json by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/2021](https://togithub.com/bazelbuild/rules_python/pull/2021) - (chore): Remove the extra indirection and `bzlmod` folder by [@​groodt](https://togithub.com/groodt) in [https://github.com/bazelbuild/rules_python/pull/2022](https://togithub.com/bazelbuild/rules_python/pull/2022) #### New Contributors - [@​lberki](https://togithub.com/lberki) made their first contribution in [https://github.com/bazelbuild/rules_python/pull/1993](https://togithub.com/bazelbuild/rules_python/pull/1993) - [@​nicbadiu](https://togithub.com/nicbadiu) made their first contribution in [https://github.com/bazelbuild/rules_python/pull/1999](https://togithub.com/bazelbuild/rules_python/pull/1999) - [@​mark-thm](https://togithub.com/mark-thm) made their first contribution in [https://github.com/bazelbuild/rules_python/pull/2017](https://togithub.com/bazelbuild/rules_python/pull/2017) - [@​wingsofovnia](https://togithub.com/wingsofovnia) made their first contribution in [https://github.com/bazelbuild/rules_python/pull/1976](https://togithub.com/bazelbuild/rules_python/pull/1976) **Full Changelog**: bazelbuild/rules_python@0.33.1...0.34.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/bazel-contrib/rules_bazel_integration_test). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40MjEuOSIsInVwZGF0ZWRJblZlciI6IjM3LjQyMS45IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
This makes the exec tools toolchain disabled by default to prevent toolchain resolution
from matching it and inadvertently pulling in a dependency on the hermetic runtimes.
While the hermetic runtime wouldn't actually be used (precompiling is disabled
by default), the dependency triggered downloading of the runtimes, which breaks
environments which forbid remote downloads they haven't vetted (such a case is
Bazel's own build process).
To fix this, a flag is added to control if the exec tools toolchain is enabled or not.
When disabled (the default), the toolchain won't match, and the remote dependency isn't
triggered.
Fixes #1967.