Skip to content

Commit

Permalink
Fix cross compile (go-gitea#10952)
Browse files Browse the repository at this point in the history
* Fix cross compile

* Add test for cross compile

* Fix drone

* Fix drone

* Also prevent CC environment not to generate

Co-authored-by: zeripath <[email protected]>
  • Loading branch information
lunny and zeripath authored Apr 5, 2020
1 parent baadb51 commit 686850e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
15 changes: 15 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ steps:
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
depends_on: [lint-backend]

- name: build-backend-arm64
pull: always
image: golang:1.14
environment:
GO111MODULE: on
GOPROXY: off
GOOS: linux
GOARCH: arm64
TAGS: bindata
commands:
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
- make build # test cross compile
- rm ./gitea # clean
depends_on: [lint-backend]

- name: build-backend-386
pull: always
image: golang:1.14
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ backend: go-check generate $(EXECUTABLE)

.PHONY: generate
generate: $(TAGS_PREREQ)
$(GO) generate -mod=vendor -tags '$(TAGS)' $(GO_PACKAGES)
CC= GOOS= GOARCH= $(GO) generate -mod=vendor -tags '$(TAGS)' $(GO_PACKAGES)

$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
$(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
Expand Down

0 comments on commit 686850e

Please sign in to comment.