]> Cypherpunks repositories - gostls13.git/commit
cmd/go: add basic support for overlays
authorMichael Matloob <matloob@golang.org>
Tue, 11 Aug 2020 16:57:01 +0000 (12:57 -0400)
committerMichael Matloob <matloob@golang.org>
Tue, 6 Oct 2020 19:00:07 +0000 (19:00 +0000)
commitab2a5b48665eed6d670d719cdef5335bc3602359
tree8a897d0a57a5ff5b12e4cb52e3be610c9eb1e93e
parentf8d80977b784fd4879963e61dc9fca1fc9bf2193
cmd/go: add basic support for overlays

This CL adds basic support for listing packages with overlays.
The new cmd/go/internal/fs package adds an abstraction for communicating
with the file system that will open files according to their overlaid paths,
and provides functions to override those in the build context to open
overlaid files. There is also some support for executing builds on packages
with overlays. In cmd/go/internal/work.(*Builder).build, paths are mapped
to their overlaid paths before they are given as arguments to tools.

For #39958

Change-Id: I5ec0eb9ebbca303e2f1e7dbe22ec32613bc1fd17
Reviewed-on: https://go-review.googlesource.com/c/go/+/253747
Trust: Michael Matloob <matloob@golang.org>
Trust: Jay Conrod <jayconrod@google.com>
Run-TryBot: Michael Matloob <matloob@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
13 files changed:
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/envcmd/env.go
src/cmd/go/internal/fsys/fsys.go [new file with mode: 0644]
src/cmd/go/internal/fsys/fsys_test.go [new file with mode: 0644]
src/cmd/go/internal/imports/scan.go
src/cmd/go/internal/modload/import.go
src/cmd/go/internal/modload/init.go
src/cmd/go/internal/search/search.go
src/cmd/go/internal/work/build.go
src/cmd/go/internal/work/gc.go
src/cmd/go/internal/work/init.go
src/cmd/go/testdata/script/build_overlay.txt [new file with mode: 0644]
src/cmd/go/testdata/script/list_overlay.txt [new file with mode: 0644]