mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Disable unified build and static init optimization for tests
This commit is contained in:
parent
16bd7e6a79
commit
e20d77bb79
@ -774,15 +774,26 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
kube::golang::build_some_binaries "${nonstatics[@]}"
|
kube::golang::build_some_binaries "${nonstatics[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Workaround for https://github.com/kubernetes/kubernetes/issues/115675
|
||||||
|
local testgogcflags="${gogcflags}"
|
||||||
|
local testgoexperiment="${GOEXPERIMENT:-}"
|
||||||
|
if [[ "$(go version)" == *"go1.20"* && "${platform}" == "linux/arm" ]]; then
|
||||||
|
# work around https://github.com/golang/go/issues/58339 until fixed in go1.20.x
|
||||||
|
testgogcflags="${testgogcflags} -d=inlstaticinit=0"
|
||||||
|
# work around https://github.com/golang/go/issues/58425
|
||||||
|
testgoexperiment="nounified,${testgoexperiment}"
|
||||||
|
kube::log::info "Building test binaries with GOEXPERIMENT=${testgoexperiment} GCFLAGS=${testgogcflags} ASMFLAGS=${goasmflags} LDFLAGS=${goldflags}"
|
||||||
|
fi
|
||||||
|
|
||||||
for test in "${tests[@]:+${tests[@]}}"; do
|
for test in "${tests[@]:+${tests[@]}}"; do
|
||||||
local outfile testpkg
|
local outfile testpkg
|
||||||
outfile=$(kube::golang::outfile_for_binary "${test}" "${platform}")
|
outfile=$(kube::golang::outfile_for_binary "${test}" "${platform}")
|
||||||
testpkg=$(dirname "${test}")
|
testpkg=$(dirname "${test}")
|
||||||
|
|
||||||
mkdir -p "$(dirname "${outfile}")"
|
mkdir -p "$(dirname "${outfile}")"
|
||||||
go test -c \
|
GOEXPERIMENT="${testgoexperiment}" go test -c \
|
||||||
${goflags:+"${goflags[@]}"} \
|
${goflags:+"${goflags[@]}"} \
|
||||||
-gcflags="${gogcflags}" \
|
-gcflags="${testgogcflags}" \
|
||||||
-asmflags="${goasmflags}" \
|
-asmflags="${goasmflags}" \
|
||||||
-ldflags="${goldflags}" \
|
-ldflags="${goldflags}" \
|
||||||
-tags="${gotags:-}" \
|
-tags="${gotags:-}" \
|
||||||
|
Loading…
Reference in New Issue
Block a user