-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Can not override previous opt-levels in list of command flags #7493
Comments
Yeah, this should be fixed. Maybe in addition, there should be a warning message saying something like "you supplied -O and --opt-level=3, but I'm assuming you meant --opt-level=3". |
visiting for triage. This is still valid and should be easy to fix. Setting tags respectively and myself as mentor. EDIT: The error raised is |
I'm not really convinced that this should be changed. A |
@thestinger that's also a good solution. I'm fine with both, TBH. @alexcrichton any opinion on this? Otherwise I think we can close this issue for now. |
|
@huonw I find that behavior to be more intuitive but I don't have a strong opinion for this specific case. |
I could go either way on this. While not exactly kosher, it is convenient to have overrides like this sometimes. |
Hey, I'm looking to fix this bug. Should the default behavior be to accept "--opt-level=X" over "-O" if both are given? if the latter, after looking at the getopts module, it doesn't seem as if there is a way to determine the ordering among two arguments, unless I'm mistaken. |
Whichever is last should be overridden @kl4ng so that appended options can override each other. |
Should this issue be closed? |
This bug should be fixed, either by fixing getopts or by moving rustc to another argument parser. |
Was it not fixed by the closed PR? |
The PR was closed and not merged. |
@jgallagher it was closed, not merged. :) |
Ahh my mistake, it was closed without merging. |
This discussion should probably move to the RFcs repo. cc @steveklabnik |
Visiting for triage. Specifying |
I did this in #32399. The conclusion then was this needs changes to |
Removing easy label because lack of agreement on way forward. |
…r=alexcrichton Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting Allow `-O` and `-C opt-level`, and `-g` and `-C debuginfo` to be specified simultaneously without conflict. In such cases, the rightmost provided option is chosen. Fixes rust-lang#7493. Fixes rust-lang#32352. ~Blocked on rust-lang/getopts#79 r? @alexcrichton
Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting Allow `-O` and `-C opt-level`, and `-g` and `-C debuginfo` to be specified simultaneously without conflict. In such cases, the rightmost provided option is chosen. Fixes #7493. Fixes #32352. ~Blocked on rust-lang/getopts#79 r? @alexcrichton
…r=alexcrichton Stop `-O`/`-C opt-level` and `-g`/`-C debuginfo` conflicting Allow `-O` and `-C opt-level`, and `-g` and `-C debuginfo` to be specified simultaneously without conflict. In such cases, the rightmost provided option is chosen. Fixes rust-lang#7493. Fixes rust-lang#32352. ~Blocked on rust-lang/getopts#79 r? @alexcrichton
…impl-type, r=camsteffen Prefer a code snipped over formatting the self type (`new_without_default`) Fixes: rust-lang/rust-clippy#7220 changelog: [`new_without_default`]: The `Default` impl block type doesn't use the full type path qualification Have a nice day to everyone reading this 🙃
If one passes multiple opt-level flags to the compiler (for example -O, and --opt-level=3) then an error results. Instead, the previous setting should be overridden. This is bad because then makefiles don't work easily. For example, I had to use the command line
make RUSTFLAGS=--opt-level=3 DISABLE_OPTIMIZE=1
instead of the more obviousmake RUSTFLAGS=--opt-level=3
when compiling rust as optimized because of this error.The text was updated successfully, but these errors were encountered: