Skip to content

Commit

Permalink
Look up CARGO_BAZEL_GENERATOR_PATH correctly (#2088)
Browse files Browse the repository at this point in the history
The intent is to allow this variable to be passed in an --action_env,
but ctx.var is not where these show up:
ctx.configuration.default_shell_env is.
  • Loading branch information
HackAttack authored Dec 29, 2024
1 parent 89aec55 commit 22d40b8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Francois-Rene Rideau <[email protected]>
Julio Merino <[email protected]>
Kamal Marhubi <[email protected]>
Kristina Chodorow <[email protected]>
Michael Hackner <[email protected]>
Philipp Wollermann <[email protected]>
Ulf Adams <[email protected]>
Justine Alexandra Roberts Tunney <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions crate_universe/private/crates_vendor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,8 @@ def _crates_vendor_impl(ctx):
cargo_bazel_runfiles = []

# Allow action envs to override the use of the cargo-bazel target.
if CARGO_BAZEL_GENERATOR_PATH in ctx.var:
bin_path = ctx.var[CARGO_BAZEL_GENERATOR_PATH]
if CARGO_BAZEL_GENERATOR_PATH in ctx.configuration.default_shell_env:
bin_path = ctx.configuration.default_shell_env[CARGO_BAZEL_GENERATOR_PATH]
elif ctx.executable.cargo_bazel:
bin_path = _runfiles_path(ctx.executable.cargo_bazel, is_windows)
cargo_bazel_runfiles.append(ctx.executable.cargo_bazel)
Expand Down

0 comments on commit 22d40b8

Please sign in to comment.