Skip to content

Commit cdc3bd8

Browse files
committed
Gate env vars on coverage being enabled
1 parent 0503733 commit cdc3bd8

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
@@ -410,8 +410,9 @@ def _rust_test_common(ctx, toolchain, output):
410410
getattr(ctx.attr, "env", {}),
411411
data,
412412
)
413-
env["RUST_LLVM_COV"] = toolchain.llvm_cov.path
414-
env["RUST_LLVM_PROFDATA"] = toolchain.llvm_profdata.path
413+
if ctx.configuration.coverage_enabled:
414+
env["RUST_LLVM_COV"] = toolchain.llvm_cov.path
415+
env["RUST_LLVM_PROFDATA"] = toolchain.llvm_profdata.path
415416
providers.append(testing.TestEnvironment(env))
416417

417418
return providers

0 commit comments

Comments
 (0)