Skip to content

Commit

Permalink
fix: Do not upx pack darwin/arm64 binaries (#311)
Browse files Browse the repository at this point in the history
Bug in upx that should be fixed in 4.0.2
(https://github.com/upx/upx/issues/628\).
  • Loading branch information
jimmidyson authored Jan 12, 2023
1 parent 332815b commit 9f2de10
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 8 deletions.
5 changes: 0 additions & 5 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@ builds:
- arm64
mod_timestamp: '{{ .CommitTimestamp }}'
hooks:
pre:
- cmd: make SKIP_UPX={{ if index .Env "SKIP_UPX" }}{{ .Env.SKIP_UPX }}{{ else }}{{ .IsSnapshot }}{{ end }} go-generate
env:
- GOOS={{ .Os }}
- GOARCH={{ .Arch }}
post:
- cmd: make SKIP_UPX={{ if index .Env "SKIP_UPX" }}{{ .Env.SKIP_UPX }}{{ else }}{{ .IsSnapshot }}{{ end }} GOOS={{ .Os }} GOARCH={{ .Arch }} UPX_TARGET={{ .Path }} upx
archives:
Expand Down
6 changes: 3 additions & 3 deletions make/goreleaser.mk
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ endif

.PHONY: build-snapshot
build-snapshot: ## Builds a snapshot with goreleaser
build-snapshot: dockerauth install-tool.goreleaser ; $(info $(M) building snapshot $*)
build-snapshot: dockerauth install-tool.goreleaser install-tool.golang ; $(info $(M) building snapshot $*)
goreleaser --debug=$(GORELEASER_DEBUG) \
build \
--snapshot \
Expand All @@ -21,7 +21,7 @@ build-snapshot: dockerauth install-tool.goreleaser ; $(info $(M) building snapsh

.PHONY: release
release: ## Builds a release with goreleaser
release: dockerauth install-tool.goreleaser ; $(info $(M) building release $*)
release: dockerauth install-tool.goreleaser install-tool.golang ; $(info $(M) building release $*)
goreleaser --debug=$(GORELEASER_DEBUG) \
release \
--rm-dist \
Expand All @@ -31,7 +31,7 @@ release: dockerauth install-tool.goreleaser ; $(info $(M) building release $*)

.PHONY: release-snapshot
release-snapshot: ## Builds a snapshot release with goreleaser
release-snapshot: dockerauth install-tool.goreleaser ; $(info $(M) building snapshot release $*)
release-snapshot: dockerauth install-tool.goreleaser install-tool.golang ; $(info $(M) building snapshot release $*)
goreleaser --debug=$(GORELEASER_DEBUG) \
release \
--snapshot \
Expand Down
3 changes: 3 additions & 0 deletions make/upx.mk
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ upx: UPX_REAL_TARGET := $(addsuffix $(if $(filter $(GOOS),windows),.exe),$(basen
ifneq ($(SKIP_UPX),true)
ifeq ($(GOOS)/$(GOARCH),windows/arm64)
upx: ; $(info $(M) skipping packing $(UPX_REAL_TARGET) - $(GOOS)/$(GOARCH) is not yet supported by upx)
# TODO Remove once upx 4.0.2 is released
else ifeq ($(GOOS)/$(GOARCH),darwin/arm64)
upx: ; $(info $(M) skipping packing $(UPX_REAL_TARGET) - $(GOOS)/$(GOARCH) has a bug in packing - https://github.com/upx/upx/issues/628 - should be fixed in 4.0.2)
else
upx: install-tool.upx
upx: ## Pack executable using upx
Expand Down

0 comments on commit 9f2de10

Please sign in to comment.