Darwin convertes the working directory to a real path which affects the path a command is started with when you exec. This causes a problem where the path the go list command is run with does not match the path the outside program is trying to use, which causes both undesirably changed paths in it's outputs, and sometimes failures to cope with modules when source files are "outside" the module root. The go standard library has a special feature in os.Getwd where it checks if the PWD environment variable is the same inode as the system cwd, and if it is it returns the PWD instead. This change deliberately sets the PWD before running go list so that behaviour is triggered, which fixes all the paths. This was breaking the mac build bots in a goimports test, it should be fixed now. Change-Id: I0f5d3c7d020b55749738036ba51c19884bb26598 Reviewed-on: https://go-review.googlesource.com/c/143517 Run-TryBot: Ian Cottrell <iancottrell@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com> |
||
|---|---|---|
| .. | ||
| gopackages | ||
| packagestest | ||
| testdata | ||
| doc.go | ||
| example_test.go | ||
| external.go | ||
| golist.go | ||
| golist_fallback.go | ||
| golist_fallback_testmain.go | ||
| packages.go | ||
| packages110_test.go | ||
| packages_test.go | ||
| packagescgo_test.go | ||
| stdlib_test.go | ||
| visit.go | ||