-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Transition uv to the correct platform (#122)
Currently, uv is selected for the exec platform. If it were used as part of a build action, this would be correct, but as it is invoked by an emitted shell script it is not. This causes it to fail when running builds on one platform, but targeting another. This is the case, for example, when running builds in a remote execution cluster with Linux workers, but compiling for a Mac. This patch transitions uv to the proper platform, allowing it to work in this situation.
- Loading branch information
Showing
3 changed files
with
23 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
"Helper rule to ensure that uv is resolved for the target architecture" | ||
|
||
def _transition_to_target_impl(settings, _attr): | ||
return { | ||
# String conversion is needed to prevent a crash with Bazel 6.x. | ||
"//command_line_option:extra_execution_platforms": [ | ||
str(platform) | ||
for platform in settings["//command_line_option:platforms"] | ||
], | ||
} | ||
|
||
transition_to_target = transition( | ||
implementation = _transition_to_target_impl, | ||
inputs = ["//command_line_option:platforms"], | ||
outputs = ["//command_line_option:extra_execution_platforms"], | ||
) |
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