Skip to content

Conversation

@dzbarsky
Copy link
Contributor

Fixes #3625, see that issue for explanation

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Can you add a regression test for this?

@dzbarsky dzbarsky force-pushed the zbarsky/rust-build-env branch from 15e0069 to ebc8afe Compare September 27, 2025 00:03
@dzbarsky
Copy link
Contributor Author

Thanks! Can you add a regression test for this?

Yeah, I wasn't sure the best way to test this. Ideally we would have some e2e cargo_universe tests but I didn't see them (maybe I missed them)? I can add a unit test for this attribute though, it would be better than nothing

@dzbarsky dzbarsky force-pushed the zbarsky/rust-build-env branch 2 times, most recently from 3d551d1 to d3cff53 Compare September 27, 2025 00:12
@UebelAndre
Copy link
Collaborator

Thanks! Can you add a regression test for this?

Yeah, I wasn't sure the best way to test this. Ideally we would have some e2e cargo_universe tests but I didn't see them (maybe I missed them)? I can add a unit test for this attribute though, it would be better than nothing

Well the straight forward one is the change to cargo_build_script where you can generate an env file and make sure that's set where you expect it. For crate_universe that's a bit more complicated...

@dzbarsky dzbarsky force-pushed the zbarsky/rust-build-env branch from d3cff53 to 7dc0363 Compare September 27, 2025 00:22
@dzbarsky
Copy link
Contributor Author

Thanks! Can you add a regression test for this?

Yeah, I wasn't sure the best way to test this. Ideally we would have some e2e cargo_universe tests but I didn't see them (maybe I missed them)? I can add a unit test for this attribute though, it would be better than nothing

Well the straight forward one is the change to cargo_build_script where you can generate an env file and make sure that's set where you expect it. For crate_universe that's a bit more complicated...

Yep that's what I ended up implementing, PTAL :)

Copy link
Collaborator

@UebelAndre UebelAndre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@UebelAndre UebelAndre added this pull request to the merge queue Sep 27, 2025
Merged via the queue into bazelbuild:main with commit 56176ea Sep 27, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cargo toml env vars are not set on build scripts at runtime

2 participants