You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GOPACKAGESDRIVER commands absolutize filenames
relative to their current working directory. However,
os.Getwd may inadvertently expand out any symbolic
links in the path, causing files to have the "wrong"
path, and breaking various name-based equivalence tests
that are common in the go/packages domain.
This CL exploits the same trick used in gocommand to
prevent os.Getwd from expanding symbolic links:
if Stat(Getenv(PWD) returns the process's working
directory, then the iterated ".." search (which
inadvertently expands symlinks) is avoided.
It is unfortunate that driver writers must think about
this. Mostly it only shows up in tests, as that's
where the subprocess directory varies from the parent
directory.
Also, add -driver flag to gopackages debug helper,
which causes it to use drivertest instead of go list
directly.
Change-Id: Ibe12531fe565e74ca1d2565805b0f2458803f6b4
Reviewed-on: https://go-review.googlesource.com/c/tools/+/588767
LUCI-TryBot-Result: Go LUCI <[email protected]>
Reviewed-by: Robert Findley <[email protected]>
0 commit comments