fix(uv): fix UV_BIN usage with current_toolchain#2074
Merged
aignas merged 3 commits intobazel-contrib:mainfrom Jul 19, 2024
Merged
fix(uv): fix UV_BIN usage with current_toolchain#2074aignas merged 3 commits intobazel-contrib:mainfrom
aignas merged 3 commits intobazel-contrib:mainfrom
Conversation
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 bazel-contrib#2059 to decrease its scope, so that this can be discussed separately. Work towards bazel-contrib#1975
groodt
reviewed
Jul 18, 2024
| original_uv_executable = toolchain_info.uv_toolchain_info.uv[DefaultInfo].files_to_run.executable | ||
| symlink_uv_executable = ctx.actions.declare_file("uv_symlink_{}".format(original_uv_executable.basename)) | ||
|
|
||
| # Use `uv` as the name of the binary to make the help message well formatted |
Collaborator
There was a problem hiding this comment.
nit: The only reason I went with a weird name, was because I was worried about Windows. I might be wrong, but I thought Windows requires(ed) that executables have the .exe suffix?
Collaborator
Author
|
Regarding the name of the binary, it seems that the CI is happy, so I'll roll I think the |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Before this PR the
uvtoolchain could not be used in agenruleitseems because the
//python/uv:toolchaindoes not have the necessaryproviders for using the make variables and the re-exporting of the make
variables from the
toolchainin thecurrent_toolchainrule did notseem to work.
This PR removes the provider construction in the
toolchainand doesthat only in the
current_toolchain. This better mirrors how the Pythontoolchains are setup (grepping
PYTHON3is sufficient to get examples).This also splits out work done in #2059 to decrease its scope, so that
this can be discussed separately.
Work towards #1975