Skip to content

Commit b60486c

Browse files
committed
Use correct env for rust_test
This expands the `rust_test` environment make variables directly instead of using the "build script" helper. The build script helper is incorrect here and this leads issues in Bazel 8.
1 parent 3cbb3fc commit b60486c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

rust/private/rust.bzl

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -518,12 +518,14 @@ def _rust_test_impl(ctx):
518518
)
519519
data = getattr(ctx.attr, "data", [])
520520

521-
env = expand_dict_value_locations(
522-
ctx,
523-
getattr(ctx.attr, "env", {}),
524-
data,
525-
{},
526-
)
521+
env = {
522+
key: ctx.expand_make_variables(
523+
"env",
524+
ctx.expand_location(value, ctx.attr.data, short_paths = True),
525+
{},
526+
)
527+
for key, value in ctx.attr.env.items()
528+
}
527529
if toolchain.llvm_cov and ctx.configuration.coverage_enabled:
528530
if not toolchain.llvm_profdata:
529531
fail("toolchain.llvm_profdata is required if toolchain.llvm_cov is set.")

0 commit comments

Comments
 (0)