]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.13] cmd/go: fix link error for -coverpkg in GOPATH mode
authorJay Conrod <jayconrod@google.com>
Fri, 13 Sep 2019 15:10:36 +0000 (11:10 -0400)
committerBryan C. Mills <bcmills@google.com>
Wed, 25 Sep 2019 14:29:09 +0000 (14:29 +0000)
commit613adc62688a609e4c113a768fc49ab979812b68
tree4672933e62a6c2bb2a154fbd56e44957953fd011
parent1dc1e7c346658717a03c09f3b5f35b91c0c0c6a6
[release-branch.go1.13] cmd/go: fix link error for -coverpkg in GOPATH mode

If a generated test main package transitively depends on a main
package, the main package will now always be rebuilt as a library and
will not be compiled with '-p main'.

This expands the fix for #30907, which only applied to packages with
the BuildInfo set (main packages built in module mode). Linking
multiple packages with BuildInfo caused link errors, but it appears
these errors apply to some symbols in GOPATH mode.

Fixes #34223

Change-Id: Ic1e53437942269a950dd7e45d163707922c92edd
Reviewed-on: https://go-review.googlesource.com/c/go/+/195279
Run-TryBot: Jay Conrod <jayconrod@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
(cherry picked from commit 24781a1faf62ac5c9a553af6f46b787e972f5539)
Reviewed-on: https://go-review.googlesource.com/c/go/+/195281
src/cmd/go/internal/load/test.go
src/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt