Skip to content

make dist for creating binaries and packaging them for distribution#378

Merged
ebuchman merged 4 commits intotendermint:developfrom
melekes:feature/binaries
Jan 28, 2017
Merged

make dist for creating binaries and packaging them for distribution#378
ebuchman merged 4 commits intotendermint:developfrom
melekes:feature/binaries

Conversation

@melekes
Copy link
Contributor

@melekes melekes commented Jan 23, 2017

Preface: if we want to engage more people (not just hardcore devs), I believe we must provide statically compiled binaries for each release. Besides, this could be easily done with Golang.

Story: as a dev, if I just want to try Tendermint (or I am planning to write my app in Java), I don't want to install Golang, I just want brew install tendermint or similar (btw, what do you think about adding Tendermint to brew).

This will fix many issues (https://tendermint.com/intro/getting-started/install):

  1. user don't have to install Golang
  2. user don't have to learn Golang tools (go get)
  3. user won't be having any problems with updated dependencies

Usage

$ make dist

will create binaries for almost all platforms and will package them for distribution. It will also create a tag (e.g. "v0.8.0").

If you've already created a tag, set NOTAG env variable to true:

$ NOTAG=1 make dist

RELEASE could be set explicitly via env variable. Otherwise, the script will try to fetch it from version/version.go

Broken builds

Our code currently does not compile for freebsd/amd64:

--> freebsd/amd64 error: exit status 2
Stderr: # github.com/tendermint/tendermint/vendor/github.com/spf13/pflag
vendor/github.com/spf13/pflag/uint16.go:89: illegal NUL byte
vendor/github.com/spf13/pflag/uint16.go:89: syntax error: illegal character U+0000

and solaris/amd64:

--> solaris/amd64 error: exit status 1
Stderr: vendor/github.com/tendermint/log15/root.go:7:2: no buildable Go source filesin /go/src/github.com/tendermint/tendermint/vendor/github.com/tendermint/log15/term

Example output

==> Results:
total 49M
-rw-r--r-- 1 vagrant vagrant 5.4M Jan 23 11:12 tendermint_0.8.0_darwin_386.zip
-rw-r--r-- 1 vagrant vagrant 5.7M Jan 23 11:12 tendermint_0.8.0_darwin_amd64.zip
-rw-r--r-- 1 vagrant vagrant 6.1K Jan 23 10:51 tendermint_0.8.0_.DS_Store
-rw-r--r-- 1 vagrant vagrant 5.4M Jan 23 11:12 tendermint_0.8.0_freebsd_386.zip
-rw-r--r-- 1 vagrant vagrant 5.2M Jan 23 11:12 tendermint_0.8.0_freebsd_arm.zip
-rw-r--r-- 1 vagrant vagrant 5.4M Jan 23 11:12 tendermint_0.8.0_linux_386.zip
-rw-r--r-- 1 vagrant vagrant 5.6M Jan 23 11:12 tendermint_0.8.0_linux_amd64.zip
-rw-r--r-- 1 vagrant vagrant 5.2M Jan 23 11:12 tendermint_0.8.0_linux_arm.zip
-rw-r--r-- 1 vagrant vagrant 1002 Jan 23 11:12 tendermint_0.8.0_SHA256SUMS
-rw-r--r-- 1 vagrant vagrant 5.4M Jan 23 11:12 tendermint_0.8.0_windows_386.zip
-rw-r--r-- 1 vagrant vagrant 5.6M Jan 23 11:12 tendermint_0.8.0_windows_amd64.zip

What could be done

  1. sign tag with GPG signature (easily done)
  2. sign tendermint_VERSION_SHA256SUMS with GPG signature (easily done)
  3. figure out why our code does not compile for freebsd and solaris, and fix it

Inspiration: https://www.hashicorp.com/security.html

- mute most of the commands
- replace github.com/tendermint/tendermint with just "."
- introduce PACKAGES variable
- delete unused NEWLINE
package version

const Maj = "0"
const Min = "8" // validator set changes, tmsp->abci, app persistence/recovery, BFT-liveness fix
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the best place for such comments? maybe we should create CHANGELOG.md instead?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been keeping the changelog in the release notes on github for every release. Not opposed to also adding them all into a CHANGELOG.md. the comment here is just a rough reference if you're cruising by

@ethanfrey
Copy link
Contributor

I just saw this issue. Yes, I love the idea!

Re outstanding points 1 and 2.

I think the gpg signing should happen outside of the make dist. It can just build stuff, if we want signing, this is a special key kept on a special machine, so we shouldn't make that part of dist, which I may want to do on my own without signing. It would be great to have a second command to do that, maybe make signed-dist, which calls make dist and then gpg signs using the location of a key set in an environment variable???

GPG_KEY=/home/foo/.gpg/tm.key make signed-dist ?

The other question... can we check all of them behave properly to a basic test? I know there are some issues with cgo when cross-compiling, maybe you dealt with that, maybe it is not an issue,but it would be nice to have an integration test.

Also, that is some crazy shell scripting skills. Props!

@melekes
Copy link
Contributor Author

melekes commented Jan 23, 2017

I think the gpg signing should happen outside of the make dist. It can just build stuff, if we want signing, this is a special key kept on a special machine, so we shouldn't make that part of dist, which I may want to do on my own without signing.

or we can have a flag (NOSIGN)

The other question... can we check all of them behave properly to a basic test? I know there are some issues with cgo when cross-compiling, maybe you dealt with that, maybe it is not an issue,but it would be nice to have an integration test.

interesting question! for now, I just disabled cgo (do we have C libraries?) 👿 I have a second laptop with Linux, so I will definitely check that

@ethanfrey
Copy link
Contributor

I think this command would be used more often without signing than with signing. At least pre-1.0. If I want to deploy a develop version onto my testnet, I would like to make dist and then scp. I could add something like that to the (advanced) tutorials as well. But maybe longer term, the signing is the more common use case.

Either way is fine actually. Just aesthetics.

I would also like to add a similar make dist command to basecoin, so that can also be deployed and hosted easily, if it is going to be our ultimate prototype app. Maybe you can help me with that, or just do this, once this PR is finalized and merged? Whichever is easier for you.

@melekes
Copy link
Contributor Author

melekes commented Jan 23, 2017

If I want to deploy a develop version onto my testnet, I would like to make dist and then scp.

hm.. we have make build, which will build a single binary. You can change the desired arch/os by using GOOS and GOARCH env variables: GOOS=windows GOARCH=amd64 make build if cross-compilation is what you want

@ethanfrey
Copy link
Contributor

Okay, then make dist for official releases, and document how to use make build with the flags. Sounds like a good solution.

@ebuchman ebuchman merged commit a388ff1 into tendermint:develop Jan 28, 2017
@ebuchman ebuchman mentioned this pull request Feb 14, 2017
cmwaters pushed a commit that referenced this pull request Feb 11, 2022
* build(deps): bump docker/login-action from 1.10.0 to 1.11.0

Bumps [docker/login-action](https://github.com/docker/login-action) from 1.10.0 to 1.11.0.
- [Release notes](https://github.com/docker/login-action/releases)
- [Commits](docker/login-action@v1.10.0...v1.11.0)

---
updated-dependencies:
- dependency-name: docker/login-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Run the omnibus linter always.

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: M. J. Fromberger <michael.j.fromberger@gmail.com>
troian pushed a commit to akash-network/tendermint that referenced this pull request Mar 11, 2023
…mint#380)

* ci: Remove Buf tokens from workflow (tendermint#378)

* ci: Remove Buf tokens from workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Format proto folder readme to trigger workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
(cherry picked from commit 126f190)

# Conflicts:
#	proto/README.md

* Fix conflict in proto readme

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
Co-authored-by: Thane Thomson <connect@thanethomson.com>
faddat referenced this pull request in notional-labs/tendermint Apr 3, 2023
* ci: Remove Buf tokens from workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Format proto folder readme to trigger workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
adrianbrink pushed a commit to heliaxdev/tendermint that referenced this pull request May 23, 2023
* ci: Remove Buf tokens from workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

* Format proto folder readme to trigger workflow

Signed-off-by: Thane Thomson <connect@thanethomson.com>

---------

Signed-off-by: Thane Thomson <connect@thanethomson.com>
(cherry picked from commit 126f190)

Co-authored-by: Thane Thomson <connect@thanethomson.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants