Skip to content

Commit 7b28d2f

Browse files
committed
Gate env vars on coverage being enabled
1 parent 87cc740 commit 7b28d2f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rust/private/rust.bzl

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -466,8 +466,9 @@ def _rust_test_common(ctx, toolchain, output):
466466
getattr(ctx.attr, "env", {}),
467467
data,
468468
)
469-
env["RUST_LLVM_COV"] = toolchain.llvm_cov.path
470-
env["RUST_LLVM_PROFDATA"] = toolchain.llvm_profdata.path
469+
if ctx.configuration.coverage_enabled:
470+
env["RUST_LLVM_COV"] = toolchain.llvm_cov.path
471+
env["RUST_LLVM_PROFDATA"] = toolchain.llvm_profdata.path
471472
providers.append(testing.TestEnvironment(env))
472473

473474
return providers

0 commit comments

Comments
 (0)