tendermint / coding

14 stars 10 forks source link

tools/Makefile standard #49

Open jaekwon opened 6 years ago

jaekwon commented 6 years ago

Isolated the tools such that we only need to install glide, then everything else happens from within the tools dir. The binaries are installed in tools/bin after glide install from within the tools dir.

The point is to only require github.com/tendermint/glide, which we control, which becomes the entrypoint to download all other dependencies (including tools).

We can't do it in the project root dir because glide can't deal with multiple glide.yaml files, and there's no way to tell glide to only install the testImports (and there are no "toolImports"). So the only alternative is to put it all in the project root's glide.yaml, but then we end up calling glide install once to download all the vendor deps, and then later we'd end up doing it again, as we like to rm ./vendor upon gen_vendor_deps. So, this is not only more modular (e.g. could be handled as a github submodule perhaps for all projects, and we can put common Makefiles in there), but also more efficient to have two dirs and two glide.yaml files.

https://github.com/cosmos/cosmos-sdk/pull/331

Proposal 1

The proposal is to make this the standard for all of our projects that require tools besides glide. In addition,

Proposal 2

The next person to touch any Makefile should convert over to using this template by copying over the test dir from github.com/cosmos/cosmos-sdk, and also make the Makefile structure more or less conform to the Makefile standard.

melekes commented 6 years ago

👍

Did not know that glide can install binaries to path other than GOPATH/bin. Oh, I see. You're installing them manually by calling go build -o .... I guess it's fine. Could be simplified though using for loop.

zramsay commented 6 years ago

to keep in mind: https://github.com/tendermint/tendermint/blob/381fe19335ba8825e04d1d0fefa5cac709bb7178/test/test_libs.sh#L15