-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
fix(cargo-rustc): give trailing flags higher precedence on nightly #14587
Merged
Conversation
This file contains 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
rustbot
added
A-build-execution
Area: anything dealing with executing the compiler
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 24, 2024
weihanglo
changed the title
test(cargo-rustc): show the current precedence
fix(cargo-rustc): give trailing flags higher precedence
Sep 24, 2024
epage
reviewed
Sep 24, 2024
Previously `cargo rustc -- <flags>` got a lower precedence than some of the flags set by cargo internal. This is a bit unintuitive as Cargo generally treats user-provided CLI flags with the highest priority. This commit changes `cargo rustc -- <flags>` to a higher precedence: higher than most of flags set by Cargo, and only lower than `build.rustflags` family. Unsure if this affects people's workflow, so this behavior is only enabled on nightly for collectin feedback. A environment variable `__CARGO_RUSTC_ORIG_ARGS_PRIO=1` is provided for users to opt-out. If everything goes well, the nightly gate will be removed after a few of releases. See discussion on https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/rustflags.20precendence.20of.20.60cargo.20rustc.60
weihanglo
force-pushed
the
cargo-rustc
branch
from
September 25, 2024 13:29
0ccf610
to
35bb3de
Compare
@bors r+ |
bors
added
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
Sep 25, 2024
epage
changed the title
fix(cargo-rustc): give trailing flags higher precedence
fix(cargo-rustc): give trailing flags higher precedence on nightly
Sep 25, 2024
Should we keep #14346 open for tracking stabilization? |
☀️ Test successful - checks-actions |
This was referenced Sep 25, 2024
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Sep 28, 2024
Update cargo 19 commits in eaee77dc1584be45949b75e4c4c9a841605e3a4b..80d82ca22abbee5fb7b51fa1abeb1ae34e99e88a 2024-09-19 21:10:23 +0000 to 2024-09-27 17:56:01 +0000 - Update cc to 1.1.22 (rust-lang/cargo#14607) - feat: lockfile path implies --locked on cargo install (rust-lang/cargo#14556) - feat(toml): Add `autolib` (rust-lang/cargo#14591) - fix: correct error count for `cargo check --message-format json` (rust-lang/cargo#14598) - test: relax panic output assertion (rust-lang/cargo#14602) - feat(timings): support dark color scheme in HTML output (rust-lang/cargo#14588) - feat: add CARGO_MANIFEST_PATH env variable (rust-lang/cargo#14404) - fix(config): Don't double-warn about `$CARGO_HOME/config` (rust-lang/cargo#14579) - fix(cargo-rustc): give trailing flags higher precedence on nightly (rust-lang/cargo#14587) - feat: make lockfile v4 the default (rust-lang/cargo#14595) - perf: Improve quality of completion performance traces (rust-lang/cargo#14592) - test: Remove completion tests (rust-lang/cargo#14590) - feat: Add support for completing `cargo update <TAB>` (rust-lang/cargo#14552) - test: Migrate remaining with_stdout/with_stderr calls (rust-lang/cargo#14577) - fix(resolve): Improve multi-MSRV workspaces (rust-lang/cargo#14569) - chore: Bump MSRV to 1.81 (rust-lang/cargo#14585) - Add a `--dry-run` flag to the `install` command (rust-lang/cargo#14280) - fix(resolve): Don't list transitive, incompatible dependencies as available (rust-lang/cargo#14568) - feat(complete): Upgrade clap_complete (rust-lang/cargo#14573)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-build-execution
Area: anything dealing with executing the compiler
S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
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.
What does this PR try to resolve?
Previously
cargo rustc -- <flags>
got a lower precedence thansome of the flags set by cargo internal.
This is a bit unintuitive as Cargo generally treats user-provided
CLI flags with the highest priority.
This commit changes
cargo rustc -- <flags>
to a higher precedence:higher than most of flags set by Cargo, and only lower than
build.rustflags
family.How should we test and review this PR?
Unsure if this affects people's workflow, so this behavior is only
enabled on nightly for collectin feedback. A environment variable
__CARGO_RUSTC_ORIG_ARGS_PRIO=1
is provided for users to opt-out.If everything goes well, the nightly gate will be removed after a
few of releases.
Additional information
See discussion on https://rust-lang.zulipchat.com/#narrow/stream/246057-t-cargo/topic/rustflags.20precendence.20of.20.60cargo.20rustc.60
Fixes #14346