]> Cypherpunks repositories - gostls13.git/commit
internal/testenv: use 'go env CGO_ENABLED' instead of a build constraint
authorBryan C. Mills <bcmills@google.com>
Tue, 28 Feb 2023 19:16:54 +0000 (19:16 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 1 Mar 2023 17:28:28 +0000 (17:28 +0000)
commita5f3cb6f75f31ea7336ce87375cbc30c73360def
tree72e06af10b30e52e28093d4d7221e8b65935ab39
parentea75b9458fed588e84abeacfc9319abb2a51ce0c
internal/testenv: use 'go env CGO_ENABLED' instead of a build constraint

A build constraint reports whether the test binary was compiled with
cgo enabled, but that doesn't necessarily imply that cgo can be used
in the environment in which the test binary is run.

In particular, cross-compiled builders (such as Android) may compile
the test binaries on the host with CGO enabled but not provide a C
toolchain on the device that runs the test.

For #58775.

Change-Id: Ibf2f44c9e956cd3fa898c3de67af4449e8ef2dd1
Reviewed-on: https://go-review.googlesource.com/c/go/+/472215
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Bryan Mills <bcmills@google.com>
Auto-Submit: Bryan Mills <bcmills@google.com>
src/internal/testenv/testenv.go
src/internal/testenv/testenv_cgo.go [deleted file]