[riscv][risc-v][riscv64]Cannot build Bazel 7.1.0 on RISC-V 64 (Lichee PI4A)
- Dominant language
- Java
- Stars
- 25.8k
- Forks
- 4.6k
- Avg merge
- 2d 20h
- Merged PRs (30d)
- 72
Description
### Description of the bug:
Hello,
I am running Ubuntu 24.04 stock (riscv64) on the LicheePi 4A.
When trying to build bazel from source (7.1.0), I get an error, as it weirdly tries to build Bazel with Bazel (?) and it fails.
My first question is: why is it trying to build Bazel with Bazel -> `Building Bazel with Bazel`?
Reproduction steps:
```
# download and unzip / cd into bazel-7.1.0-dist.zip
# apt install java 21 jre and jdk
# dpkg --list |grep -i jdk
# ii default-jdk-headless 2:1.21-75+exp1 riscv64 Standard Java or Java compatible Development Kit (headless)
#
# ii libanimal-sniffer-java 1.16-1 all JDK/API verification tools
#ii openjdk-21-jdk:riscv64 21.0.3+9-1ubuntu1 riscv64 OpenJDK Development Kit (JDK)
#ii openjdk-21-jdk-headless:riscv64 21.0.3+9-1ubuntu1 riscv64 OpenJDK Development Kit (JDK) (headless)
#ii openjdk-21-jre:riscv64 21.0.3+9-1ubuntu1 riscv64 OpenJDK Java runtime, using Hotspot JIT
#ii openjdk-21-jre-headless:riscv64 21.0.3+9-1ubuntu1 riscv64 OpenJDK Java runtime, using Hotspot JIT (headless)
env EXTRA_BAZEL_ARGS="--tool_java_runtime_version=local_jdk" bash ./compile.sh
🍃 Building Bazel from scratch......
🍃 Building Bazel with Bazel.
.OpenJDK 64-Bit Server VM warning: Options -Xverify:none and -noverify were deprecated in JDK 13 and will likely be removed in a future release.
INFO: Repository rules_python~~python~pythons_hub instantiated at:
: in
Repository rule hub_repo defined at:
/tmp/bazel_Jag75LiP/out/external/rules_python~/python/extensions/private/pythons_hub.bzl:107:27: in
ERROR: An error occurred during the fetch of repository 'rules_python~~python~pythons_hub':
Traceback (most recent call last):
File "/tmp/bazel_Jag75LiP/out/external/rules_python~/python/extensions/private/pythons_hub.bzl", line 86, column 33, in _hub_repo_impl
platform = get_host_platform(os, arch)
File "/tmp/bazel_Jag75LiP/out/external/rules_python~/python/private/toolchains_repo.bzl", line 325, column 13, in get_host_platform
fail("No platform declared for host OS {} on arch {}".format(os_name, arch))
Error in fail: No platform declared for host OS linux on arch riscv64
ERROR: : fetching hub_repo rule //:rules_python~~python~pythons_hub: Traceback (most recent call last):
File "/tmp/bazel_Jag75LiP/out/external/rules_python~/python/extensions/private/pythons_hub.bzl", line 86, column 33, in _hub_repo_impl
platform = get_host_platform(os, arch)
File "/tmp/bazel_Jag75LiP/out/external/rules_python~/python/private/toolchains_repo.bzl", line 325, column 13, in get_host_platform
fail("No platform declared for host OS {} on arch {}".format(os_name, arch))
Error in fail: No platform declared for host OS linux on arch riscv64
```
### Which category does this issue belong to?
Core
### What's the simplest, easiest way to reproduce this bug? Please provide a minimal example if possible.
_No response_
### Which operating system are you running Bazel on?
_No response_
### What is the output of `bazel info release`?
_No response_
### If `bazel info release` returns `development version` or `(@non-git)`, tell us how you built Bazel.
_No response_
### What's the output of `git remote get-url origin; git rev-parse HEAD` ?
_No response_
### If this is a regression, please try to identify the Bazel commit where the bug was introduced with bazelisk --bisect.
_No response_
### Have you found anything relevant by searching the web?
_No response_
### Any other information, logs, or outputs that you want to share?
_No response_
Contributor guide
Research direction
Start by reproducing the failure with compile.sh and the stated EXTRA_BAZEL_ARGS on Ubuntu 24.04 riscv64. Read the reported rules_python~/python/private/toolchains_repo.bzl path, especially get_host_platform, and trace the hub_repo failure; done means Bazel 7.1.0 builds successfully on linux riscv64 or the unsupported-platform limitation is documented with a focused regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, linux, python, ubuntu
- Domain
- build-system, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100