build.sh (etcd-3.5.5) | : | build.sh (etcd-3.5.6) | ||
---|---|---|---|---|
skipping to change at line 45 | skipping to change at line 45 | |||
out="bin" | out="bin" | |||
if [[ -n "${BINDIR}" ]]; then out="${BINDIR}"; fi | if [[ -n "${BINDIR}" ]]; then out="${BINDIR}"; fi | |||
toggle_failpoints_default | toggle_failpoints_default | |||
run rm -f "${out}/etcd" | run rm -f "${out}/etcd" | |||
( | ( | |||
cd ./server | cd ./server | |||
# Static compilation is useful when etcd is run in a container. $GO_BUILD_FL AGS is OK | # Static compilation is useful when etcd is run in a container. $GO_BUILD_FL AGS is OK | |||
# shellcheck disable=SC2086 | # shellcheck disable=SC2086 | |||
run env "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \ | run env "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \ | |||
-trimpath \ | ||||
-installsuffix=cgo \ | -installsuffix=cgo \ | |||
"-ldflags=${GO_LDFLAGS[*]}" \ | "-ldflags=${GO_LDFLAGS[*]}" \ | |||
-o="../${out}/etcd" . || return 2 | -o="../${out}/etcd" . || return 2 | |||
) || return 2 | ) || return 2 | |||
run rm -f "${out}/etcdutl" | run rm -f "${out}/etcdutl" | |||
# shellcheck disable=SC2086 | # shellcheck disable=SC2086 | |||
( | ( | |||
cd ./etcdutl | cd ./etcdutl | |||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO _BUILD_FLAGS \ | run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO _BUILD_FLAGS \ | |||
-trimpath \ | ||||
-installsuffix=cgo \ | -installsuffix=cgo \ | |||
"-ldflags=${GO_LDFLAGS[*]}" \ | "-ldflags=${GO_LDFLAGS[*]}" \ | |||
-o="../${out}/etcdutl" . || return 2 | -o="../${out}/etcdutl" . || return 2 | |||
) || return 2 | ) || return 2 | |||
run rm -f "${out}/etcdctl" | run rm -f "${out}/etcdctl" | |||
# shellcheck disable=SC2086 | # shellcheck disable=SC2086 | |||
( | ( | |||
cd ./etcdctl | cd ./etcdctl | |||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO _BUILD_FLAGS \ | run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO _BUILD_FLAGS \ | |||
-trimpath \ | ||||
-installsuffix=cgo \ | -installsuffix=cgo \ | |||
"-ldflags=${GO_LDFLAGS[*]}" \ | "-ldflags=${GO_LDFLAGS[*]}" \ | |||
-o="../${out}/etcdctl" . || return 2 | -o="../${out}/etcdctl" . || return 2 | |||
) || return 2 | ) || return 2 | |||
# Verify whether symbol we overriden exists | # Verify whether symbol we overriden exists | |||
# For cross-compiling we cannot run: ${out}/etcd --version | grep -q "Git SHA: ${GIT_SHA}" | # For cross-compiling we cannot run: ${out}/etcd --version | grep -q "Git SHA: ${GIT_SHA}" | |||
# We need symbols to do this check: | # We need symbols to do this check: | |||
if [[ "${GO_LDFLAGS[*]}" != *"-s"* ]]; then | if [[ "${GO_LDFLAGS[*]}" != *"-s"* ]]; then | |||
go tool nm "${out}/etcd" | grep "${VERSION_SYMBOL}" > /dev/null | go tool nm "${out}/etcd" | grep "${VERSION_SYMBOL}" > /dev/null | |||
skipping to change at line 95 | skipping to change at line 98 | |||
tools_path="tools/benchmark | tools_path="tools/benchmark | |||
tools/etcd-dump-db | tools/etcd-dump-db | |||
tools/etcd-dump-logs | tools/etcd-dump-logs | |||
tools/local-tester/bridge" | tools/local-tester/bridge" | |||
for tool in ${tools_path} | for tool in ${tools_path} | |||
do | do | |||
echo "Building" "'${tool}'"... | echo "Building" "'${tool}'"... | |||
run rm -f "${out}/${tool}" | run rm -f "${out}/${tool}" | |||
# shellcheck disable=SC2086 | # shellcheck disable=SC2086 | |||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" CGO_ENABLED=0 go build ${GO_BUILD _FLAGS} \ | run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" CGO_ENABLED=0 go build ${GO_BUILD _FLAGS} \ | |||
-trimpath \ | ||||
-installsuffix=cgo \ | -installsuffix=cgo \ | |||
"-ldflags='${GO_LDFLAGS[*]}'" \ | "-ldflags='${GO_LDFLAGS[*]}'" \ | |||
-o="${out}/${tool}" "./${tool}" || return 2 | -o="${out}/${tool}" "./${tool}" || return 2 | |||
done | done | |||
tests_build "${@}" | tests_build "${@}" | |||
} | } | |||
tests_build() { | tests_build() { | |||
out="bin" | out="bin" | |||
if [[ -n "${BINDIR}" ]]; then out="${BINDIR}"; fi | if [[ -n "${BINDIR}" ]]; then out="${BINDIR}"; fi | |||
End of changes. 4 change blocks. | ||||
0 lines changed or deleted | 4 lines changed or added |