Skip to content

[close #407] [br-release-1.0] Fix arm64 build#425

Merged
pingyu merged 4 commits intotikv:br-release-1.0from
pingyu:build-arm-rel-10
Apr 17, 2025
Merged

[close #407] [br-release-1.0] Fix arm64 build#425
pingyu merged 4 commits intotikv:br-release-1.0from
pingyu:build-arm-rel-10

Conversation

@pingyu
Copy link
Collaborator

@pingyu pingyu commented Apr 17, 2025

Cherry pick of #406, #408

Additional changes:

  • Set CGO_ENABLED=0 to enable cross platform building. The performance gap is not significant for tikv-br.

What problem does this PR solve?

Issue Number: close #407

Problem Description: ci: Release arm64 artifact failed type/bug

What is changed and how does it work?

  • Change env var GOARCH to TARGET_ARCH, then tools will be built for current arch.

Code changes

Check List for Tests

This PR has been tested by at least one of the following methods:

  • Manual test (add detailed scripts or steps below)
❯ cd br
➜  make release
CGO_ENABLED=0 GOOS= GOARCH= GO111MODULE=on go build -tags codes -ldflags '-X "github.com/tikv/migration/br/pkg/version/build.ReleaseVersion=br-v1.0.1-4-ge8313a7-dirty" -X "github.com/tikv/migration/br/pkg/version/build.BuildTS=2025-04-17 01:54:48" -X "github.com/tikv/migration/br/pkg/version/build.GitHash=e8313a70c5e6b9339b750adbe2d191be3fe6bb77" -X "github.com/tikv/migration/br/pkg/version/build.GitBranch=build-arm-rel-10"' -o bin/tikv-br cmd/br/*.go
➜  TARGET_OS=linux TARGET_ARCH=amd64 make release
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 GO111MODULE=on go build -tags codes -ldflags '-X "github.com/tikv/migration/br/pkg/version/build.ReleaseVersion=br-v1.0.1-4-ge8313a7-dirty" -X "github.com/tikv/migration/br/pkg/version/build.BuildTS=2025-04-17 01:54:54" -X "github.com/tikv/migration/br/pkg/version/build.GitHash=e8313a70c5e6b9339b750adbe2d191be3fe6bb77" -X "github.com/tikv/migration/br/pkg/version/build.GitBranch=build-arm-rel-10"' -o bin/tikv-br cmd/br/*.go
➜  file bin/tikv-br
bin/tikv-br: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, Go BuildID=xGZkqU3iAaB-urvvJiEi/mcTMoYFtuD6odT2ICldH/vq_x00c5-3Orv2WyUJpv/rKf4xrAP_CUllBkJfKHO, not stripped
➜  TARGET_OS=linux TARGET_ARCH=arm64 make release
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 GO111MODULE=on go build -tags codes -ldflags '-X "github.com/tikv/migration/br/pkg/version/build.ReleaseVersion=br-v1.0.1-4-ge8313a7-dirty" -X "github.com/tikv/migration/br/pkg/version/build.BuildTS=2025-04-17 01:55:09" -X "github.com/tikv/migration/br/pkg/version/build.GitHash=e8313a70c5e6b9339b750adbe2d191be3fe6bb77" -X "github.com/tikv/migration/br/pkg/version/build.GitBranch=build-arm-rel-10"' -o bin/tikv-br cmd/br/*.go
➜  file bin/tikv-br
bin/tikv-br: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), statically linked, Go BuildID=7HA2LMPd53NlghEAG7-b/onUuWDLB7NahQzcj3kmE/sz-v97GeDMPNwcRjs5FG/njLi1D04dMv6v7SHj4Gp, not stripped

Side effects

  • No side effects

Related changes

  • No related changes

To reviewers

Please follow these principles to check this pull requests:

  • Concentration. One pull request should only do one thing. No matter how small it is, the change does exactly one thing and gets it right. Don't mix other changes into it.
  • Tests. A pull request should be test covered, whether the tests are unit tests, integration tests, or end-to-end tests. Tests should be sufficient, correct and don't slow down the CI pipeline largely.
  • Functionality. The pull request should implement what the author intends to do and fit well in the existing code base, resolve a real problem for TiDB/TiKV users. To get the author's intention and the pull request design, you could follow the discussions in the corresponding GitHub issue or internal.tidb.io topic.
  • Style. Code in the pull request should follow common programming style. (For Go, we have style checkers in CI). However, sometimes the existing code is inconsistent with the style guide, you should maintain consistency with the existing code or file a new issue to fix the existing code style first.
  • Documentation. If a pull request changes how users build, test, interact with, or release code, you must check whether it also updates the related documentation such as READMEs and any generated reference docs. Similarly, if a pull request deletes or deprecates code, you must check whether or not the corresponding documentation should also be deleted.
  • Performance. If you find the pull request may affect performance, you could ask the author to provide a benchmark result.

(The above text mainly refers to TiDB Development Guide. It's also highly recommended to read about Writing code review comments)

pingyu added 3 commits April 17, 2025 09:35
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
Signed-off-by: Ping Yu <yuping@pingcap.com>
@ti-chi-bot
Copy link

ti-chi-bot bot commented Apr 17, 2025

@pingyu: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-integration-kafka-test ea01468 link true /test pull-integration-kafka-test
pull-integration-test ea01468 link true /test pull-integration-test
pull-unit-test ea01468 link true /test pull-unit-test

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@zeminzhou
Copy link
Contributor

LGTM

@pingyu pingyu merged commit b5bee05 into tikv:br-release-1.0 Apr 17, 2025
10 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants