forked from bazelbuild/rules_python
-
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(uv): fix UV_BIN usage with current_toolchain
Before this PR the `uv` toolchain could not be used in a `genrule` it seems because the `//python/uv:toolchain` does not have the necessary providers for using the make variables and the re-exporting of the make variables from the `toolchain` in the `current_toolchain` rule did not seem to work. This PR removes the provider construction in the `toolchain` and does that only in the `current_toolchain`. This better mirrors how the Python toolchains are setup (grepping `PYTHON3` is sufficient to get examples). This also splits out work done in bazelbuild#2059 to decrease its scope, so that this can be discussed separately. Work towards bazelbuild#1975
- Loading branch information
Showing
6 changed files
with
44 additions
and
10 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
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,16 @@ | ||
load("@bazel_skylib//rules:build_test.bzl", "build_test") | ||
|
||
genrule( | ||
name = "uv_help", | ||
outs = ["uv_help.txt"], | ||
cmd = "$(UV_BIN) --python-fetch manual --help >$@", | ||
toolchains = [ | ||
"//python/uv:current_toolchain", | ||
"//python:current_py_toolchain", | ||
], | ||
) | ||
|
||
build_test( | ||
name = "test_uv_toolchain_make_vars", | ||
targets = [":uv_help"], | ||
) |