Skip to content

Commit b5bee05

Browse files
authored
[close #407] [br-release-1.0] Fix arm64 build (#425)
Signed-off-by: Ping Yu <yuping@pingcap.com>
1 parent 3071814 commit b5bee05

File tree

3 files changed

+14
-6
lines changed

3 files changed

+14
-6
lines changed

.github/workflows/release_version.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ on:
1414
description: git ref
1515
required: true
1616

17+
env:
18+
GO_VERSION: 1.18.1
19+
1720
jobs:
1821
release:
1922
runs-on: ubuntu-latest
@@ -29,13 +32,14 @@ jobs:
2932
- "linux"
3033
arch:
3134
- "amd64"
35+
- "arm64"
3236
env:
3337
working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
3438
steps:
35-
- name: Set up Go 1.18.1
39+
- name: Set up Go
3640
uses: actions/setup-go@v2
3741
with:
38-
go-version: 1.18.1
42+
go-version: '${{ env.GO_VERSION }}'
3943
id: go
4044

4145
- name: Check out code into the Go module directory
@@ -70,6 +74,8 @@ jobs:
7074
run: |
7175
export GOPATH=${GITHUB_WORKSPACE}/go
7276
export PATH=$PATH:$GOPATH/bin
77+
export TARGET_OS=${{ matrix.os }}
78+
export TARGET_ARCH=${{ matrix.arch }}
7379
if [ ! -z ${{ steps.check_staging.outputs.STAGING }} ]; then
7480
export REL_VER=${{ steps.check_staging.outputs.STAGING }}+staging
7581
else

br/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ tools/bin/failpoint-ctl: tools/check/go.mod
8585
cd tools/check && $(GO) build -o ../bin/failpoint-ctl github.com/pingcap/failpoint/failpoint-ctl
8686

8787
build:
88-
CGO_ENABLED=1 $(GO) build -tags codes -gcflags "all=-N -l" -ldflags '$(LDFLAGS)' -o $(BR_BIN_PATH) cmd/br/*.go
88+
CGO_ENABLED=0 $(GO) build -tags codes -gcflags "all=-N -l" -ldflags '$(LDFLAGS)' -o $(BR_BIN_PATH) cmd/br/*.go
8989

9090
release:
91-
CGO_ENABLED=1 $(GO) build -tags codes -ldflags '$(LDFLAGS)' -o $(BR_BIN_PATH) cmd/br/*.go
91+
CGO_ENABLED=0 GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) $(GO) build -tags codes -ldflags '$(LDFLAGS)' -o $(BR_BIN_PATH) cmd/br/*.go
9292

9393
build/rawkv-integration-test:
9494
cd tests/rawkv && $(GO) build -mod=mod -o ../../bin/rawkv_test *.go

cdc/Makefile

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,9 @@ ifeq (${CDC_ENABLE_VENDOR}, 1)
1919
GOVENDORFLAG := -mod=vendor
2020
endif
2121

22-
GOBUILD := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) -trimpath $(GOVENDORFLAG)
22+
BUILD_FLAG := -buildvcs=false
23+
24+
GOBUILD := CGO_ENABLED=0 GOOS=$(TARGET_OS) GOARCH=$(TARGET_ARCH) $(GO) build $(BUILD_FLAG) -trimpath $(GOVENDORFLAG)
2325
GOBUILD_DEBUG := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) -gcflags "all=-N -l" $(GOVENDORFLAG)
2426
GOBUILDNOVENDOR := CGO_ENABLED=0 $(GO) build $(BUILD_FLAG) -trimpath
2527
GOTEST := CGO_ENABLED=1 $(GO) test -p $(P) --race
@@ -43,7 +45,7 @@ FAILPOINT_DISABLE := $$(echo $(FAILPOINT_DIR) | xargs $(FAILPOINT) disable >/dev
4345

4446
RELEASE_VERSION =
4547
ifeq ($(RELEASE_VERSION),)
46-
RELEASE_VERSION := v1.0.0-master
48+
RELEASE_VERSION := v1.0-master
4749
release_version_regex := ^cdc-v[0-9]\..*$$
4850
release_branch_regex := "^cdc-[0-9]\.[0-9].*$$|^HEAD$$|^.*/*tags/cdc-v[0-9]\.[0-9]\..*$$"
4951
ifneq ($(shell git rev-parse --abbrev-ref HEAD | egrep $(release_branch_regex)),)

0 commit comments

Comments
 (0)