From 93732b4c1ea2233fd807a02a3452d023169e4556 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 27 Feb 2018 16:34:35 +0400 Subject: [PATCH 1/7] remove old network tests Refs #1249 --- test/README.md | 5 ----- test/net/setup.sh | 26 -------------------------- test/net/start.sh | 29 ----------------------------- test/net/test.sh | 8 -------- test/test.sh | 10 ---------- 5 files changed, 78 deletions(-) delete mode 100644 test/net/setup.sh delete mode 100644 test/net/start.sh delete mode 100644 test/net/test.sh diff --git a/test/README.md b/test/README.md index d948083f2..d9f09fef7 100644 --- a/test/README.md +++ b/test/README.md @@ -23,8 +23,3 @@ and run the following tests in docker containers: If on a `release-x.x.x` branch, we also run - `go test` for all our dependency libs (test/test_libs.sh) -- network_testing - benchmark a mintnet based cloud deploy using netmon - - - - diff --git a/test/net/setup.sh b/test/net/setup.sh deleted file mode 100644 index 148a3c4b7..000000000 --- a/test/net/setup.sh +++ /dev/null @@ -1,26 +0,0 @@ -#! /bin/bash -set -eu - -# grab glide for dependency mgmt -go get github.com/Masterminds/glide - -# grab network monitor, install mintnet, netmon -# these might err -echo "... fetching repos. ignore go get errors" -set +e -go get github.com/tendermint/network_testing -go get github.com/tendermint/mintnet -go get github.com/tendermint/netmon -set -e - -# install vendored deps -echo "GOPATH $GOPATH" - -cd $GOPATH/src/github.com/tendermint/mintnet -echo "... install mintnet dir $(pwd)" -glide install -go install -cd $GOPATH/src/github.com/tendermint/netmon -echo "... install netmon dir $(pwd)" -glide install -go install diff --git a/test/net/start.sh b/test/net/start.sh deleted file mode 100644 index 9e9ea3a0d..000000000 --- a/test/net/start.sh +++ /dev/null @@ -1,29 +0,0 @@ -#! /bin/bash -set -eu - -# start a testnet and benchmark throughput using mintnet+netmon via the network_testing repo - -DATACENTER=single -VALSETSIZE=4 -BLOCKSIZE=8092 -TX_SIZE=200 -NTXS=$((BLOCKSIZE*4)) -RESULTSDIR=results -CLOUD_PROVIDER=digitalocean - -set +u -if [[ "$MACH_PREFIX" == "" ]]; then - MACH_PREFIX=mach -fi -set -u - -cd "$GOPATH/src/github.com/tendermint/network_testing" -echo "... running network test $(pwd)" -TMHEAD=$(git rev-parse --abbrev-ref HEAD) TM_IMAGE="tendermint/tendermint" bash experiments/exp_throughput.sh $DATACENTER $VALSETSIZE $BLOCKSIZE $TX_SIZE $NTXS $MACH_PREFIX $RESULTSDIR $CLOUD_PROVIDER - -# TODO: publish result! - -# cleanup - -echo "... destroying machines" -mintnet destroy --machines $MACH_PREFIX[1-$VALSETSIZE] diff --git a/test/net/test.sh b/test/net/test.sh deleted file mode 100644 index 19147eb83..000000000 --- a/test/net/test.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/bash -set -eu - -# install mintnet, netmon, fetch network_testing -bash test/net/setup.sh - -# start the testnet -bash test/net/start.sh diff --git a/test/test.sh b/test/test.sh index 64d7bfc71..d0fafb5ee 100755 --- a/test/test.sh +++ b/test/test.sh @@ -48,13 +48,3 @@ docker cp run_test:/go/src/github.com/tendermint/tendermint/coverage.txt . echo echo "* [$(date +"%T")] running p2p tests on a local docker network" bash "$DIR/p2p/test.sh" tester - -# only run the cloud benchmark for releases -BRANCH=$(git rev-parse --abbrev-ref HEAD) -if [[ $(echo "$BRANCH" | grep "release-") != "" ]]; then - echo - echo "TODO: run network tests" - #echo "* branch $BRANCH; running mintnet/netmon throughput benchmark" - # TODO: replace mintnet - #bash "$DIR/net/test.sh" -fi From 8dd06cf197e40b186fcb6b875b1f7bb7171c7ce2 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 27 Feb 2018 17:20:56 +0400 Subject: [PATCH 2/7] ditch glide --- CONTRIBUTING.md | 28 ++- DOCKER/Dockerfile.develop | 1 - Makefile | 3 +- docs/abci-cli.rst | 8 +- docs/getting-started.rst | 8 +- docs/install.rst | 28 +-- glide.lock | 206 ----------------------- glide.yaml | 63 ------- scripts/{glide => dep_utils}/checkout.sh | 16 +- scripts/dep_utils/parse.sh | 6 + scripts/glide/parse.sh | 13 -- scripts/glide/status.sh | 47 ------ scripts/glide/update.sh | 32 ---- scripts/install_abci_apps.sh | 10 +- test/test_libs.sh | 19 +-- 15 files changed, 69 insertions(+), 419 deletions(-) delete mode 100644 glide.lock delete mode 100644 glide.yaml rename scripts/{glide => dep_utils}/checkout.sh (54%) create mode 100644 scripts/dep_utils/parse.sh delete mode 100644 scripts/glide/parse.sh delete mode 100644 scripts/glide/status.sh delete mode 100644 scripts/glide/update.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b991bcc4e..c725e9f60 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,15 +34,26 @@ Please don't make Pull Requests to `master`. ## Dependencies -We use [glide](https://github.com/masterminds/glide) to manage dependencies. -That said, the master branch of every Tendermint repository should just build with `go get`, which means they should be kept up-to-date with their dependencies so we can get away with telling people they can just `go get` our software. -Since some dependencies are not under our control, a third party may break our build, in which case we can fall back on `glide install`. Even for dependencies under our control, glide helps us keeps multiple repos in sync as they evolve. Anything with an executable, such as apps, tools, and the core, should use glide. +We use [dep](https://github.com/golang/dep) to manage dependencies. -Run `bash scripts/glide/status.sh` to get a list of vendored dependencies that may not be up-to-date. +That said, the master branch of every Tendermint repository should just build +with `go get`, which means they should be kept up-to-date with their +dependencies so we can get away with telling people they can just `go get` our +software. + +Since some dependencies are not under our control, a third party may break our +build, in which case we can fall back on `dep ensure` (or `make +get_vendor_deps`). Even for dependencies under our control, dep helps us keeps +multiple repos in sync as they evolve. Anything with an executable, such as +apps, tools, and the core, should use dep. + +Run `dep status` to get a list of vendored dependencies that may not be +up-to-date. ## Vagrant -If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started hacking Tendermint with the commands below. +If you are a [Vagrant](https://www.vagrantup.com/) user, you can get started +hacking Tendermint with the commands below. NOTE: In case you installed Vagrant in 2017, you might need to run `vagrant box update` to upgrade to the latest `ubuntu/xenial64`. @@ -53,11 +64,14 @@ vagrant ssh make test ``` - ## Testing All repos should be hooked up to circle. -If they have `.go` files in the root directory, they will be automatically tested by circle using `go test -v -race ./...`. If not, they will need a `circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and includes its continuous integration status using a badge in the `README.md`. + +If they have `.go` files in the root directory, they will be automatically +tested by circle using `go test -v -race ./...`. If not, they will need a +`circle.yml`. Ideally, every repo has a `Makefile` that defines `make test` and +includes its continuous integration status using a badge in the `README.md`. ## Branching Model and Release diff --git a/DOCKER/Dockerfile.develop b/DOCKER/Dockerfile.develop index eb230047f..5431b6a1c 100644 --- a/DOCKER/Dockerfile.develop +++ b/DOCKER/Dockerfile.develop @@ -20,7 +20,6 @@ RUN mkdir -p /go/src/github.com/tendermint/tendermint && \ git checkout develop && \ make get_vendor_deps && \ make install && \ - glide cc && \ cd - && \ rm -rf /go/src/github.com/tendermint/tendermint && \ apk del go build-base git diff --git a/Makefile b/Makefile index 4c51600d2..f629ab877 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ GOTOOLS = \ github.com/golang/dep/cmd/dep \ - github.com/tendermint/glide \ # gopkg.in/alecthomas/gometalinter.v2 PACKAGES=$(shell go list ./... | grep -v '/vendor/') BUILD_TAGS?=tendermint @@ -58,7 +57,7 @@ get_vendor_deps: ensure_deps: @rm -rf vendor/ @echo "--> Running dep" - @dep ensure + @dep ensure draw_deps: @# requires brew install graphviz or apt-get install graphviz diff --git a/docs/abci-cli.rst b/docs/abci-cli.rst index c32a46f3f..9162682c3 100644 --- a/docs/abci-cli.rst +++ b/docs/abci-cli.rst @@ -16,15 +16,15 @@ Next, install the ``abci-cli`` tool and example applications: go get -u github.com/tendermint/abci/cmd/abci-cli -If this fails, you may need to use ``glide`` to get vendored +If this fails, you may need to use `dep `__ to get vendored dependencies: :: - go get github.com/Masterminds/glide cd $GOPATH/src/github.com/tendermint/abci - glide install - go install ./cmd/abci-cli + make get_tools + make get_vendor_deps + make install Now run ``abci-cli`` to see the list of commands: diff --git a/docs/getting-started.rst b/docs/getting-started.rst index 2e80a8a8a..fe49e27b5 100644 --- a/docs/getting-started.rst +++ b/docs/getting-started.rst @@ -27,15 +27,15 @@ Then run go get -u github.com/tendermint/abci/cmd/abci-cli -If there is an error, install and run the ``glide`` tool to pin the +If there is an error, install and run the `dep `__ tool to pin the dependencies: :: - go get github.com/Masterminds/glide cd $GOPATH/src/github.com/tendermint/abci - glide install - go install ./cmd/abci-cli + make get_tools + make get_vendor_deps + make install Now you should have the ``abci-cli`` installed; you'll see a couple of commands (``counter`` and ``kvstore``) that are diff --git a/docs/install.rst b/docs/install.rst index b2fe7758e..4ee572604 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -9,7 +9,7 @@ To download pre-built binaries, see the `Download page `__, and the Tendermint source code. Install Go ^^^^^^^^^^ @@ -31,21 +31,21 @@ installation worked. If the installation failed, a dependency may have been updated and become incompatible with the latest Tendermint master branch. We solve this -using the ``glide`` tool for dependency management. +using the ``dep`` tool for dependency management. -First, install ``glide``: +First, install ``dep``: :: - go get github.com/Masterminds/glide + make get_tools Now we can fetch the correct versions of each dependency by running: :: cd $GOPATH/src/github.com/tendermint/tendermint - glide install - go install ./cmd/tendermint + make get_vendor_deps + make install Note that even though ``go get`` originally failed, the repository was still cloned to the correct location in the ``$GOPATH``. @@ -60,7 +60,7 @@ If you already have Tendermint installed, and you make updates, simply :: cd $GOPATH/src/github.com/tendermint/tendermint - go install ./cmd/tendermint + make install To upgrade, there are a few options: @@ -72,18 +72,18 @@ To upgrade, there are a few options: its dependencies - fetch and checkout the latest master branch in ``$GOPATH/src/github.com/tendermint/tendermint``, and then run - ``glide install && go install ./cmd/tendermint`` as above. + ``make get_vendor_deps && make install`` as above. Note the first two options should usually work, but may fail. If they -do, use ``glide``, as above: +do, use ``dep``, as above: :: cd $GOPATH/src/github.com/tendermint/tendermint - glide install - go install ./cmd/tendermint + make get_vendor_deps + make install -Since the third option just uses ``glide`` right away, it should always +Since the third option just uses ``dep`` right away, it should always work. Troubleshooting @@ -96,8 +96,8 @@ If ``go get`` failing bothers you, fetch the code using ``git``: mkdir -p $GOPATH/src/github.com/tendermint git clone https://github.com/tendermint/tendermint $GOPATH/src/github.com/tendermint/tendermint cd $GOPATH/src/github.com/tendermint/tendermint - glide install - go install ./cmd/tendermint + make get_vendor_deps + make install Run ^^^ diff --git a/glide.lock b/glide.lock deleted file mode 100644 index b68662652..000000000 --- a/glide.lock +++ /dev/null @@ -1,206 +0,0 @@ -hash: d9b29e999de7d8a58f068ad5c2af77a030d55418873489ffab9a142df6c31eed -updated: 2018-02-21T00:18:03.549434011-05:00 -imports: -- name: github.com/btcsuite/btcd - version: 50de9da05b50eb15658bb350f6ea24368a111ab7 - subpackages: - - btcec -- name: github.com/ebuchman/fail-test - version: 95f809107225be108efcf10a3509e4ea6ceef3c4 -- name: github.com/fsnotify/fsnotify - version: c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9 -- name: github.com/go-kit/kit - version: 4dc7be5d2d12881735283bcab7352178e190fc71 - subpackages: - - log - - log/level - - log/term -- name: github.com/go-logfmt/logfmt - version: 390ab7935ee28ec6b286364bba9b4dd6410cb3d5 -- name: github.com/go-stack/stack - version: 259ab82a6cad3992b4e21ff5cac294ccb06474bc -- name: github.com/gogo/protobuf - version: 1adfc126b41513cc696b209667c8656ea7aac67c - subpackages: - - gogoproto - - jsonpb - - proto - - protoc-gen-gogo/descriptor - - sortkeys - - types -- name: github.com/golang/protobuf - version: 925541529c1fa6821df4e44ce2723319eb2be768 - subpackages: - - proto - - ptypes - - ptypes/any - - ptypes/duration - - ptypes/timestamp -- name: github.com/golang/snappy - version: 553a641470496b2327abcac10b36396bd98e45c9 -- name: github.com/gorilla/websocket - version: ea4d1f681babbce9545c9c5f3d5194a789c89f5b -- name: github.com/hashicorp/hcl - version: 23c074d0eceb2b8a5bfdbb271ab780cde70f05a8 - subpackages: - - hcl/ast - - hcl/parser - - hcl/scanner - - hcl/strconv - - hcl/token - - json/parser - - json/scanner - - json/token -- name: github.com/inconshreveable/mousetrap - version: 76626ae9c91c4f2a10f34cad8ce83ea42c93bb75 -- name: github.com/jmhodges/levigo - version: c42d9e0ca023e2198120196f842701bb4c55d7b9 -- name: github.com/kr/logfmt - version: b84e30acd515aadc4b783ad4ff83aff3299bdfe0 -- name: github.com/magiconair/properties - version: 49d762b9817ba1c2e9d0c69183c2b4a8b8f1d934 -- name: github.com/mitchellh/mapstructure - version: b4575eea38cca1123ec2dc90c26529b5c5acfcff -- name: github.com/pelletier/go-toml - version: acdc4509485b587f5e675510c4f2c63e90ff68a8 -- name: github.com/pkg/errors - version: 645ef00459ed84a119197bfb8d8205042c6df63d -- name: github.com/rcrowley/go-metrics - version: 8732c616f52954686704c8645fe1a9d59e9df7c1 -- name: github.com/spf13/afero - version: bb8f1927f2a9d3ab41c9340aa034f6b803f4359c - subpackages: - - mem -- name: github.com/spf13/cast - version: acbeb36b902d72a7a4c18e8f3241075e7ab763e4 -- name: github.com/spf13/cobra - version: 7b2c5ac9fc04fc5efafb60700713d4fa609b777b -- name: github.com/spf13/jwalterweatherman - version: 7c0cea34c8ece3fbeb2b27ab9b59511d360fb394 -- name: github.com/spf13/pflag - version: e57e3eeb33f795204c1ca35f56c44f83227c6e66 -- name: github.com/spf13/viper - version: 25b30aa063fc18e48662b86996252eabdcf2f0c7 -- name: github.com/syndtr/goleveldb - version: 34011bf325bce385408353a30b101fe5e923eb6e - subpackages: - - leveldb - - leveldb/cache - - leveldb/comparer - - leveldb/errors - - leveldb/filter - - leveldb/iterator - - leveldb/journal - - leveldb/memdb - - leveldb/opt - - leveldb/storage - - leveldb/table - - leveldb/util -- name: github.com/tendermint/abci - version: 6d47f4afe2b68b20802aa4d049fd6b8c0f54f1a5 - subpackages: - - client - - example/code - - example/counter - - example/kvstore - - server - - types -- name: github.com/tendermint/ed25519 - version: d8387025d2b9d158cf4efb07e7ebf814bcce2057 - subpackages: - - edwards25519 - - extra25519 -- name: github.com/tendermint/go-crypto - version: dd20358a264c772b4a83e477b0cfce4c88a7001d -- name: github.com/tendermint/go-wire - version: b6fc872b42d41158a60307db4da051dd6f179415 - subpackages: - - data -- name: github.com/tendermint/tmlibs - version: 1b9b5652a199ab0be2e781393fb275b66377309d - subpackages: - - autofile - - cli - - cli/flags - - clist - - common - - db - - flowrate - - log - - merkle - - pubsub - - pubsub/query - - test -- name: golang.org/x/crypto - version: 1875d0a70c90e57f11972aefd42276df65e895b9 - subpackages: - - curve25519 - - nacl/box - - nacl/secretbox - - openpgp/armor - - openpgp/errors - - poly1305 - - ripemd160 - - salsa20/salsa -- name: golang.org/x/net - version: 2fb46b16b8dda405028c50f7c7f0f9dd1fa6bfb1 - subpackages: - - context - - http2 - - http2/hpack - - idna - - internal/timeseries - - lex/httplex - - trace -- name: golang.org/x/sys - version: 37707fdb30a5b38865cfb95e5aab41707daec7fd - subpackages: - - unix -- name: golang.org/x/text - version: e19ae1496984b1c655b8044a65c0300a3c878dd3 - subpackages: - - secure/bidirule - - transform - - unicode/bidi - - unicode/norm -- name: google.golang.org/genproto - version: 4eb30f4778eed4c258ba66527a0d4f9ec8a36c45 - subpackages: - - googleapis/rpc/status -- name: google.golang.org/grpc - version: 401e0e00e4bb830a10496d64cd95e068c5bf50de - subpackages: - - balancer - - codes - - connectivity - - credentials - - grpclb/grpc_lb_v1/messages - - grpclog - - internal - - keepalive - - metadata - - naming - - peer - - resolver - - stats - - status - - tap - - transport -- name: gopkg.in/yaml.v2 - version: d670f9405373e636a5a2765eea47fac0c9bc91a4 -testImports: -- name: github.com/davecgh/go-spew - version: 346938d642f2ec3594ed81d874461961cd0faa76 - subpackages: - - spew -- name: github.com/fortytw2/leaktest - version: 3b724c3d7b8729a35bf4e577f71653aec6e53513 -- name: github.com/pmezard/go-difflib - version: 792786c7400a136282c1664665ae0a8db921c6c2 - subpackages: - - difflib -- name: github.com/stretchr/testify - version: 12b6f73e6084dad08a7c6e575284b177ecafbc71 - subpackages: - - assert - - require diff --git a/glide.yaml b/glide.yaml deleted file mode 100644 index 236bd78b6..000000000 --- a/glide.yaml +++ /dev/null @@ -1,63 +0,0 @@ -package: github.com/tendermint/tendermint -import: -- package: github.com/ebuchman/fail-test -- package: github.com/gogo/protobuf - version: ^1.0.0 - subpackages: - - proto -- package: github.com/golang/protobuf - version: ^1.0.0 - subpackages: - - proto -- package: github.com/gorilla/websocket - version: v1.2.0 -- package: github.com/pkg/errors - version: ~0.8.0 -- package: github.com/rcrowley/go-metrics -- package: github.com/spf13/cobra - version: v0.0.1 -- package: github.com/spf13/viper - version: v1.0.0 -- package: github.com/tendermint/abci - version: develop - subpackages: - - client - - example/kvstore - - types -- package: github.com/tendermint/go-crypto - version: 0.4.1 -- package: github.com/tendermint/go-wire - version: 0.7.2 - subpackages: - - data -- package: github.com/tendermint/tmlibs - version: 0.7.0 - subpackages: - - autofile - - cli - - cli/flags - - clist - - common - - db - - flowrate - - log - - merkle - - pubsub - - pubsub/query -- package: golang.org/x/crypto - subpackages: - - nacl/box - - nacl/secretbox - - ripemd160 -- package: google.golang.org/grpc - version: v1.7.3 -testImport: -- package: github.com/fortytw2/leaktest -- package: github.com/go-kit/kit - version: ^0.6.0 - subpackages: - - log/term -- package: github.com/stretchr/testify - subpackages: - - assert - - require diff --git a/scripts/glide/checkout.sh b/scripts/dep_utils/checkout.sh similarity index 54% rename from scripts/glide/checkout.sh rename to scripts/dep_utils/checkout.sh index 4dcc243ca..83b7ee2fb 100644 --- a/scripts/glide/checkout.sh +++ b/scripts/dep_utils/checkout.sh @@ -1,27 +1,25 @@ #! /bin/bash set -u -function parseGlide() { - cat $1 | grep -A1 $2 | grep -v $2 | awk '{print $2}' +function getVendoredVersion() { + dep status | grep "$1" | awk '{print $4}' } # fetch and checkout vendored dep -glide=$1 -lib=$2 +lib=$1 echo "----------------------------------" echo "Getting $lib ..." -go get -t github.com/tendermint/$lib/... +go get -t "github.com/tendermint/$lib/..." -VENDORED=$(parseGlide $glide $lib) -cd $GOPATH/src/github.com/tendermint/$lib +VENDORED=$(getVendoredVersion "$lib") +cd "$GOPATH/src/github.com/tendermint/$lib" || exit MASTER=$(git rev-parse origin/master) if [[ "$VENDORED" != "$MASTER" ]]; then echo "... VENDORED != MASTER ($VENDORED != $MASTER)" echo "... Checking out commit $VENDORED" - git checkout $VENDORED &> /dev/null + git checkout "$VENDORED" &> /dev/null fi - diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh new file mode 100644 index 000000000..56a047efb --- /dev/null +++ b/scripts/dep_utils/parse.sh @@ -0,0 +1,6 @@ +#! /bin/bash +set -euo pipefail + +LIB=$1 + +dep status | grep "$LIB" | awk '{print $4}' diff --git a/scripts/glide/parse.sh b/scripts/glide/parse.sh deleted file mode 100644 index e559c368e..000000000 --- a/scripts/glide/parse.sh +++ /dev/null @@ -1,13 +0,0 @@ -#! /bin/bash - -set +u -if [[ "$GLIDE" == "" ]]; then - GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock -fi -set -u - -set -euo pipefail - -LIB=$1 - -cat $GLIDE | grep -A1 $LIB | grep -v $LIB | awk '{print $2}' diff --git a/scripts/glide/status.sh b/scripts/glide/status.sh deleted file mode 100644 index 40503dbda..000000000 --- a/scripts/glide/status.sh +++ /dev/null @@ -1,47 +0,0 @@ -#! /bin/bash - -# for every github.com/tendermint dependency, warn is if its not synced with origin/master - -if [[ "$GLIDE" == "" ]]; then - GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock -fi - -# make list of libs -LIBS=($(grep "github.com/tendermint" $GLIDE | awk '{print $3}')) - - -UPTODATE=true -for lib in "${LIBS[@]}"; do - # get vendored commit - VENDORED=`grep -A1 $lib $GLIDE | grep -v $lib | awk '{print $2}'` - PWD=`pwd` - cd $GOPATH/src/$lib - MASTER=`git rev-parse origin/master` - HEAD=`git rev-parse HEAD` - cd $PWD - - if [[ "$VENDORED" != "$MASTER" ]]; then - UPTODATE=false - echo "" - if [[ "$VENDORED" != "$HEAD" ]]; then - echo "Vendored version of $lib differs from origin/master and HEAD" - echo "Vendored: $VENDORED" - echo "Master: $MASTER" - echo "Head: $HEAD" - else - echo "Vendored version of $lib differs from origin/master but matches HEAD" - echo "Vendored: $VENDORED" - echo "Master: $MASTER" - fi - elif [[ "$VENDORED" != "$HEAD" ]]; then - echo "" - echo "Vendored version of $lib matches origin/master but differs from HEAD" - echo "Vendored: $VENDORED" - echo "Head: $HEAD" - fi -done - -if [[ "$UPTODATE" == "true" ]]; then - echo "All vendored versions up to date" -fi - diff --git a/scripts/glide/update.sh b/scripts/glide/update.sh deleted file mode 100644 index 1c0936f28..000000000 --- a/scripts/glide/update.sh +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash -set -euo pipefail -IFS=$'\n\t' - -# script to update the given dependency in the glide.lock file with the checked out branch on the local host - -LIB=$1 - -TMCORE=$GOPATH/src/github.com/tendermint/tendermint -set +u -if [[ "$GLIDE" == "" ]]; then - GLIDE=$TMCORE/glide.lock -fi -set -u - -OLD_COMMIT=`bash $TMCORE/scripts/glide/parse.sh $LIB` - -PWD=`pwd` -cd $GOPATH/src/github.com/tendermint/$LIB - -NEW_COMMIT=$(git rev-parse HEAD) - -cd $PWD - -uname -a | grep Linux > /dev/null -if [[ "$?" == 0 ]]; then - # linux - sed -i "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE -else - # mac - sed -i "" "s/$OLD_COMMIT/$NEW_COMMIT/g" $GLIDE -fi diff --git a/scripts/install_abci_apps.sh b/scripts/install_abci_apps.sh index b2c0b085b..bd16dfa6c 100644 --- a/scripts/install_abci_apps.sh +++ b/scripts/install_abci_apps.sh @@ -3,11 +3,11 @@ go get -d github.com/tendermint/abci # get the abci commit used by tendermint -COMMIT=`bash scripts/glide/parse.sh abci` +COMMIT=$(bash scripts/dep_utils/parse.sh abci) echo "Checking out vendored commit for abci: $COMMIT" -cd $GOPATH/src/github.com/tendermint/abci -git checkout $COMMIT -glide install -go install ./cmd/... +cd "$GOPATH/src/github.com/tendermint/abci" || exit +git checkout "$COMMIT" +make get_vendor_deps +make install diff --git a/test/test_libs.sh b/test/test_libs.sh index 0a8485340..27ab27496 100644 --- a/test/test_libs.sh +++ b/test/test_libs.sh @@ -1,25 +1,20 @@ #! /bin/bash set -e -# set glide.lock path -if [[ "$GLIDE" == "" ]]; then - GLIDE=$GOPATH/src/github.com/tendermint/tendermint/glide.lock -fi - -# get vendored commit for given lib +# Get the parent directory of where this script is. +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done +DIR="$( cd -P "$( dirname "$SOURCE" )/.." && pwd )" #################### # libs we depend on #################### # All libs should define `make test` and `make get_vendor_deps` -LIBS_TEST=(tmlibs go-wire go-crypto abci) - -DIR=$(pwd) -for lib in "${LIBS_MAKE_TEST[@]}"; do - +LIBS=(tmlibs go-wire go-crypto abci) +for lib in "${LIBS[@]}"; do # checkout vendored version of lib - bash scripts/glide/checkout.sh "$GLIDE" "$lib" + bash scripts/dep_utils/checkout.sh "$lib" echo "Testing $lib ..." cd "$GOPATH/src/github.com/tendermint/$lib" From e01650f21de148c89c3bacf979becbaa2de52452 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 27 Feb 2018 18:01:56 +0400 Subject: [PATCH 3/7] fix Dockerfile.develop --- DOCKER/Dockerfile.develop | 1 + 1 file changed, 1 insertion(+) diff --git a/DOCKER/Dockerfile.develop b/DOCKER/Dockerfile.develop index 5431b6a1c..e6ee6607e 100644 --- a/DOCKER/Dockerfile.develop +++ b/DOCKER/Dockerfile.develop @@ -18,6 +18,7 @@ RUN mkdir -p /go/src/github.com/tendermint/tendermint && \ cd /go/src/github.com/tendermint/tendermint && \ git clone https://github.com/tendermint/tendermint . && \ git checkout develop && \ + make get_tools && \ make get_vendor_deps && \ make install && \ cd - && \ From 0821384ac6b5f546e1e0ab728ff78a63cc3a6efb Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 27 Feb 2018 18:34:32 +0400 Subject: [PATCH 4/7] update abci version --- Gopkg.lock | 7 +++---- Gopkg.toml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 015f9a07b..b032f23c0 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -229,12 +229,11 @@ "client", "example/code", "example/counter", - "example/dummy", + "example/kvstore", "server", "types" ] - revision = "68592f4d8ee34e97db94b7a7976b1309efdb7eb9" - version = "v0.10.0" + revision = "345a5a5a34aa31ad00626266f59e4ae7652ee274" [[projects]] branch = "master" @@ -370,6 +369,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "fab03bd603ce6dc3139527674dcc4a5625e5ff81c6caafee4975b338daef696f" + inputs-digest = "402db24a8ce0cac835f1d0d3c40d4066d57660acac43b647066d94913bfc3efc" solver-name = "gps-cdcl" solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml index c468d75fa..875b84a4d 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -71,7 +71,7 @@ [[constraint]] name = "github.com/tendermint/abci" - version = "0.10.0" + revision = "345a5a5a34aa31ad00626266f59e4ae7652ee274" [[constraint]] name = "github.com/tendermint/go-crypto" From 66354de219165b3c5add567dc6ada9c347071d30 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Tue, 27 Feb 2018 18:47:53 +0400 Subject: [PATCH 5/7] cd into tendermint before calling `dep status` --- scripts/dep_utils/checkout.sh | 2 ++ scripts/dep_utils/parse.sh | 2 ++ scripts/install_abci_apps.sh | 5 ++--- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/scripts/dep_utils/checkout.sh b/scripts/dep_utils/checkout.sh index 83b7ee2fb..941fb5166 100644 --- a/scripts/dep_utils/checkout.sh +++ b/scripts/dep_utils/checkout.sh @@ -2,7 +2,9 @@ set -u function getVendoredVersion() { + cd "$GOPATH/src/github.com/tendermint/tendermint" || exit dep status | grep "$1" | awk '{print $4}' + cd - || exit } diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh index 56a047efb..adaf82ecf 100644 --- a/scripts/dep_utils/parse.sh +++ b/scripts/dep_utils/parse.sh @@ -1,6 +1,8 @@ #! /bin/bash set -euo pipefail +cd "$GOPATH/github.com/tendermint/tendermint" || exit + LIB=$1 dep status | grep "$LIB" | awk '{print $4}' diff --git a/scripts/install_abci_apps.sh b/scripts/install_abci_apps.sh index bd16dfa6c..eb70070df 100644 --- a/scripts/install_abci_apps.sh +++ b/scripts/install_abci_apps.sh @@ -1,13 +1,12 @@ #! /bin/bash -go get -d github.com/tendermint/abci - # get the abci commit used by tendermint COMMIT=$(bash scripts/dep_utils/parse.sh abci) - echo "Checking out vendored commit for abci: $COMMIT" +go get -d github.com/tendermint/abci cd "$GOPATH/src/github.com/tendermint/abci" || exit git checkout "$COMMIT" +make get_tools make get_vendor_deps make install From c19bbb2403a4ec438288b64b2c0babf2a8e70e05 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 28 Feb 2018 11:15:40 +0400 Subject: [PATCH 6/7] switch back to parsing .lock file --- scripts/dep_utils/checkout.sh | 11 ++++++++--- scripts/dep_utils/parse.sh | 11 ++++++++--- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/dep_utils/checkout.sh b/scripts/dep_utils/checkout.sh index 941fb5166..02b23d048 100644 --- a/scripts/dep_utils/checkout.sh +++ b/scripts/dep_utils/checkout.sh @@ -1,10 +1,15 @@ #! /bin/bash + +set +u +if [[ "$DEP" == "" ]]; then + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock +fi +set -u + set -u function getVendoredVersion() { - cd "$GOPATH/src/github.com/tendermint/tendermint" || exit - dep status | grep "$1" | awk '{print $4}' - cd - || exit + grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2 } diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh index adaf82ecf..290cab559 100644 --- a/scripts/dep_utils/parse.sh +++ b/scripts/dep_utils/parse.sh @@ -1,8 +1,13 @@ #! /bin/bash -set -euo pipefail -cd "$GOPATH/github.com/tendermint/tendermint" || exit +set +u +if [[ "$DEP" == "" ]]; then + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock +fi +set -u + +set -euo pipefail LIB=$1 -dep status | grep "$LIB" | awk '{print $4}' +grep -A100 "$LIB" "$DEP" | grep revision | head -n1 | grep -o '"[^"]\+"' | cut -d '"' -f 2 From 2ae87eee4eb9fed545df6418d70b2327d61dfe20 Mon Sep 17 00:00:00 2001 From: Anton Kaliaev Date: Wed, 28 Feb 2018 12:24:26 +0400 Subject: [PATCH 7/7] style fixes from @xla --- CONTRIBUTING.md | 8 ++++---- scripts/dep_utils/checkout.sh | 3 ++- scripts/dep_utils/parse.sh | 3 ++- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c725e9f60..5fd2d982f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,9 +43,9 @@ software. Since some dependencies are not under our control, a third party may break our build, in which case we can fall back on `dep ensure` (or `make -get_vendor_deps`). Even for dependencies under our control, dep helps us keeps -multiple repos in sync as they evolve. Anything with an executable, such as -apps, tools, and the core, should use dep. +get_vendor_deps`). Even for dependencies under our control, dep helps us to +keep multiple repos in sync as they evolve. Anything with an executable, such +as apps, tools, and the core, should use dep. Run `dep status` to get a list of vendored dependencies that may not be up-to-date. @@ -66,7 +66,7 @@ make test ## Testing -All repos should be hooked up to circle. +All repos should be hooked up to [CircleCI](https://circleci.com/). If they have `.go` files in the root directory, they will be automatically tested by circle using `go test -v -race ./...`. If not, they will need a diff --git a/scripts/dep_utils/checkout.sh b/scripts/dep_utils/checkout.sh index 02b23d048..c88c3e807 100644 --- a/scripts/dep_utils/checkout.sh +++ b/scripts/dep_utils/checkout.sh @@ -2,10 +2,11 @@ set +u if [[ "$DEP" == "" ]]; then - DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock fi set -u + set -u function getVendoredVersion() { diff --git a/scripts/dep_utils/parse.sh b/scripts/dep_utils/parse.sh index 290cab559..e6519efa0 100644 --- a/scripts/dep_utils/parse.sh +++ b/scripts/dep_utils/parse.sh @@ -2,10 +2,11 @@ set +u if [[ "$DEP" == "" ]]; then - DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock + DEP=$GOPATH/src/github.com/tendermint/tendermint/Gopkg.lock fi set -u + set -euo pipefail LIB=$1