mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #14816 from serathius/trim-v3.5
[3.5] trim build path
This commit is contained in:
commit
d0424a7bf1
4
build.sh
4
build.sh
@ -42,6 +42,7 @@ etcd_build() {
|
||||
# Static compilation is useful when etcd is run in a container. $GO_BUILD_FLAGS is OK
|
||||
# shellcheck disable=SC2086
|
||||
run env "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \
|
||||
-trimpath \
|
||||
-installsuffix=cgo \
|
||||
"-ldflags=${GO_LDFLAGS[*]}" \
|
||||
-o="../${out}/etcd" . || return 2
|
||||
@ -52,6 +53,7 @@ etcd_build() {
|
||||
(
|
||||
cd ./etcdutl
|
||||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \
|
||||
-trimpath \
|
||||
-installsuffix=cgo \
|
||||
"-ldflags=${GO_LDFLAGS[*]}" \
|
||||
-o="../${out}/etcdutl" . || return 2
|
||||
@ -62,6 +64,7 @@ etcd_build() {
|
||||
(
|
||||
cd ./etcdctl
|
||||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" "${GO_BUILD_ENV[@]}" go build $GO_BUILD_FLAGS \
|
||||
-trimpath \
|
||||
-installsuffix=cgo \
|
||||
"-ldflags=${GO_LDFLAGS[*]}" \
|
||||
-o="../${out}/etcdctl" . || return 2
|
||||
@ -92,6 +95,7 @@ tools_build() {
|
||||
run rm -f "${out}/${tool}"
|
||||
# shellcheck disable=SC2086
|
||||
run env GO_BUILD_FLAGS="${GO_BUILD_FLAGS}" CGO_ENABLED=0 go build ${GO_BUILD_FLAGS} \
|
||||
-trimpath \
|
||||
-installsuffix=cgo \
|
||||
"-ldflags='${GO_LDFLAGS[*]}'" \
|
||||
-o="${out}/${tool}" "./${tool}" || return 2
|
||||
|
@ -87,7 +87,7 @@ function main {
|
||||
export GOARCH=${TARGET_ARCH}
|
||||
|
||||
pushd etcd >/dev/null
|
||||
GO_LDFLAGS="-s" ./build.sh
|
||||
GO_LDFLAGS="-s -w" ./build.sh
|
||||
popd >/dev/null
|
||||
|
||||
TARGET="etcd-${VER}-${GOOS}-${GOARCH}"
|
||||
|
@ -7,8 +7,8 @@ fi
|
||||
|
||||
(
|
||||
cd ./tests
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ../bin/etcd-agent ./functional/cmd/etcd-agent
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ../bin/etcd-proxy ./functional/cmd/etcd-proxy
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ../bin/etcd-runner ./functional/cmd/etcd-runner
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s" -o ../bin/etcd-tester ./functional/cmd/etcd-tester
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s -w" -o ../bin/etcd-agent ./functional/cmd/etcd-agent
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s -w" -o ../bin/etcd-proxy ./functional/cmd/etcd-proxy
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s -w" -o ../bin/etcd-runner ./functional/cmd/etcd-runner
|
||||
CGO_ENABLED=0 go build -v -installsuffix cgo -ldflags "-s -w" -o ../bin/etcd-tester ./functional/cmd/etcd-tester
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user