编译 kubernetes 源码,但是出现了以下报错, cannot find runtime/cgo,大佬来看看吧

查看 45|回复 1
作者:mengjisang   
# k8s.io/kubernetes/cmd/kubectl
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cmd/kubeadm
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cmd/kube-proxy
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cmd/kube-scheduler
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cmd/kube-apiserver
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cmd/kube-controller-manager
loadinternal: cannot find runtime/cgo
# k8s.io/kubernetes/cluster/gce/gci/mounter
loadinternal: cannot find runtime/cgo
^Cmake: *** [Makefile:93: all] Interrupt
go 的环境参数如下
[email protected]:~/Desktop/kubernetes/kubernetes-1.20.2$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/hj/.cache/go-build"
GOENV="/home/hj/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/hj/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/hj/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.20.4"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/hj/Desktop/kubernetes/kubernetes-1.20.2/go.mod"
GOWORK=""
CGO_CFLAGS="-O2 -g"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-O2 -g"
CGO_FFLAGS="-O2 -g"
CGO_LDFLAGS="-O2 -g"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4160134575=/tmp/go-build -gno-record-gcc-switches"

cgo, Runtime, cannot, find

mengjisang
OP
  
看到有说法是 CGO_ENABLED=1 ,但我看 go env 有这个参数,就很疑惑
您需要登录后才可以回帖 登录 | 立即注册

返回顶部