Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generate release binaries #285

Merged
merged 6 commits into from
Jun 4, 2020
Merged

Conversation

rolinh
Copy link
Member

@rolinh rolinh commented Jun 4, 2020

See individual commits for details.

rolinh added 4 commits June 4, 2020 11:22
This ensures that the install target does not fail if one runs `make
install` without running `make` prior to that.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
This will allow setting the version in the file name of generated
release binaries

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
When the `release` target is used, release binaries for various
platforms are generated. These binaries are gzip compressed and the
tarball SHA256 checksum is computed. Example:

    $ make release
    $ tree release
    release
    ├── darwin
    │   ├── 386
    │   │   └── hubble
    │   └── amd64
    │       └── hubble
    ├── hubble-v0.7.0-dev-darwin-386.tar.gz
    ├── hubble-v0.7.0-dev-darwin-386.tar.gz.sha256sum
    ├── hubble-v0.7.0-dev-darwin-amd64.tar.gz
    ├── hubble-v0.7.0-dev-darwin-amd64.tar.gz.sha256sum
    ├── hubble-v0.7.0-dev-linux-386.tar.gz
    ├── hubble-v0.7.0-dev-linux-386.tar.gz.sha256sum
    ├── hubble-v0.7.0-dev-linux-amd64.tar.gz
    ├── hubble-v0.7.0-dev-linux-amd64.tar.gz.sha256sum
    └── linux
	├── 386
	│   └── hubble
	└── amd64
	    └── hubble

    6 directories, 12 files

Note: only darwin (macos) and linux are supported at the moment as
hubble lacks windows support.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
@rolinh rolinh requested review from gandro and glibsm June 4, 2020 11:49
Makefile Outdated
for OS in darwin linux; do \
for ARCH in 386 amd64; do \
test -d release/$$OS/$$ARCH|| mkdir -p release/$$OS/$$ARCH; \
env GOOS=$$OS GOARCH=$$ARCH $(GO) build $(if $(GO_TAGS),-tags $(GO_TAGS)) -ldflags "-w -s -X 'github.com/cilium/hubble/pkg.Version=${VERSION}'" -o release/$$OS/$$ARCH/$(TARGET); \
Copy link
Member

Choose a reason for hiding this comment

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

nit: Can we extract a common variable/macro for the build flags (-tags, -w, -s, -X etc)?

Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Member

@gandro gandro left a comment

Choose a reason for hiding this comment

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

Nice work on the Windows support!

rolinh added 2 commits June 4, 2020 14:36
This allows hubble to be built for Windows as well. Note that
`os.Interrupt` is the only signal value that is guaranteed to be present
on all systems (along with `os.Kill`). This means that `unix.SIGTERM`
has been dropped and is no longer handled. This should however be fine
as hubble is now only run as a command-line program and `os.Interrupt`
is the signal that is sent by `ctrl-c`. In effect, this means that users
are still able to interrupt a `hubble observe --follow` command.

Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
Signed-off-by: Robin Hahling <robin.hahling@gw-computing.net>
@rolinh rolinh force-pushed the pr/rolinh/release-binaries branch from 16f0dd8 to 80fb448 Compare June 4, 2020 12:37
@rolinh rolinh requested a review from gandro June 4, 2020 12:42
@michi-covalent michi-covalent self-requested a review June 4, 2020 17:05
@michi-covalent michi-covalent merged commit 2b37304 into master Jun 4, 2020
@michi-covalent michi-covalent deleted the pr/rolinh/release-binaries branch June 4, 2020 17:27
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants