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

Fix bug with PathAndArg config values #8629

Merged
merged 2 commits into from
Aug 18, 2020
Merged

Fix bug with PathAndArg config values #8629

merged 2 commits into from
Aug 18, 2020

Conversation

Jake-Shadle
Copy link
Contributor

This fixes an issue I noticed when trying to specify a target runner via the CARGO_TARGET_{triplet}_RUNNER environment variable, expecting it to override the value in our .cargo/config.toml file, which was giving quite strange errors until I figured out that cargo was actually merging the config file's values with the environment's values.

This change adds a small hack to use and UnmergedStringList from PathAndArgs instead of just plain StringList, which uses the type in the deserializer to determine if Config::get_list_or_string should merge the values from the config file(s) with the environment as it was doing before, or else only use the environment to the exclusion of the config file(s) if the key was set in the environment.

I also added a test for this to confirm both the bug and the fix.

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @ehuss (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2020
@ehuss
Copy link
Contributor

ehuss commented Aug 18, 2020

Thanks! For context, this was changed in #7891 (in 1.43), and the change to runner wasn't intended (not sure how I missed that).

@bors r+

@bors
Copy link
Collaborator

bors commented Aug 18, 2020

📌 Commit ddc7090 has been approved by ehuss

@bors 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 Aug 18, 2020
@bors
Copy link
Collaborator

bors commented Aug 18, 2020

⌛ Testing commit ddc7090 with merge f03698b...

@bors
Copy link
Collaborator

bors commented Aug 18, 2020

☀️ Test successful - checks-actions
Approved by: ehuss
Pushing f03698b to master...

@bors bors merged commit f03698b into rust-lang:master Aug 18, 2020
@Jake-Shadle
Copy link
Contributor Author

No worries, thanks for the quick merge!

bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 20, 2020
Update cargo

5 commits in ab32ee88dade1b50c77347599e82ca2de3fb8a51..51b66125ba97d2906f461b3f4e0408f206299bb6
2020-08-10 17:44:43 +0000 to 2020-08-19 20:22:52 +0000
- Add chapters on dependency resolution and SemVer compatibility. (rust-lang/cargo#8609)
- Renames SourceId::into_url -> SourceId::as_url (rust-lang/cargo#8611)
- Fix bug with PathAndArg config values (rust-lang/cargo#8629)
- Show full error context on `cargo run` error. (rust-lang/cargo#8627)
- Fix typo in SIGQUIT description (rust-lang/cargo#8615)
@ehuss ehuss added this to the 1.47.0 milestone Feb 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants