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.
Fix problems with the non-strict Python toolchain
1. Change the Python workspace suffix from registering all toolchains (via `:all`) in the @bazel_tools//tools/python package, to just registering the normal autodetecting toolchain. This ensures that the non-strict toolchain never inadvertently gets higher precedence than the standard toolchain. (This may have been working before by chance, but let's be safe and not rely on target pattern expansion order.) A side-effect of this is that we need to make our analysis and shell integration tests use the standard toolchain's name. 2. Fix bad quoting that caused the suggested command line flag to not be printed 3. Now that the wrapper is shared, there's two possible names for the toolchain, so output the right one in error messages. Fixes bazelbuild#8576, follow-up to bazelbuild#8547. RELNOTES: None PiperOrigin-RevId: 251937305
- Loading branch information
1 parent
dc6d3b5
commit 50fa3ec
Showing
4 changed files
with
26 additions
and
12 deletions.
There are no files selected for viewing
8 changes: 7 additions & 1 deletion
8
src/main/java/com/google/devtools/build/lib/bazel/rules/python/python.WORKSPACE
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 |
---|---|---|
@@ -1 +1,7 @@ | ||
register_toolchains("@bazel_tools//tools/python:all") | ||
# Don't use the target pattern :all, because we don't want to register | ||
# :autodetecting_toolchain_nonstrict. That toolchain opts out of Python version | ||
# checking, so the user should have to explicitly declare it on their command | ||
# line or WORKSPACE file. (And even if we did register it here, we still | ||
# couldn't use :all because we'd want to ensure it has the lowest possible | ||
# priority.) | ||
register_toolchains("@bazel_tools//tools/python:autodetecting_toolchain") |
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