Use the new txtar.FS function to consolidate API around fs.FS.
This has been simplified to two functions: ExtractTxtarFileToTmp,
and CopyToTmp. CopyToTmp is a combination replacement for CopyFS and
CopyDirToTmp. The main distinction is that it now takes an explicit
renaming map instead of implicitly removing ".test" extensions.
Updates golang/go#68408
Change-Id: I9558044ec4613835327c0b0a5e8d1cc8fe847d59
Reviewed-on: https://go-review.googlesource.com/c/tools/+/598996
Reviewed-by: Alan Donovan <adonovan@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Tim King <taking@google.com>
Add skips as appropriate to TestFreeRefs and TestDriverConformance.
Also add a skip for a preexisting failure on wasip1: golang/go#64725.
Fixesgolang/go#68163
Updates golang/go#64725
Change-Id: I2827160bad6627755f213e4b8b54d53333d2d98d
Reviewed-on: https://go-review.googlesource.com/c/tools/+/594895
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
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 <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Robert Findley <rfindley@google.com>
Fixes a test failure following the submission of CL 589135.
Change-Id: I746d06d6a661552de472c21e7010d5b07ad261d3
Reviewed-on: https://go-review.googlesource.com/c/tools/+/589059
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Auto-Submit: Robert Findley <rfindley@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Add a new drivertest package that implements a fake go/packages driver,
which simply wraps a call to a (non-driver) go/packages.Load. This will
be used for writing gopls tests in GOPACKAGESDRIVER mode.
The test for this new package turned up an asymmetric in Package JSON
serialization: the IgnoredFiles field was not being set while
unmarshalling. As you might imagine, this was initially very confusing.
Fixesgolang/go#67615
Change-Id: Ia400650947ade5984fa342cdafccfd4e80e9a4dd
Reviewed-on: https://go-review.googlesource.com/c/tools/+/589135
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Commit-Queue: Alan Donovan <adonovan@google.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
Auto-Submit: Alan Donovan <adonovan@google.com>