]> Cypherpunks.ru repositories - gostls13.git/commit
misc/cgo/testshared: run tests only in GOPATH mode
authorBryan C. Mills <bcmills@google.com>
Tue, 12 Jul 2022 18:41:33 +0000 (14:41 -0400)
committerGopher Robot <gobot@golang.org>
Wed, 13 Jul 2022 20:43:22 +0000 (20:43 +0000)
commitf71f3d1b861de2fcc907221931cf13679c0092dd
treef735e09f237ff275afdef5b3363b86baf1d1d405
parentfeada5366134772c4c6462e4a12150410741a00f
misc/cgo/testshared: run tests only in GOPATH mode

-buildmode=shared installs shared libraries into GOROOT
and expects to reuse them across builds.
Builds in module mode, however, each have their own set of
dependencies (determined by the module's requirements), so in general
cannot share dependencies with a single GOROOT.

Ideally in the long term we would like to eliminate -buildmode=shared
entirely (see #47788), but first we need a replacement for the subset
of use-cases where it still works today.

In the meantime, we should run these tests only in GOPATH mode.
Non-main packages in module mode should not be installed to
GOPATH/pkg, but due to #37015 they were installed there anyway,
and this test heavily relies on installing non-main packages.

For #37015.

Change-Id: I7c5d90b4075d6f33e3505d6a8f12752309ae5c03
Reviewed-on: https://go-review.googlesource.com/c/go/+/417194
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>
misc/cgo/testshared/shared_test.go