go/go/internal
Matthew Dempsky 72e4d1bb8d go/internal/cgo: handle symlinks with $PWD, not -srcdir
In CL 293250, I changed x/tools/go/loader to invoke cgo using the
-srcdir option, rather than chdir'ing into the source directory. But
evidently cgo's -srcdir option does not affect #include processing of
relative file paths, so this ended up breaking packages that relied on
the latter.

This CL reverts back to chdir'ing into the source directory, but also
sets the PWD environment variable. This appears to be how cmd/go
invokes tools and handles symlinks.

Fixes golang/go#46877.

Change-Id: Ia538c5d8722b151a4547f73188f6537e0551136f
Reviewed-on: https://go-review.googlesource.com/c/tools/+/331409
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
gopls-CI: kokoro <noreply+kokoro@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
2021-06-29 19:12:30 +00:00
..
cgo go/internal/cgo: handle symlinks with $PWD, not -srcdir 2021-06-29 19:12:30 +00:00
gccgoimporter all: go fmt ./... 2021-02-20 03:28:52 +00:00
gcimporter go/internal/gcimporter: cleanup testenv functions 2021-05-25 04:04:01 +00:00
packagesdriver all: recognize new error from go command when no go.mod is found 2021-03-04 22:10:16 +00:00