-
Notifications
You must be signed in to change notification settings - Fork 389
Allow building Miri with --features from miri-script #4396
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
base: master
Are you sure you want to change the base?
Conversation
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! Overall, I am on board. I left some comments.
I'd prefer if we didn't have to pass this around everywhere, it seems easy to mix up the feature lists. But that seems like a larger refactor... so not for this PR.
Otherwise there was no way to pass e.g. `--features tracing` just to the `cargo` commands issued on the root repository: CARGO_EXTRA_FLAGS applies the flags to the "cargo-miri" crate, too, which does not make sense for crate-specific features.
Since the second concatenation was against an absolute path, it didn't do anything. This also makes the interface of install_to_sysroot() similar to that of cargo_cmd()
Also fix not passing features to one of the cargo invocations for test
6eba306
to
967a531
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 for the review! I force pushed to remove the unrelated file (I made the commit a few weeks ago and cherry picked it a few times, and that file was committed accidentally at some point, sorry for not noticing). I also pushed a commit to add --features to clippy and to auto_actions and to fix the order of features and flags.
| Command::Run { features, .. } | ||
| Command::Doc { features, .. } | ||
| Command::Clippy { features, .. } => Self::auto_actions(features.clone())?, | ||
| Command::Fmt { .. } => Self::auto_actions(vec![])?, |
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.
Fmt
does not have features, however the features might be needed for some auto action. Should I add features
to Fmt
too, and expand its doc to explain how it's not actually used for Fmt
but rather for auto actions?
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.
Adding this to fmt
just for auto-clippy doesn't make sense IMO. I don't think auto-clippy should enable any features... but I don't use auto-clippy anyway. @oli-obk what do you think?
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.
auto-clippy should be indistinguishable from ./miri clippy
, so no features, yes.
I added the
--features
flag to allCommand
s for whichcargo
can accept--features
, i.e. install, build, check, test, run, doc. Those who can't accept--features
are clippy, fmt, toolchain, rustc pull, rustc push, squash (the last 4 are not even cargo commands). Furthermore, I did not add it to theBench
command since that command doesn't take any "--flags" either.This PR is needed because there is no way to pass e.g.
--features tracing
just to thecargo
commands issued on the root repository. UnfortunatelyCARGO_EXTRA_FLAGS
applies the flags to the "cargo-miri" crate, too, which does not make sense for crate-specific features.This PR also includes a small commit to make the interface of
install_to_sysroot
clearer.Note: this PR is the counterpart to rust-lang/rust#142379, which is for when Miri is built in the rustc repo.