Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "Disable unified build and static init optimization for tests" #116500

Merged
merged 1 commit into from Mar 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 2 additions & 13 deletions hack/lib/golang.sh
Expand Up @@ -773,26 +773,15 @@ kube::golang::build_binaries_for_platform() {
kube::golang::build_some_binaries "${nonstatics[@]}"
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
local outfile testpkg
outfile=$(kube::golang::outfile_for_binary "${test}" "${platform}")
testpkg=$(dirname "${test}")

mkdir -p "$(dirname "${outfile}")"
GOEXPERIMENT="${testgoexperiment}" go test -c \
go test -c \
${goflags:+"${goflags[@]}"} \
-gcflags="${testgogcflags}" \
-gcflags="${gogcflags}" \
-asmflags="${goasmflags}" \
-ldflags="${goldflags}" \
-tags="${gotags:-}" \
Expand Down