Skip to content

Commit 6817978

Browse files
committed
Set env vars for build scripts too
1 parent 0fee1ee commit 6817978

File tree

4 files changed

+333
-22
lines changed

4 files changed

+333
-22
lines changed

crate_universe/src/rendering.rs

+3
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ impl Renderer {
367367
.common_attrs
368368
.rustc_env_files
369369
.insert(":cargo_toml_env_vars".to_owned(), None);
370+
if let Some(ref mut build_script_attrs) = &mut krate.build_script_attrs {
371+
build_script_attrs.rustc_env_files.insert(":cargo_toml_env_vars".to_owned(), None);
372+
}
370373
}
371374

372375
let mut starlark = Vec::new();

examples/crate_universe/cargo_local/BUILD.bazel

+1
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ build_test(
2323
targets = [
2424
# This target would fail to build if cargo_toml_env_vars didn't properly populate $CARGO_PKG_REPOSITORY.
2525
"@crate_index_cargo_local//:autometrics",
26+
"@crate_index_cargo_local//:aws-lc-rs",
2627
],
2728
)

0 commit comments

Comments
 (0)