build: remove "./cmd/etcd,etcdctl"
@@ -10,7 +10,7 @@ if [ ! -z "$FAILPOINTS" ]; then
fi
# Set GO_LDFLAGS="-s" for building without symbols for debugging.
-GO_LDFLAGS="$GO_LDFLAGS -X ${REPO_PATH}/cmd/vendor/${REPO_PATH}/version.GitSHA=${GIT_SHA}"
+GO_LDFLAGS="$GO_LDFLAGS -X ${REPO_PATH}/version.GitSHA=${GIT_SHA}"
# enable/disable failpoints
toggle_failpoints() {
@@ -36,31 +36,14 @@ etcd_build() {
# Static compilation is useful when etcd is run in a container. $GO_BUILD_FLAGS is OK
# shellcheck disable=SC2086
- CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcd" ${REPO_PATH}/cmd/etcd || return
+ CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcd" . || return
# shellcheck disable=SC2086
- CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcdctl" ${REPO_PATH}/cmd/etcdctl || return
-}
-
-etcd_setup_gopath() {
- d=$(dirname "$0")
- CDIR=$(cd "$d" && pwd)
- cd "$CDIR"
- etcdGOPATH="${CDIR}/gopath"
- # preserve old gopath to support building with unvendored tooling deps (e.g., gofail)
- if [ -n "$GOPATH" ]; then
- GOPATH=":$GOPATH"
- fi
- export GOPATH=${etcdGOPATH}$GOPATH
- rm -rf "${etcdGOPATH}/src"
- mkdir -p "${etcdGOPATH}"
- ln -s "${CDIR}/cmd/vendor" "${etcdGOPATH}/src"
+ CGO_ENABLED=0 go build $GO_BUILD_FLAGS -installsuffix cgo -ldflags "$GO_LDFLAGS" -o "${out}/etcdctl" ./etcdctl || return
}
toggle_failpoints_default
# only build when called directly, not sourced
if echo "$0" | grep "build$" >/dev/null; then
- # force new gopath so builds outside of gopath work
- etcd_setup_gopath
etcd_build
fi
