mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-27 02:10:40 +00:00
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 <art27@cantab.net>
This commit is contained in:
parent
baadb51445
commit
686850e21f
2 changed files with 16 additions and 1 deletions
15
.drone.yml
15
.drone.yml
|
@ -51,6 +51,21 @@ steps:
|
||||||
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
- go build -mod=vendor -o gitea_no_gcc # test if build succeeds without the sqlite tag
|
||||||
depends_on: [lint-backend]
|
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
|
- name: build-backend-386
|
||||||
pull: always
|
pull: always
|
||||||
image: golang:1.14
|
image: golang:1.14
|
||||||
|
|
2
Makefile
2
Makefile
|
@ -481,7 +481,7 @@ backend: go-check generate $(EXECUTABLE)
|
||||||
|
|
||||||
.PHONY: generate
|
.PHONY: generate
|
||||||
generate: $(TAGS_PREREQ)
|
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)
|
$(EXECUTABLE): $(GO_SOURCES) $(TAGS_PREREQ)
|
||||||
$(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
$(GO) build -mod=vendor $(GOFLAGS) $(EXTRA_GOFLAGS) -tags '$(TAGS)' -ldflags '-s -w $(LDFLAGS)' -o $@
|
||||||
|
|
Loading…
Reference in a new issue