You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Specifying --profile and --release when running cargo rustc doesn't work anymore #7488
$ cargo rustc --lib --profile test --release
error: Conflicting usage of --profile and --release
How am I supposed to compile unit tests in release mode through cargo rustc now? I can use --tests, but that will also compile integration tests (which I don't want), and --test $crate_name doesn't work.
Steps
cargo new --lib foobar
cd foobar
cargo rustc --lib --profile test --release
Notes
Version which worked: cargo 1.39.0-nightly (3596cb86b 2019-09-19) (and all of the previous versions)
Version which doesn't work: cargo 1.40.0-nightly (8b0561d68 2019-09-30)
It's nice to see that cargo's handling of profiles is getting cleaned up. However, this definitely needs a deprecation warning so that whoever depends on the current behavior could migrate, and it'd also be great if we made sure that there is no loss of functionality (e.g. the case where I want to compile only the unit tests in release mode, which as far as I can see after your changes becomes impossible?).
@koute. Yes, this was discussed when implementing the PR for the RFC. We may need to gather up these use cases and have special flags for them, or do something else.
Activity
koute commentedon Oct 7, 2019
cc @da-x
named-profiles: when -Z unstable-options not specified, don't validat…
da-x commentedon Oct 7, 2019
@koute - sorry for the regression. Queued up a fix.
koute commentedon Oct 7, 2019
Thanks!
It's nice to see that
cargo's handling of profiles is getting cleaned up. However, this definitely needs a deprecation warning so that whoever depends on the current behavior could migrate, and it'd also be great if we made sure that there is no loss of functionality (e.g. the case where I want to compile only the unit tests in release mode, which as far as I can see after your changes becomes impossible?).da-x commentedon Oct 7, 2019
@koute. Yes, this was discussed when implementing the PR for the RFC. We may need to gather up these use cases and have special flags for them, or do something else.
tests: cover issue rust-lang#7488
Auto merge of #7489 - da-x:fix-7488, r=ehuss