mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 10:51:29 +00:00
Slightly nicer output when building
before: ``` $ make generated_files +++ [0226 13:42:17] Building go targets for linux/amd64: hack/make-rules/helpers/go2make > non-static build: k8s.io/kubernetes/hack/make-rules/helpers/go2make ``` after: ``` $ make generated_files +++ [0226 14:30:08] Building go targets for linux/amd64 k8s.io/kubernetes/hack/make-rules/helpers/go2make (non-static) ```
This commit is contained in:
parent
30b20f184e
commit
4a0c6c2444
@ -696,18 +696,21 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
local -a nonstatics=()
|
local -a nonstatics=()
|
||||||
local -a tests=()
|
local -a tests=()
|
||||||
|
|
||||||
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}"
|
|
||||||
|
|
||||||
for binary in "${binaries[@]}"; do
|
for binary in "${binaries[@]}"; do
|
||||||
if [[ "${binary}" =~ ".test"$ ]]; then
|
if [[ "${binary}" =~ ".test"$ ]]; then
|
||||||
tests+=("${binary}")
|
tests+=("${binary}")
|
||||||
|
kube::log::info " ${binary} (test)"
|
||||||
elif kube::golang::is_statically_linked_library "${binary}"; then
|
elif kube::golang::is_statically_linked_library "${binary}"; then
|
||||||
statics+=("${binary}")
|
statics+=("${binary}")
|
||||||
|
kube::log::info " ${binary} (static)"
|
||||||
else
|
else
|
||||||
nonstatics+=("${binary}")
|
nonstatics+=("${binary}")
|
||||||
|
kube::log::info " ${binary} (non-static)"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}"
|
||||||
|
|
||||||
local -a build_args
|
local -a build_args
|
||||||
if [[ "${#statics[@]}" != 0 ]]; then
|
if [[ "${#statics[@]}" != 0 ]]; then
|
||||||
build_args=(
|
build_args=(
|
||||||
@ -718,7 +721,6 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
-ldflags "${goldflags:-}"
|
-ldflags "${goldflags:-}"
|
||||||
-tags "${gotags:-}"
|
-tags "${gotags:-}"
|
||||||
)
|
)
|
||||||
V=1 kube::log::info "> static build CGO_ENABLED=0: ${statics[*]}"
|
|
||||||
CGO_ENABLED=0 kube::golang::build_some_binaries "${statics[@]}"
|
CGO_ENABLED=0 kube::golang::build_some_binaries "${statics[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -730,7 +732,6 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
-ldflags "${goldflags:-}"
|
-ldflags "${goldflags:-}"
|
||||||
-tags "${gotags:-}"
|
-tags "${gotags:-}"
|
||||||
)
|
)
|
||||||
V=1 kube::log::info "> non-static build: ${nonstatics[*]}"
|
|
||||||
kube::golang::build_some_binaries "${nonstatics[@]}"
|
kube::golang::build_some_binaries "${nonstatics[@]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -872,7 +873,7 @@ kube::golang::build_binaries() {
|
|||||||
exit "${fails}"
|
exit "${fails}"
|
||||||
else
|
else
|
||||||
for platform in "${platforms[@]}"; do
|
for platform in "${platforms[@]}"; do
|
||||||
kube::log::status "Building go targets for ${platform}:" "${targets[@]}"
|
kube::log::status "Building go targets for ${platform}"
|
||||||
(
|
(
|
||||||
kube::golang::set_platform_envs "${platform}"
|
kube::golang::set_platform_envs "${platform}"
|
||||||
kube::golang::build_binaries_for_platform "${platform}"
|
kube::golang::build_binaries_for_platform "${platform}"
|
||||||
|
Loading…
Reference in New Issue
Block a user