mirror of
https://hubproxy.babadafafafafa.cn/https://github.com/yunionio/cloudpods.git
synced 2026-09-20 08:03:53 +08:00
misc: disable cgo by default (#20423)
* misc: disable cgo by default * fix(host): container isolated device skip get numa node
This commit is contained in:
9
Makefile
9
Makefile
@@ -89,11 +89,14 @@ vet:
|
||||
# cmd/esxi-agent: prepare_dir
|
||||
# CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
|
||||
cmd/fetcherfs: prepare_dir
|
||||
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
cmd/host: prepare_dir
|
||||
CGO_ENABLED=1 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
|
||||
cmd/host-image: prepare_dir
|
||||
CGO_ENABLED=1 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
|
||||
cmd/%: prepare_dir
|
||||
$(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
CGO_ENABLED=0 $(GO_BUILD) -o $(BIN_DIR)/$(shell basename $@) $(REPO_PREFIX)/$@
|
||||
|
||||
rpm/%: cmd/%
|
||||
$(BUILD_SCRIPT) $*
|
||||
|
||||
@@ -64,6 +64,10 @@ func (c BaseDevice) GetNvidiaMpsThreadPercentage() int {
|
||||
return -1
|
||||
}
|
||||
|
||||
func (c BaseDevice) GetNumaNode() (int, error) {
|
||||
return -1, nil
|
||||
}
|
||||
|
||||
func CheckVirtualNumber(dev *isolated_device.ContainerDevice) error {
|
||||
if dev.VirtualNumber <= 0 {
|
||||
return errors.Errorf("virtual_number must > 0")
|
||||
|
||||
@@ -157,6 +157,16 @@ build_process() {
|
||||
local arch=$2
|
||||
local is_all_arch=$3
|
||||
local img_name=$(get_image_name $component $arch $is_all_arch)
|
||||
local build_env=""
|
||||
|
||||
case "$component" in
|
||||
host | host-image)
|
||||
build_env="$build_env CGO_ENABLED=1"
|
||||
;;
|
||||
*)
|
||||
build_env="$build_env CGO_ENABLED=0"
|
||||
;;
|
||||
esac
|
||||
|
||||
build_bin $component
|
||||
if [[ "$DRY_RUN" == "true" ]]; then
|
||||
@@ -174,13 +184,14 @@ build_process_with_buildx() {
|
||||
local is_all_arch=$3
|
||||
local img_name=$(get_image_name $component $arch $is_all_arch)
|
||||
|
||||
build_env="GOARCH=$arch"
|
||||
if [[ "$arch" == arm64 ]]; then
|
||||
build_env="$build_env"
|
||||
if [[ $component == host ]]; then
|
||||
build_env="$build_env CGO_ENABLED=1"
|
||||
fi
|
||||
fi
|
||||
case "$component" in
|
||||
host | host-image)
|
||||
build_env="$build_env CGO_ENABLED=1"
|
||||
;;
|
||||
*)
|
||||
build_env="$build_env CGO_ENABLED=0"
|
||||
;;
|
||||
esac
|
||||
|
||||
case "$component" in
|
||||
host | torrent)
|
||||
|
||||
Reference in New Issue
Block a user