-
Notifications
You must be signed in to change notification settings - Fork 434
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build rust_test
targets using a crate name different from the underlying lib
#2828
Build rust_test
targets using a crate name different from the underlying lib
#2828
Conversation
65363ab
to
25d9133
Compare
underlying lib This is a rollforward of bazelbuild#2803, but behind a feature flag. This PR also makes `rust_test` put its compilation outputs in the same directory as the `rust_library` rule (i.e. not in a `test-{hash}` subdirectory anymore). After this change both the `rust_library` and `rust_test` rules will put all its compilation outputs in the same directory, but there won't be any name collisions in non-sandboxed environments (see bazelbuild#1427 for more context). Issue: bazelbuild#2827
25d9133
to
a99f026
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Had a few questions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Could I also get you to make (or modify an existing) issue ticket to track the new incompatibility flag? We have some guidance on https://github.com/bazelbuild/rules_rust/blob/0.49.3/COMPATIBILITY.md#how-to-make-a-backwards-incompatible-change but since this could be a breaking change we try to give users a chance to raise concerns during the rollout. I've been writing mine to look like #2082
I have filed an issue for this, see #2827. Is there anything specific that's missing there? |
61662e9
to
7e498f3
Compare
7e498f3
to
0656abd
Compare
I've also fixed the windows tests (that weren't working due to the toolchain binary extension) and added an assert on the directory name as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! Thank you!
Just gotta resolve the conflicts! |
5c98d7a
to
69e493c
Compare
…nd-change-rust-test-compilation-output-dir
69e493c
to
3986b3b
Compare
All done. |
This is a rollforward of
#2803, but behind the
incompatible_change_rust_test_compilation_output_directory
incompatible flag.This PR also makes
rust_test
put its compilation outputs in the same directory as therust_library
rule (i.e. not in atest-{hash}
subdirectory anymore).After this change both the
rust_library
andrust_test
rules will put all its compilation outputs in the same directory, but there won't be any name collisions in non-sandboxed environments (see #1427 for more context).Issue with context: #2827