Skip to content

Commit

Permalink
build: support building out of path when GOPATH is not set
Browse files Browse the repository at this point in the history
Otherwise gets "go: GOPATH entry is relative; must be absolute path: ""."
  • Loading branch information
Anthony Romano committed Sep 27, 2016
1 parent 150576f commit 1e3a71d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@ script:
;;
*)
# test building out of gopath
GO_BUILD_FLAGS="-a -v" GOPATH=/bad-go-path GOARCH="${TARGET}" ./build
GO_BUILD_FLAGS="-a -v" GOPATH="" GOARCH="${TARGET}" ./build
;;
esac
5 changes: 4 additions & 1 deletion build
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,10 @@ etcd_setup_gopath() {
cd "$CDIR"
etcdGOPATH=${CDIR}/gopath
# preserve old gopath to support building with unvendored tooling deps (e.g., gofail)
export GOPATH=${etcdGOPATH}:$GOPATH
if [ -n "$GOPATH" ]; then
GOPATH=":$GOPATH"
fi
export GOPATH=${etcdGOPATH}$GOPATH
rm -f ${etcdGOPATH}/src
mkdir -p ${etcdGOPATH}
ln -s ${CDIR}/cmd/vendor ${etcdGOPATH}/src
Expand Down

0 comments on commit 1e3a71d

Please sign in to comment.