]> Cypherpunks.ru repositories - gostls13.git/commit
misc/cgo/test: add cgo build constraints
authorAustin Clements <austin@google.com>
Sat, 6 May 2023 02:29:11 +0000 (22:29 -0400)
committerAustin Clements <austin@google.com>
Fri, 12 May 2023 12:00:00 +0000 (12:00 +0000)
commitaf64b75b67f15154ed13279212d40474cf061fff
tree7cd4a342024109f5bd61740569cd985177cfbb60
parenta76b073712343328a6da1daa597ddfe68d543f32
misc/cgo/test: add cgo build constraints

We're about to move this package to cmd/cgo/internal, where it will
get caught up in the "CGO_ENABLED=0 go install cmd" done by make.bash.
Currently, building this package with CGO_ENABLED=0 fails because it
contains several source files that don't themselves import "C", but do
import a subdirectory where that package imports "C" and thus has no
exported API.

Fix the CGO_ENABLED=0 build of this package by adding the necessary
cgo build tags. Not all source files need it, but this CL makes
"CGO_ENABLED=0 go test -c" work in this package.

For #37486.

Change-Id: Id137cdfbdd950eea802413536d990ab642ebcd7e
Reviewed-on: https://go-review.googlesource.com/c/go/+/493215
Reviewed-by: Bryan Mills <bcmills@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Austin Clements <austin@google.com>
20 files changed:
misc/cgo/test/cgo_linux_test.go
misc/cgo/test/cgo_test.go
misc/cgo/test/cgo_unix_test.go
misc/cgo/test/gcc68255.go
misc/cgo/test/issue18146.go
misc/cgo/test/issue23555.go
misc/cgo/test/issue24161_darwin_test.go
misc/cgo/test/issue26430.go
misc/cgo/test/issue26743.go
misc/cgo/test/issue27340.go
misc/cgo/test/issue29563.go
misc/cgo/test/issue30527.go
misc/cgo/test/issue43639.go
misc/cgo/test/issue52611.go
misc/cgo/test/issue8828.go
misc/cgo/test/issue9026.go
misc/cgo/test/issue9400/stubs.go
misc/cgo/test/issue9510.go
misc/cgo/test/test26213.go
misc/cgo/test/test_unix.go