cmd/internal/moddeps: TestAllDependencies may report a false positive when $TMPDIR is a symbolic link #44080
Labels
FrozenDueToAge
NeedsFix
The path to resolution is known, but the work has not been done.
Testing
An issue that has been verified to require only test changes, not just a test failure.
Milestone
TestAllDependencies
usest.TempDir
to get a temporary directory where the Go tree being tested can be safely copied.t.TempDir
usesos.TempDir
. If the system temporary directory path involves symlinks, this can cause the test to report a false positive.This is because one of the checks
TestAllDependencies
performs (when run without -short flag) is thatgo generate syscall internal/syscall/...
in a copy of the GOROOT directory produces a zero diff. Generating the syscall packages results in the execution ofgolang.org/x/sys/windows/mkwinsyscall
.mkwinsyscall
has some logic to determine whether it's being called on a file inside the standard library, but that logic may report incorrect results when the standard library is inside a symlinked directory (this is issue #44079).In practice, on macOS, the default value of
$TMPDIR
is a symlink:This issue is to investigate if anything can be done to improve this. If it's possible to at least detect this situation, then we can skip the test. Or maybe it's not feasible to do anything, then we can apply the label Unfortunate and close this.
CC @bcmills, @ianlancetaylor.
The text was updated successfully, but these errors were encountered: