1 # Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183:
2 # A mismatched $GOROOT_FINAL or missing $CC caused the C dependencies of the net
3 # package to appear stale, and it could not be rebuilt due to a missing $CC.
4
5 [!cgo] skip
6
7 # This test may start with the runtime/cgo package already stale.
8 # Explicitly rebuild it to ensure that it is cached.
9 # (See https://go.dev/issue/50892.)
10 #
11 # If running in non-short mode, explicitly vary CGO_CFLAGS
12 # as a control case (to ensure that our regexps do catch rebuilds).
13
14 [!short] env GOCACHE=$WORK/cache
15 [!short] env CGO_CFLAGS=-DTestScript_cgo_stale_precompiled=true
16 go build -x runtime/cgo
17 [!short] stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
18
19 # https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net to be stale.
20 [!plan9] env PATH='' # Guaranteed not to include $(go env CC)!
21 [plan9] env path=''
22 go build -x runtime/cgo
23 ! stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
24
25 # https://go.dev/issue/50183: a mismatched GOROOT_FINAL caused net to be stale.
26 env GOROOT_FINAL=$WORK${/}goroot
27 go build -x runtime/cgo
28 ! stderr '[/\\]cgo'$GOEXE'["]? .* -importpath runtime/cgo'
29
View as plain text