mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #110525 from gnufied/disable-trimpath-debug-mode
Disable trimpath in debug mode
This commit is contained in:
commit
0348821c9f
@ -705,6 +705,7 @@ kube::golang::build_binaries_for_platform() {
|
|||||||
done
|
done
|
||||||
|
|
||||||
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}"
|
V=2 kube::log::info "Env for ${platform}: GOOS=${GOOS-} GOARCH=${GOARCH-} GOROOT=${GOROOT-} CGO_ENABLED=${CGO_ENABLED-} CC=${CC-}"
|
||||||
|
V=3 kube::log::info "Building binaries with GCFLAGS=${gogcflags} ASMFLAGS=${goasmflags} LDFLAGS=${goldflags}"
|
||||||
|
|
||||||
local -a build_args
|
local -a build_args
|
||||||
if [[ "${#statics[@]}" != 0 ]]; then
|
if [[ "${#statics[@]}" != 0 ]]; then
|
||||||
@ -807,8 +808,9 @@ kube::golang::build_binaries() {
|
|||||||
|
|
||||||
gogcflags="all=-trimpath=${trimroot} ${GOGCFLAGS:-}"
|
gogcflags="all=-trimpath=${trimroot} ${GOGCFLAGS:-}"
|
||||||
if [[ "${DBG:-}" == 1 ]]; then
|
if [[ "${DBG:-}" == 1 ]]; then
|
||||||
# Debugging - disable optimizations and inlining.
|
# Debugging - disable optimizations and inlining and trimPath
|
||||||
gogcflags="${gogcflags} -N -l"
|
gogcflags="${GOGCFLAGS:-} all=-N -l"
|
||||||
|
goasmflags=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
goldflags="all=$(kube::version::ldflags) ${GOLDFLAGS:-}"
|
goldflags="all=$(kube::version::ldflags) ${GOLDFLAGS:-}"
|
||||||
|
Loading…
Reference in New Issue
Block a user