Skip to content

refactor(context): normalize in homedir instead#17222

Merged
weihanglo merged 1 commit into
rust-lang:masterfrom
hirehamir:refactor/normalize-in-homedir
Jul 18, 2026
Merged

refactor(context): normalize in homedir instead#17222
weihanglo merged 1 commit into
rust-lang:masterfrom
hirehamir:refactor/normalize-in-homedir

Conversation

@hirehamir

Copy link
Copy Markdown
Contributor

What Does This PR Try to Resolve?

This is a follow-up to #17204.

That fix normalized inside read_packages.

As noted in review, Cargo prefers to normalize at the exterior and assume interiors are clean.

This change moves the normalize_path to homedir, and removes the interior normalization.

How to Test and Review This PR?

  • config_symlink_home_duplicate_load and install_git_with_symlink_home pass. Symlink handling appears undisturbed.
  • no_duplicate_package_warning_with_dotdot_cargo_home (added in fix(source): incorrect duplicate package warning #17204) still passes. The exterior placement fixes the same issue.
cargo test --test testsuite -- no_duplicate_package_warning_with_dotdot_cargo_home config_symlink_home_duplicate_load install_git_with_symlink_home

@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 Jul 15, 2026
@rustbot

rustbot commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

r? @weihanglo

rustbot has assigned @weihanglo.
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: @epage, @weihanglo
  • @epage, @weihanglo expanded to epage, weihanglo
  • Random selection from epage, weihanglo

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks better!

@epage, looks good to you?

View changes since this review

@epage

epage commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

In #17204 (comment), I said about this route:

Granted, with that last one, the fact that it doesn't seem to already be done has me wondering if there is a reason.

No idea how we decide at this point, so might as well go for it

@weihanglo

Copy link
Copy Markdown
Member

In #17204 (comment), I said about this route:

Granted, with that last one, the fact that it doesn't seem to already be done has me wondering if there is a reason.

No idea how we decide at this point, so might as well go for it

Yeah I cannot think of a reason we want to preserve non-normalized path for CARGO_HOME except the UNC issue, which we already avoided that.

@weihanglo
weihanglo added this pull request to the merge queue Jul 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Jul 17, 2026
@rustbot

This comment has been minimized.

@hirehamir
hirehamir force-pushed the refactor/normalize-in-homedir branch from 7020318 to 5c483d3 Compare July 17, 2026 18:26
@rustbot

This comment has been minimized.

@rustbot

This comment has been minimized.

@weihanglo

Copy link
Copy Markdown
Member

I am sorry @hirehamir 😞. It needs another rebase

@hirehamir

Copy link
Copy Markdown
Contributor Author

No worries @weihanglo. I'll see if I can resolve them now.

@hirehamir
hirehamir force-pushed the refactor/normalize-in-homedir branch from 5c483d3 to b59de02 Compare July 17, 2026 21:09
@rustbot

rustbot commented Jul 17, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different master commit. Here's a range-diff highlighting what actually changed.

Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers.

@weihanglo weihanglo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weihanglo
weihanglo enabled auto-merge July 17, 2026 21:30
@weihanglo
weihanglo added this pull request to the merge queue Jul 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to no response for status checks Jul 17, 2026
@weihanglo
weihanglo added this pull request to the merge queue Jul 17, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Jul 17, 2026
@weihanglo
weihanglo added this pull request to the merge queue Jul 17, 2026
Merged via the queue into rust-lang:master with commit 3efb1f4 Jul 18, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 18, 2026
@hirehamir
hirehamir deleted the refactor/normalize-in-homedir branch July 18, 2026 00:49
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
rust-bors Bot pushed a commit to rust-lang/rust that referenced this pull request Jul 18, 2026
Update cargo submodule

29 commits in 59800466c5c41c444d264b1010b4d57e85a7117f..3efb1f477e99b42974b982d939fd100303cdf7db
2026-07-07 15:52:22 +0000 to 2026-07-17 23:53:19 +0000
- refactor(context): normalize in `homedir` instead (rust-lang/cargo#17222)
- chore(ci): reflect doc folder move in book deployment (rust-lang/cargo#17235)
- refactor(ops): Have cargo-metadata's ops match the command name (rust-lang/cargo#17233)
- chore: Flatten src (rust-lang/cargo#17231)
- chore: Flatten `src` (rust-lang/cargo#17230)
- chore(ci): remove stale libsecret packages (rust-lang/cargo#17229)
- perf: Lazily initialize git2 fetch transports  (rust-lang/cargo#17226)
- test(trim-paths): re-enable lldb debugger tests  (rust-lang/cargo#17223)
- Include SBOM outputs in fingerprints (rust-lang/cargo#17216)
- Update cfg_aliases to 0.2.2 (rust-lang/cargo#17225)
- test(trim-paths): exercise GDB on windows-gnu (rust-lang/cargo#17221)
- feat(profile): Disable incremental compilation under CI by default (rust-lang/cargo#17220)
- Remove myself from review rotation (rust-lang/cargo#17219)
- Fix typo in comment in sync (rust-lang/cargo#17217)
- docs(ref): Improve handing of built-in profiles (rust-lang/cargo#17213)
- fix: dont apply host-config gating to stable behavior (rust-lang/cargo#17198)
- chore(deps): update msrv (rust-lang/cargo#17192)
- test: fix race in cargo_compile_with_invalid_code_in_deps (rust-lang/cargo#17203)
- Rename `-Zno-embed-metadata` to `-Zembed-metadata=no` (rust-lang/cargo#17149)
- fix(source): incorrect duplicate package warning (rust-lang/cargo#17204)
- Fix manifest schema generation: `TomlDebugInfo` enum-variants doesn't renamed (rust-lang/cargo#17202)
- Reduce library search path length in new build dir layout (rust-lang/cargo#17191)
- fix(install): Move --debug to Compilation options (rust-lang/cargo#17199)
- chore(ci): dogfood `build.warnings` (rust-lang/cargo#17195)
- docs(lints): Better match clippy in lint section titles (rust-lang/cargo#17190)
- chore: bump to 0.100.0; update changelog (rust-lang/cargo#17189)
- docs(ref): Clarify MSRV for lints (rust-lang/cargo#17184)
- docs(report): add missing entry for `cargo report future-incompatibilities` (rust-lang/cargo#17188)
- Reduce rustc `-L` args used in the new `build-dir` layout (rust-lang/cargo#17168)
@rustbot rustbot added this to the 1.99.0 milestone Jul 18, 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