mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-24 19:12:02 +00:00
hacks: build main target without go in the PATH
`make` is able to build project binaries, but fails with error `hack/lib/golang.sh: line 455: go: command not found` trying to place them if go binary is not in the PATH. This happens because kube::golang::place_bins uses different environment than kube::golang::build_binaries. Setting up an one environment for both `kube::golang::place_bins` and `kube::golang::build_binaries` should solve this issue and allow default make target to fully work without go binary in the PATH.
This commit is contained in:
parent
d9c54f69d4
commit
91099aca72
@ -873,10 +873,6 @@ kube::golang::get_physmem() {
|
||||
# KUBE_BUILD_PLATFORMS - Incoming variable of targets to build for. If unset
|
||||
# then just the host architecture is built.
|
||||
kube::golang::build_binaries() {
|
||||
# Create a sub-shell so that we don't pollute the outer environment
|
||||
(
|
||||
# Check for `go` binary and set ${GOPATH}.
|
||||
kube::golang::setup_env
|
||||
V=2 kube::log::info "Go version: $(GOFLAGS='' go version)"
|
||||
|
||||
local host_platform
|
||||
@ -974,5 +970,4 @@ kube::golang::build_binaries() {
|
||||
)
|
||||
done
|
||||
fi
|
||||
)
|
||||
}
|
||||
|
@ -24,5 +24,6 @@ KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
|
||||
KUBE_VERBOSE="${KUBE_VERBOSE:-1}"
|
||||
source "${KUBE_ROOT}/hack/lib/init.sh"
|
||||
|
||||
kube::golang::setup_env
|
||||
kube::golang::build_binaries "$@"
|
||||
kube::golang::place_bins
|
||||
|
Loading…
Reference in New Issue
Block a user