Skip to content

Fix symlink_and_directory when running in a long target dir name#16775

Merged
epage merged 1 commit intorust-lang:masterfrom
ehuss:fix-symlink_and_directory-long-path
Mar 21, 2026
Merged

Fix symlink_and_directory when running in a long target dir name#16775
epage merged 1 commit intorust-lang:masterfrom
ehuss:fix-symlink_and_directory-long-path

Conversation

@ehuss
Copy link
Contributor

@ehuss ehuss commented Mar 21, 2026

This fixes the symlink_and_directory test which is failing on rust-lang/rust because it runs in a longer target directory name. This causes the path to exceed the limit of 100 characters for a USTAR tar header.

The fix is to just use a directory from the tempfile crate instead of trying to create one inside the test sandbox. I believe this should be reliably under 100 characters.

Unfortunately we cannot switch to GNU tar headers which dynamically switch to using GNU extensions for long paths because it would cause the package checksums to change based on whether or not the path causes it to exceed the limit.

I double checked the old tar 0.4.44, and the test fails as expected.

This fixes the `symlink_and_directory` test which is failing on rust-lang/rust because it runs in a longer target directory name. This causes the path to exceed the limit of 100 characters for a USTAR tar header. The fix is to just use a directory from the `tempfile` crate instead of trying to create one inside the test sandbox. I believe this should be reliably under 100 characters. Unfortunately we cannot switch to GNU tar headers which dynamically switch to using GNU extensions for long paths because it would cause the package checksums to change based on whether or not the path causes it to exceed the limit. I double checked the old tar 0.4.44, and the test fails as expected.
@rustbot rustbot added A-testing-cargo-itself Area: cargo's tests S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Mar 21, 2026
@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2026

r? @epage

rustbot has assigned @epage.
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 epage, weihanglo
@epage epage enabled auto-merge March 21, 2026 01:03
@epage epage added this pull request to the merge queue Mar 21, 2026
Merged via the queue into rust-lang:master with commit e84cb63 Mar 21, 2026
29 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 21, 2026
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Mar 21, 2026
Update cargo submodule 14 commits in cbb9bb8bd0fb272b1be0d63a010701ecb3d1d6d3..e84cb639edfea2c42efd563b72a9be0cc5de6523 2026-03-13 14:34:16 +0000 to 2026-03-21 01:27:07 +0000 - Fix symlink_and_directory when running in a long target dir name (rust-lang/cargo#16775) - cargo clean: Validate that target_dir is not a file (rust-lang/cargo#16765) - fix: fetching non-standard git refspecs on non-github repos (rust-lang/cargo#16768) - Update tar to 0.4.45 (rust-lang/cargo#16771) - chore: Remove edition_lint_opts from Lint (rust-lang/cargo#16762) - refactor: split out several smaller changes to prepare for async http (rust-lang/cargo#16763) - fix(compile): Make build.warnings ignore non-local deps (rust-lang/cargo#16760) - fix: detect circular publish dependency cycle in workspace publish (rust-lang/cargo#16722) - refactor(shell): Pull out term integration into `anstyle-progress` (rust-lang/cargo#16757) - test: reproduce rustfix panic on overlapping suggestions (rust-lang/cargo#16705) - fix: Avoid panic for package specs with an empty fragment (rust-lang/cargo#16754) - refactor(registry): avoid dynamic dispatch for Registry trait (rust-lang/cargo#16752) - refactor(shell): Pull out hyperlink logic into anstyle-hyperlink (rust-lang/cargo#16749) - refactor(install): Remove dead code (rust-lang/cargo#16718)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-testing-cargo-itself Area: cargo's tests

4 participants