Open Boring545 opened 2 months ago
I successfully ran the example program using the command:
bazel run //:basic-gazelle --host_platform="@io_bazel_rules_go//go/toolchain:linux_riscv64" --platforms="@io_bazel_rules_go//go/toolchain:linux_riscv64".
Yes, feel free to send a PR adding a new entry to that dictionary.
I am attempting to use
rules_go
and Bazel to compile a Go program on an operating system with aRISC-V
CPU architecture, and I want to use the locally installed Go to compile the example project in rules_go. Unfortunately, when I tried running the test program, I encountered the following issue:After investigating related issues, I found one that closely matches my problem: issue. It was resolved by adding the parameter
"ppc64": "@platforms//cpu:ppc"
toBAZEL_GOARCH_CONSTRAINTS
inrules_go/go/private/platforms.bzl
. Should I do something similar, such as adding"riscv64": "@platforms//cpu:riscv64"
?I also ran the command
bazel run //:basic-gazelle --toolchain_resolution_debug='.*'
, and the output showed:INFO: ToolchainResolution: Type @io_bazel_rules_go//go:toolchain: target platform @local_config_platform//:host: Rejected toolchain @go_sdk//:go_linux_riscv64-impl; mismatching values: riscv64.
Additionally, please note that I have set
go_register_toolchains(go_version = "host")
in theWORKSPACE
file.