Skip to content

Commit 686850e

Browse files
lunnyzeripath
andauthored
Fix cross compile (#10952)
* 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]>
1 parent baadb51 commit 686850e

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

.drone.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,21 @@ steps:
5151
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
5252
depends_on: [lint-backend]
5353

54+
- name: build-backend-arm64
55+
pull: always
56+
image: golang:1.14
57+
environment:
58+
GO111MODULE: on
59+
GOPROXY: off
60+
GOOS: linux
61+
GOARCH: arm64
62+
TAGS: bindata
63+
commands:
64+
- curl -sL https://deb.nodesource.com/setup_12.x | bash - && apt -y install nodejs
65+
- make build # test cross compile
66+
- rm ./gitea # clean
67+
depends_on: [lint-backend]
68+
5469
- name: build-backend-386
5570
pull: always
5671
image: golang:1.14

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ backend: go-check generate $(EXECUTABLE)
481481

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

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

0 commit comments

Comments
 (0)