Skip to content

Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal - #152433

Open
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:bootstrap-symlink
Open

Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal#152433
Zoxc wants to merge 1 commit into
rust-lang:mainfrom
Zoxc:bootstrap-symlink

Conversation

@Zoxc

@Zoxc Zoxc commented Feb 10, 2026

Copy link
Copy Markdown
Contributor

View all comments

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in symlink_file when operating on a directory.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) labels Feb 10, 2026
@rustbot

rustbot commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

r? @Mark-Simulacrum

rustbot has assigned @Mark-Simulacrum.
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: bootstrap
  • bootstrap expanded to 6 candidates
  • Random selection from Mark-Simulacrum, Zalathar, clubby789, jieyouxu

@rust-log-analyzer

This comment has been minimized.

@ChrisDenton

Copy link
Copy Markdown
Member

Junction points only work on directories, not files. A hard link or a file copy would be necessary if symlinks aren't available.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 31820df to 6e0c9f5 Compare February 10, 2026 12:02
@Zoxc

Zoxc commented Feb 11, 2026

Copy link
Copy Markdown
Contributor Author

Well this seems to only be called to create junctions to directories (on Windows), otherwise I'd be seeing more privilege errors.

@ChrisDenton

Copy link
Copy Markdown
Member

So it sounds like symlink_dir should be being called and it's a bug that symlink_file is.

@Mark-Simulacrum

Copy link
Copy Markdown
Member

@rustbot author

I don't have much context on the details here (especially Windows) but generally speaking it seems plausible that this is a bug in the callsite?

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 14, 2026
@rustbot

rustbot commented Feb 14, 2026

Copy link
Copy Markdown
Collaborator

Reminder, once the PR becomes ready for a review, use @rustbot ready.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 6e0c9f5 to 4ce1afa Compare February 22, 2026 16:01
@rustbot

This comment has been minimized.

@Zoxc Zoxc changed the title Create junctions instead of trying to use symbolic links in symlink_file on Windows Use symlink_dir to create junctions on Windows instead of trying to use symbolic links in copy_link_internal Feb 22, 2026
@rust-bors

This comment has been minimized.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from 4ce1afa to bbd34d2 Compare August 21, 2026 14:29
@rustbot

rustbot commented Aug 21, 2026

Copy link
Copy Markdown
Collaborator

This PR was rebased onto a different main 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.

@Zoxc

Zoxc commented Aug 21, 2026

Copy link
Copy Markdown
Contributor Author

@rustbot ready

I have moved the logic to the callsite.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 21, 2026
@ChrisDenton

Copy link
Copy Markdown
Member

I should be able to look at this later today

r? ChrisDenton

@ChrisDenton

Copy link
Copy Markdown
Member

lgtm

@bors r+ rollup

@rust-bors

rust-bors Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

📌 Commit bbd34d2 has been approved by ChrisDenton

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 21, 2026
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 22, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`


try-job: x86_64-gnu-distcheck
@JonathanBrouwer

Copy link
Copy Markdown
Member

💔 I suspect this PR failed tests as part of a rollup
@bors r-

After fixing the problem, consider running a try job for the failed job before re-approving.

Link to failure: #161494 (comment)

@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Aug 22, 2026
@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved.

This PR was contained in a rollup (#161501), which was unapproved.

View changes since this unapproval

@rust-bors

rust-bors Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 35a958f failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from bbd34d2 to cda45e5 Compare August 23, 2026 17:18
@Zoxc

Zoxc commented Aug 23, 2026

Copy link
Copy Markdown
Contributor Author

I changed this to use is_symlink_dir on Windows, as that doesn't require us to look up the target. CI failed as the previous code tried to follow link not using the file as the absolute base.

@rust-log-analyzer

This comment has been minimized.

… use symbolic links in `copy_link_internal`
@Zoxc
Zoxc force-pushed the bootstrap-symlink branch from cda45e5 to 9c78500 Compare August 23, 2026 17:39
@JonathanBrouwer

Copy link
Copy Markdown
Member

@bors try jobs=x86_64-gnu-distcheck

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Aug 23, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`


try-job: x86_64-gnu-distcheck
@rust-bors

rust-bors Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 4c92e91 (4c92e91dc6006e06b90a88520c88bf9d9bfef997)
Base parent: 9a4ad59 (9a4ad59ae3073b013cd62f53f8349ddc61a012e8)

@ChrisDenton

Copy link
Copy Markdown
Member

@bors r+

@rust-bors

rust-bors Bot commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

📌 Commit 9c78500 has been approved by ChrisDenton

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 24, 2026
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 24, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Rollup of 24 pull requests

Successful merges:

 - #161586 (miri subtree update)
 - #161187 (add `Complex<T>` layout tests for straightforward targets)
 - #161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - #161592 (core: refactor tests/pattern.rs tests)
 - #161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #155254 (Recover on attribute in use tree)
 - #158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - #159456 (Fix the reporting of layout normalization failures in transmute checks)
 - #159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - #160452 (-Ctarget-feature is not unsafe (any more))
 - #161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - #161166 (add crashtests [5/N], remove unused aux files )
 - #161294 (add crashtests [6/N])
 - #161552 (also trigger overflow FCW when going from overflow -> error)
 - #161569 (Bump cfg_aliases to 0.2.2)
 - #161573 (re-bless `pretty-std` on windows)
 - #161580 (Add codegen test for redundant bit mask after a range check)
 - #161588 (update eyre)
 - #161589 (std: reduce visibility of some internal OsStr related types)
 - #161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - #161601 (Path: use optimized is_empty() method)
 - #161604 (coretests: Add a few tests for backward multibyte predicate)
 - #161615 (interpret: make validate_c_variadic_compatible_ty public)
Zalathar added a commit to Zalathar/rust that referenced this pull request Aug 24, 2026
Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`

Symbolic links require extra privileges on Windows, so this falls back to creating junctions in `symlink_file` when operating on a directory.
rust-bors Bot pushed a commit that referenced this pull request Aug 24, 2026
Rollup of 22 pull requests

Successful merges:

 - #161586 (miri subtree update)
 - #161187 (add `Complex<T>` layout tests for straightforward targets)
 - #161524 (Put back `tests/rustdoc-gui/search-result-display.goml`)
 - #161592 (core: refactor tests/pattern.rs tests)
 - #161602 (Fix flakyness issue for `tests/rustdoc-gui/headers-color.goml`)
 - #152433 (Use `symlink_dir` to create junctions on Windows instead of trying to use symbolic links in `copy_link_internal`)
 - #155254 (Recover on attribute in use tree)
 - #158695 (Replace `CrateDump` with the Debug impl from `CStore`)
 - #159456 (Fix the reporting of layout normalization failures in transmute checks)
 - #159940 (Eliminate some buggy `unreachable!()`s in `expand_[option_]env()`)
 - #160452 (-Ctarget-feature is not unsafe (any more))
 - #161007 (tests/ui/union/union-nodrop.rs: fix typo "expressios")
 - #161552 (also trigger overflow FCW when going from overflow -> error)
 - #161569 (Bump cfg_aliases to 0.2.2)
 - #161573 (re-bless `pretty-std` on windows)
 - #161580 (Add codegen test for redundant bit mask after a range check)
 - #161588 (update eyre)
 - #161589 (std: reduce visibility of some internal OsStr related types)
 - #161598 ([Bootstrap] Pass exact CI `llvm-config` executable path)
 - #161601 (Path: use optimized is_empty() method)
 - #161604 (coretests: Add a few tests for backward multibyte predicate)
 - #161615 (interpret: make validate_c_variadic_compatible_ty public)
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. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants