Skip to content

fix(config): normalize included config paths #16964

Merged
epage merged 2 commits intorust-lang:masterfrom
weihanglo:env-normalize
May 4, 2026
Merged

fix(config): normalize included config paths #16964
epage merged 2 commits intorust-lang:masterfrom
weihanglo:env-normalize

Conversation

@weihanglo
Copy link
Copy Markdown
Member

What does this PR try to resolve?

Extracted from #16957.

Without normalizing included config paths,
Definition::root() will do parent().parent()
on non-normalized paths containing .. segments.
And that will remove .. and result in wrong path resolution.

How to test and review this PR?

Two tested are added to showcase the buggy behavior, especially env_relative_path_included_from_upper_level which was a wrong path resolution.

weihanglo added 2 commits May 4, 2026 17:39
Without normalizing included config paths,
`Definition::root()` will do `parent().parent()`
on non-normalized paths containing `..` segments.
And that will remove `..` and result in wrong path resolution.
@rustbot rustbot added A-configuration Area: cargo config files and env vars S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 4, 2026
@rustbot
Copy link
Copy Markdown
Collaborator

rustbot commented May 4, 2026

r? @ehuss

rustbot has assigned @ehuss.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ehuss, @epage, @weihanglo
  • @ehuss, @epage, @weihanglo expanded to ehuss, epage, weihanglo
  • Random selection from ehuss, epage

@epage epage added this pull request to the merge queue May 4, 2026
Merged via the queue into rust-lang:master with commit 5fbaf43 May 4, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 4, 2026
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request May 9, 2026
Update cargo submodule

13 commits in 4f9b52075316e9ced380c8fa492858048d5758b6..a343accce8526b128adc517d33348573d22920a3
2026-05-01 22:36:41 +0000 to 2026-05-08 22:41:35 +0000
- docs(guide): Fix a typo (rust-lang/cargo#16980)
- chore(deps): update msrv (3 versions) to v1.93 (rust-lang/cargo#16979)
- refactor(diag): Move lints to diagnostics (rust-lang/cargo#16978)
- refactor(lints): Pull out `unknown_lints` lint logic and `missing_lints_features` diagnostic logic (rust-lang/cargo#16976)
- refactor(lints): Move things out of `lints/mod.rs` (rust-lang/cargo#16975)
- test: cover search API redirects (rust-lang/cargo#16971)
- refactor(lints): Instrument lints for logging  (rust-lang/cargo#16972)
- docs: `.cargo-checksum.json` is not a security mechanism (rust-lang/cargo#16966)
- fix(vendor): add `$comment` to `.cargo-checksum.json` (rust-lang/cargo#16967)
- test: Fixed arg order in rustdoc json test (rust-lang/cargo#16968)
- fix(config): `[env]` relative paths definition  (rust-lang/cargo#16957)
- fix(config): normalize included config paths  (rust-lang/cargo#16964)
- Fix heading level of `build.warnings` documentation. (rust-lang/cargo#16961)

r? ghost
@rustbot rustbot added this to the 1.97.0 milestone May 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-configuration Area: cargo config files and env vars

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants