]> Cypherpunks repositories - gostls13.git/commit
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)
committerJay Conrod <jayconrod@google.com>
Fri, 13 Sep 2019 16:25:00 +0000 (16:25 +0000)
commit24781a1faf62ac5c9a553af6f46b787e972f5539
treecfa92ed5a0c0ac77d05514d7898f572c04da9a8b
parent79877e5f91fb77362235d9160ddbeada5878a9c5
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 #34114

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>
src/cmd/go/internal/load/test.go
src/cmd/go/testdata/script/cover_pkgall_multiple_mains.txt