cargo-bazel now supports alias_rule to customize the aliases generated#2312
Merged
Conversation
rickvanprim
commented
Dec 9, 2023
2299838 to
1cf5db2
Compare
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
This looks great, thanks!
I'll leave this one open for a day or two in case anyone else wants to jump in, otherwise I left a few comments :))
1cf5db2 to
39af75f
Compare
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
Generally LGTM modulo the comments :)
illicitonion
added a commit
to illicitonion/rules_rust
that referenced
this pull request
Dec 13, 2023
I intend to publish this to crates.io after review. This will be used to test bazelbuild#2312.
illicitonion
added a commit
to illicitonion/rules_rust
that referenced
this pull request
Dec 13, 2023
I intend to publish this to crates.io after review. This will be used to test bazelbuild#2312.
illicitonion
added a commit
that referenced
this pull request
Dec 13, 2023
I intend to publish this to crates.io after review. This will be used to test #2312.
fb9c17f to
326eed7
Compare
cargo-bazel generated targets can optionally always use transition_opt_alias to transition to compilation_mode=opt.cargo-bazel now supports alias_rule to customize the aliases generated
326eed7 to
36df1f7
Compare
…` to apply transitions, including builtin ones for `compilation_mode=dbg|fastbuild|opt`.
36df1f7 to
ff6c8ec
Compare
illicitonion
approved these changes
Dec 15, 2023
Collaborator
illicitonion
left a comment
There was a problem hiding this comment.
Surprisingly clean! Nicely put together, thanks!
Just one bikeshed to paint :)
| #[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Serialize, Deserialize, Clone)] | ||
| pub enum AliasRule { | ||
| #[default] | ||
| #[serde(rename = "default")] |
Collaborator
There was a problem hiding this comment.
I would be tempted to call this alias or native.alias rather than default? WDYT?
641f09a to
e944808
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivator is to be able to set
default_alias_rule = "opt"so that all Cargo fetched 3rd party dependencies are built withcompilation_mode=optregardless of whatcompilation_modethe local code is being built with.Per my conversation with @illicitonion. Please bikeshed on naming 🙂