@@ -48,13 +48,16 @@ endif
48
48
# Safe, since this code isn't performance critical.
49
49
export CGO_CFLAGS := -O1
50
50
51
+ # Disable CGO explicitly
52
+ export CGO_ENABLED =0
53
+
51
54
# build the vitess binaries with dynamic dependency on libc
52
55
build-dyn :
53
56
ifndef NOBANNER
54
57
echo $$(date): Building source tree
55
58
endif
56
59
bash ./build.env
57
- CGO_ENABLED=0 go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
60
+ go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
58
61
59
62
# build the vitess binaries statically
60
63
build :
@@ -63,7 +66,7 @@ ifndef NOBANNER
63
66
endif
64
67
bash ./build.env
65
68
# build all the binaries by default with CGO disabled.
66
- CGO_ENABLED=0 go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
69
+ go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
67
70
68
71
# cross-build can be used to cross-compile Vitess client binaries
69
72
# Outside of select client binaries (namely vtctlclient & vtexplain), cross-compiled Vitess Binaries are not recommended for production deployments
76
79
# In order to cross-compile, go install requires GOBIN to be unset
77
80
export GOBIN=""
78
81
# For the specified GOOS + GOARCH, build all the binaries by default with CGO disabled
79
- CGO_ENABLED=0 GOOS=${GOOS} GOARCH=${GOARCH} go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
82
+ GOOS=${GOOS} GOARCH=${GOARCH} go install -trimpath $(EXTRA_BUILD_FLAGS) $(VT_GO_PARALLEL) -ldflags "$(shell tools/build_version_flags.sh)" ./go/...
80
83
81
84
if [ ! -x "${HOME}/go/bin/${GOOS}_${GOARCH}/vttablet" ]; then \
82
85
echo "Missing vttablet at: ${HOME}/go/bin/${GOOS}_${GOARCH}/vttablet" && exit; \
0 commit comments