bootstrap: create directory junction target if it does not exist #109574
+5
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#104854 added the creation of a
build/host
symlink that points to thebuild/<host_triple>
directory. However, the target directory might not exist, which causes a panic on Windows.The directory is normally created when downloading the bootstrap tools, but if the user manually configures
build.rustc
andbuild.cargo
on a clean Windows environment then the build will fail with the panicsymlink_dir(..) failed with ..
because the target directory hasn't been created yet.This fixes the issue by creating the directory junction target if it does not exist. It's not an issue on non-Windows platforms, because they use symlinks instead of junctions which are allowed to point to non-existent entities (and it will be created later).
r? @wesleywiser