Skip to content

Added symlink resolution for workspace-path-hash#15400

Merged
weihanglo merged 2 commits into
rust-lang:masterfrom
ranger-ross:build-dir-symlink-handling
Apr 8, 2025
Merged

Added symlink resolution for workspace-path-hash#15400
weihanglo merged 2 commits into
rust-lang:masterfrom
ranger-ross:build-dir-symlink-handling

Conversation

@ranger-ross

Copy link
Copy Markdown
Member

What does this PR try to resolve?

This PR adds logic to resolve symlinks before hashing the workspace-path-hash template variable for build.build-dir.
See #14125 (comment)

cc: #14125

Note: The behavior on unix systems is unchanged, as the manifest_path was already canonicalized (at least on my system and in CI). However, the Windows behavior did not do this previous.

How should we test and review this PR?

I added a test which runs cargo build twice, once from the real directory and once from inside of a symlinked directory, then verifies that hashes match.

The change is only a few lines. Most of the diffs are testing code

r? @epage

@rustbot rustbot added A-configuration Area: cargo config files and env vars A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2025

@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.

Thanks. Just some nits not really directly related to the change itself.

Comment thread crates/cargo-test-support/src/lib.rs Outdated
Comment thread tests/testsuite/build_dir.rs Outdated
Comment thread tests/testsuite/build_dir.rs Outdated
Comment thread tests/testsuite/build_dir.rs Outdated
@ranger-ross ranger-ross force-pushed the build-dir-symlink-handling branch from 30552d8 to 5053393 Compare April 8, 2025 13:48

@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.

Thanks for working on this!

@weihanglo weihanglo added this pull request to the merge queue Apr 8, 2025
Merged via the queue into rust-lang:master with commit 7ade57b Apr 8, 2025
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 12, 2025
Update cargo

12 commits in 0e93c5bf6a1d5ee7bc2af63d1afb16cd28793601..864f74d4eadcaea3eeda37a2e7f4d34de233d51e
2025-04-05 00:00:24 +0000 to 2025-04-11 20:37:27 +0000
- chore: Bump build-rs version (rust-lang/cargo#15421)
- fix(build): Correct name of CARGO_CFG_FEATURE (rust-lang/cargo#15420)
- Revert "fix(package): detect dirtiness for symlinks to submodule" (rust-lang/cargo#15419)
- Improved error message when build-dir template var is invalid (rust-lang/cargo#15418)
- Added validation for unmatched brackets in build-dir template (rust-lang/cargo#15414)
- fix(package): detect dirtiness for symlinks to submodule  (rust-lang/cargo#15416)
- chore(deps): bump crossbeam-channel from 0.5.14 to 0.5.15 (rust-lang/cargo#15415)
- docs(metadata): Added build_directory to cargo metadata documentation (rust-lang/cargo#15410)
- Added symlink resolution for `workspace-path-hash` (rust-lang/cargo#15400)
- feat: print target and package names formatted as file hyperlinks (rust-lang/cargo#15405)
- docs(ref): Use better example value in `CARGO_CFG_TARGET_ABI` (rust-lang/cargo#15404)
- chore: Bump cargo-util-schemas to 0.8.2 (rust-lang/cargo#15403)

r? ghost
@rustbot rustbot added this to the 1.88.0 milestone Apr 12, 2025
@ranger-ross ranger-ross deleted the build-dir-symlink-handling branch April 29, 2025 15:57
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 A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants