Skip to content
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

Specifying --profile and --release when running cargo rustc doesn't work anymore #7488

Closed
koute opened this issue Oct 7, 2019 · 4 comments · Fixed by #7489
Closed

Specifying --profile and --release when running cargo rustc doesn't work anymore #7488

koute opened this issue Oct 7, 2019 · 4 comments · Fixed by #7489
Labels
C-bug Category: bug

Comments

@koute
Copy link
Member

koute commented Oct 7, 2019

Problem
This used to work:

cargo rustc --lib --profile test --release

Now it doesn't:

$ 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

  1. cargo new --lib foobar
  2. cd foobar
  3. 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)

This is a regression from stable to nightly.

@koute koute added the C-bug Category: bug label Oct 7, 2019
@koute
Copy link
Member Author

koute commented Oct 7, 2019

cc @da-x

@da-x
Copy link
Member

da-x commented Oct 7, 2019

@koute - sorry for the regression. Queued up a fix.

@koute
Copy link
Member Author

koute commented 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
Copy link
Member

da-x commented 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.

da-x added a commit to da-x/cargo that referenced this issue Oct 8, 2019
bors added a commit that referenced this issue Oct 8, 2019
when -Z unstable-options not specified, don't validate --profile

This fixes a regression caused by 8b0561d - Closes #7488.
@bors bors closed this as completed in 1e57d7a Oct 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants