Skip to content

Commit 3fe89b8

Browse files
authored
Add riscv64 into BAZEL_GOARCH_CONSTRAINTS (#4507)
<!-- Thanks for sending a PR! Before submitting: 1. If this is your first PR, please read CONTRIBUTING.md and sign the CLA first. We cannot review code without a signed CLA. 2. Please file an issue *first*. All features and most bug fixes should have an associated issue with a design discussed and decided upon. Small bug fixes and documentation improvements don't need issues. 3. New features and bug fixes must have tests. Documentation may need to be updated. If you're unsure what to update, send the PR, and we'll discuss in review. 4. Note that PRs updating dependencies and new Go versions are not accepted. Please file an issue instead. --> **What type of PR is this?** Bug fix **What does this PR do? Why is it needed?** Fix some Bazel matching issues on riscv64 **Which issues(s) does this PR fix?** Fixes #4053 **Other notes for review** The riscv64 architecture has been widely developed and adopted recently, and optimizing support for riscv64 is very meaningful as it can provide better riscv64 support for downstream users. For example, when I was using `bazeldnf`, due to some limitations in the current repository, I couldn't use `bazeldnf` directly. The specific reason is this: https://github.com/rmohr/bazeldnf/blob/main/bazeldnf/platforms.bzl. This depends on the current repository's `BAZEL_GOARCH_CONSTRAINTS`, which currently lacks riscv64 support, so the riscv64 version of bazeldnf cannot be used directly. If this PR is merged and released, downstream users will be able to get good riscv64 support. A PR quite similar to this one is #3336. I think the situation with riscv64 is quite similar to that case. The Go upstream also provides good support for riscv64. **Other Info** Co-authored by: [email protected];
1 parent 0b46a62 commit 3fe89b8

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

go/private/mode.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ _LINK_PLUGIN_PLATFORMS = {
105105
"linux/386": None,
106106
"linux/s390x": None,
107107
"linux/ppc64le": None,
108+
"linux/riscv64": None,
108109
"android/amd64": None,
109110
"android/arm": None,
110111
"android/arm64": None,
@@ -122,6 +123,7 @@ _LINK_PIE_PLATFORMS = {
122123
"linux/386": None,
123124
"linux/s390x": None,
124125
"linux/ppc64le": None,
126+
"linux/riscv64": None,
125127
"android/amd64": None,
126128
"android/arm": None,
127129
"android/arm64": None,

go/private/platforms.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ BAZEL_GOARCH_CONSTRAINTS = {
3434
"ppc64": "@platforms//cpu:ppc",
3535
"ppc64le": "@platforms//cpu:ppc64le",
3636
"s390x": "@platforms//cpu:s390x",
37+
"riscv64": "@platforms//cpu:riscv64",
3738
}
3839

3940
GOOS_GOARCH = (

0 commit comments

Comments
 (0)