Repository: incubator-htrace Updated Branches: refs/heads/3.1 57567c6a1 -> 2f1e8cda1
HTRACE-59. Lock go build dependencies to specific versions (cmccabe) Project: http://git-wip-us.apache.org/repos/asf/incubator-htrace/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-htrace/commit/2f1e8cda Tree: http://git-wip-us.apache.org/repos/asf/incubator-htrace/tree/2f1e8cda Diff: http://git-wip-us.apache.org/repos/asf/incubator-htrace/diff/2f1e8cda Branch: refs/heads/3.1 Commit: 2f1e8cda1ab725b3d8a790b161e76709b39369b8 Parents: 57567c6 Author: Colin P. Mccabe <[email protected]> Authored: Fri Jan 9 15:28:51 2015 -0800 Committer: Colin P. Mccabe <[email protected]> Committed: Fri Jan 9 15:32:51 2015 -0800 ---------------------------------------------------------------------- htrace-core/src/go/BUILDING.txt | 1 + htrace-core/src/go/Godeps/Godeps.json | 26 ++++++++++++++++++++ htrace-core/src/go/gobuild.sh | 13 ++++++++-- .../src/go/src/org/apache/htrace/htrace/cmd.go | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/2f1e8cda/htrace-core/src/go/BUILDING.txt ---------------------------------------------------------------------- diff --git a/htrace-core/src/go/BUILDING.txt b/htrace-core/src/go/BUILDING.txt index d54d410..bb3eb88 100644 --- a/htrace-core/src/go/BUILDING.txt +++ b/htrace-core/src/go/BUILDING.txt @@ -20,6 +20,7 @@ Dependencies You will need to install: * The Go programming language * The development package for leveldb (some Linux distros call this "leveldb-devel") containing libleveldb.so +* Version 0 of the "godep" tool from https://github.com/tools/godep/releases htraced requires libleveldb.so to be in your shared library path in order to run. You can set LD_LIBRARY_PATH to the path for this library, or simply install http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/2f1e8cda/htrace-core/src/go/Godeps/Godeps.json ---------------------------------------------------------------------- diff --git a/htrace-core/src/go/Godeps/Godeps.json b/htrace-core/src/go/Godeps/Godeps.json new file mode 100644 index 0000000..10c8e5d --- /dev/null +++ b/htrace-core/src/go/Godeps/Godeps.json @@ -0,0 +1,26 @@ +{ + "ImportPath": "git-wip-us.apache.org/repos/asf/incubator-htrace.git", + "GoVersion": "go1.3.1", + "Deps": [ + { + "ImportPath": "github.com/alecthomas/kingpin", + "Rev": "afafa8aab106d31c9dc8f5e562b3f30f6246c3d4" + }, + { + "ImportPath": "github.com/alecthomas/units", + "Rev": "6b4e7dc5e3143b85ea77909c72caf89416fc2915" + }, + { + "ImportPath": "github.com/gorilla/context", + "Rev": "215affda49addc4c8ef7e2534915df2c8c35c6cd" + }, + { + "ImportPath": "github.com/gorilla/mux", + "Rev": "e444e69cbd2e2e3e0749a2f3c717cec491552bbf" + }, + { + "ImportPath": "github.com/jmhodges/levigo", + "Rev": "2c43dde93d0e056173706534afd514fcbc1dd578" + } + ] +} http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/2f1e8cda/htrace-core/src/go/gobuild.sh ---------------------------------------------------------------------- diff --git a/htrace-core/src/go/gobuild.sh b/htrace-core/src/go/gobuild.sh index 9e1efa8..3e3c0e7 100755 --- a/htrace-core/src/go/gobuild.sh +++ b/htrace-core/src/go/gobuild.sh @@ -32,7 +32,7 @@ die() { exit 1 } -ACTION=get +ACTION=build if [ $# -gt 0 ]; then if [ "x${1}" == "xbench" ]; then # run benchmarks @@ -47,6 +47,7 @@ fi RELEASE_VERSION=${RELEASE_VERSION:-unknown} SCRIPT_DIR="$(cd "$( dirname $0 )" && pwd)" +cd $SCRIPT_DIR || die "failed to cd to $SCRIPT_DIR" export GOPATH="$GOPATH:${SCRIPT_DIR}" export GOBIN="${SCRIPT_DIR}/bin" mkdir -p ${GOBIN} || die "failed to create ${GOBIN}" @@ -81,7 +82,15 @@ if [ -n "${ldconfig}" ]; then fi fi -if [ "$ACTION" == "get" ]; then +if [ "$ACTION" == "build" ]; then + PATH="${PATH}:${GOBIN}" + which godep &> /dev/null + if [ $? -ne 0 ]; then + echo "Installing godep..." + go get github.com/tools/godep || die "failed to get godep" + fi + echo "godep restore..." + godep restore || die "failed to set up dependencies" go run "$SCRIPT_DIR/src/org/apache/htrace/bundler/bundler.go" \ --src="$SCRIPT_DIR/../web/" --dst="$SCRIPT_DIR/src/org/apache/htrace/resource/" \ || die "bundler failed" http://git-wip-us.apache.org/repos/asf/incubator-htrace/blob/2f1e8cda/htrace-core/src/go/src/org/apache/htrace/htrace/cmd.go ---------------------------------------------------------------------- diff --git a/htrace-core/src/go/src/org/apache/htrace/htrace/cmd.go b/htrace-core/src/go/src/org/apache/htrace/htrace/cmd.go index 3b89c72..2d75253 100644 --- a/htrace-core/src/go/src/org/apache/htrace/htrace/cmd.go +++ b/htrace-core/src/go/src/org/apache/htrace/htrace/cmd.go @@ -23,7 +23,7 @@ import ( "encoding/json" "errors" "fmt" - "gopkg.in/alecthomas/kingpin.v1" + "github.com/alecthomas/kingpin" "io/ioutil" "net/http" "org/apache/htrace/common"
