Skip to content

Commit

Permalink
Do not use gimme during build
Browse files Browse the repository at this point in the history
Gimme has broken cross-compilation:
travis-ci/gimme#42

Anyway golang now has cross-compilation built-in so we can just use go
build with GOOS and GOARCH environment variables.

Fixes issue where Travis released a linux binary as a darwin binary for
wrench 0.41.0
  • Loading branch information
stanislavb committed Jul 20, 2017
1 parent f069f7a commit e14c583
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
7 changes: 1 addition & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
GO_VERSION = 1.8
NAME = wrench
BUILDDIR = ./ARTIFACTS

Expand All @@ -7,16 +6,12 @@ VERSION = $(shell git describe --tags --match 'v[0-9]*\.[0-9]*\.[0-9]*' | sed 's

###############################################################################
## Building
##
## Travis CI Gimme is used to cross-compile
## https://github.com/travis-ci/gimme
###############################################################################

.PHONY: build build_darwin build_linux
build: build_darwin build_linux

compile = bash -c "eval \"$$(GIMME_GO_VERSION=$(GO_VERSION) GIMME_OS=$(1) GIMME_ARCH=$(2) gimme)\"; \
go build -a \
compile = bash -c "env GOOS=$(1) GOARCH=$(2) go build -a \
-ldflags \"-w -X main.VERSION='$(VERSION)'\" \
-o $(BUILDDIR)/$(NAME)-$(VERSION)-$(1)-$(2)"

Expand Down
6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,6 @@ brew install wrench

## Build

[Travis CI Gimme](https://github.com/travis-ci/gimme) is used to cross-compile wrench.

```
$ brew install gimme
```

```
$ make build
$ make build_darwin
Expand Down

0 comments on commit e14c583

Please sign in to comment.