mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/go: use -importcfg to invoke compiler, linker
This is a step toward using cached build artifacts: the importcfg will direct the compiler and linker to read them right from the cache if necessary. However, this CL does not have a cache yet, so it still reads them from the usual install location or build location. Even so, this fixes a long-standing issue that -I and -L (no longer used) are not expressive enough to describe complex GOPATH setups. Shared libraries are handled enough that all.bash passes, but there may still be more work to do here. If so, tests and fixes can be added in follow-up CLs. Gccgo will need updating to support -importcfg as well. Fixes #14271. Change-Id: I5c52a0a5df0ffbf7436e1130c74e9e24fceff80f Reviewed-on: https://go-review.googlesource.com/56279 Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
a2993456bb
commit
0be2d52eba
7 changed files with 220 additions and 155 deletions
|
|
@ -47,7 +47,7 @@ func run(t *testing.T, msg string, args ...string) {
|
|||
func goCmd(t *testing.T, args ...string) {
|
||||
newargs := []string{args[0], "-installsuffix=" + suffix}
|
||||
if testing.Verbose() {
|
||||
newargs = append(newargs, "-v")
|
||||
newargs = append(newargs, "-x")
|
||||
}
|
||||
newargs = append(newargs, args[1:]...)
|
||||
c := exec.Command("go", newargs...)
|
||||
|
|
@ -58,6 +58,7 @@ func goCmd(t *testing.T, args ...string) {
|
|||
c.Stdout = os.Stdout
|
||||
c.Stderr = os.Stderr
|
||||
err = c.Run()
|
||||
output = []byte("(output above)")
|
||||
} else {
|
||||
output, err = c.CombinedOutput()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue