Skip to content

Commit e602ba3

Browse files
committed
Use directory symlink instead of junction for Dev Drive
`bundle.TestRootLookup` (unit test) called `filepath.EvalSymlinks` on its `t.TempDir()` path, which landed under the `C:\a\_fast` directory junction. Go's stdlib EvalSymlinks on Windows returns "cannot find the path specified" for `IO_REPARSE_TAG_MOUNT_POINT` (junctions) rooted at a newly mounted ReFS VHDX, but handles `IO_REPARSE_TAG_SYMLINK` (directory symlinks) correctly. Switching `New-Item -ItemType Junction` to `cmd /c mklink /D` (directory symbolic link) to dodge the quirk. Symlinks require Developer Mode, which is the default on GitHub-hosted Windows runners. Co-authored-by: Isaac
1 parent 2caaa88 commit e602ba3

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

.github/actions/setup-build-environment/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,12 @@ runs:
4747
}
4848
4949
New-Item -ItemType Directory -Path Z:\fast | Out-Null
50-
New-Item -ItemType Junction -Path C:\a\_fast -Target Z:\fast | Out-Null
50+
# Use a directory symbolic link (not a junction). Go's
51+
# `filepath.EvalSymlinks` handles dir symlinks correctly but returns
52+
# "cannot find the path specified" on junctions rooted at a newly
53+
# mounted VHDX (hits `bundle.TestRootLookup` in the unit test suite).
54+
# Requires Developer Mode, which is enabled on GH Windows runners.
55+
cmd /c "mklink /D C:\a\_fast Z:\fast" | Out-Null
5156
New-Item -ItemType Directory -Path `
5257
C:\a\_fast\tmp, C:\a\_fast\go-build, C:\a\_fast\go-mod, C:\a\_fast\go-tmp | Out-Null
5358

0 commit comments

Comments
 (0)