Browse Source

ditch glide

pull/1250/head
Anton Kaliaev 6 years ago
parent
commit
8dd06cf197
No known key found for this signature in database GPG Key ID: 7B6881D965918214
15 changed files with 69 additions and 419 deletions
  1. +21
    -7
      CONTRIBUTING.md
  2. +0
    -1
      DOCKER/Dockerfile.develop
  3. +1
    -2
      Makefile
  4. +4
    -4
      docs/abci-cli.rst
  5. +4
    -4
      docs/getting-started.rst
  6. +14
    -14
      docs/install.rst
  7. +0
    -206
      glide.lock
  8. +0
    -63
      glide.yaml
  9. +7
    -9
      scripts/dep_utils/checkout.sh
  10. +6
    -0
      scripts/dep_utils/parse.sh
  11. +0
    -13
      scripts/glide/parse.sh
  12. +0
    -47
      scripts/glide/status.sh
  13. +0
    -32
      scripts/glide/update.sh
  14. +5
    -5
      scripts/install_abci_apps.sh
  15. +7
    -12
      test/test_libs.sh

+ 21
- 7
CONTRIBUTING.md View File

@ -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


+ 0
- 1
DOCKER/Dockerfile.develop View File

@ -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


+ 1
- 2
Makefile View File

@ -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


+ 4
- 4
docs/abci-cli.rst View File

@ -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 <https://github.com/golang/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:


+ 4
- 4
docs/getting-started.rst View File

@ -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 <https://github.com/golang/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


+ 14
- 14
docs/install.rst View File

@ -9,7 +9,7 @@ To download pre-built binaries, see the `Download page <https://tendermint.com/d
From Source
-----------
You'll need ``go``, maybe ``glide``, and the Tendermint source code.
You'll need ``go``, maybe `dep <https://github.com/golang/dep>`__, 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
^^^


+ 0
- 206
glide.lock View File

@ -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

+ 0
- 63
glide.yaml View File

@ -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

scripts/glide/checkout.sh → scripts/dep_utils/checkout.sh View File


+ 6
- 0
scripts/dep_utils/parse.sh View File

@ -0,0 +1,6 @@
#! /bin/bash
set -euo pipefail
LIB=$1
dep status | grep "$LIB" | awk '{print $4}'

+ 0
- 13
scripts/glide/parse.sh View File

@ -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}'

+ 0
- 47
scripts/glide/status.sh View File

@ -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

+ 0
- 32
scripts/glide/update.sh View File

@ -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

+ 5
- 5
scripts/install_abci_apps.sh View File

@ -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

+ 7
- 12
test/test_libs.sh View File

@ -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"


Loading…
Cancel
Save