Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type #20

Closed
6eanut opened this issue Jul 22, 2024 · 9 comments

Comments

@6eanut
Copy link

6eanut commented Jul 22, 2024

environment:

$ cat /etc/os-release
NAME="openEuler"
VERSION="24.03 (LTS)"
ID="openEuler"
VERSION_ID="24.03"
PRETTY_NAME="openEuler 24.03 (LTS)"
ANSI_COLOR="0;31"
$ uname -a
Linux openeuler-riscv64-worker1 6.6.0 bazelbuild/bazel#1 SMP Tue Jul 2 11:21:06 CST 2024 riscv64 riscv64 riscv64 GNU/Linux

steps:

git clone https://github.com/bazelbuild/bazel.git
cd bazel
git checkout tags/6.1.0
bazel build //src:bazel

bug:

$ bazel build //src:bazel
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
... still trying to connect to local Bazel server after 30 seconds ...
... still trying to connect to local Bazel server after 40 seconds ...
... still trying to connect to local Bazel server after 50 seconds ...
... still trying to connect to local Bazel server after 60 seconds ...
... still trying to connect to local Bazel server after 70 seconds ...
DEBUG: /home/tf/.cache/bazel/_bazel_tf/df2e2a63529870a88d6ad4f4a2babaae/external/build_bazel_rules_nodejs/index.bzl:122:10: WARNING: check_rules_nodejs_version has been removed. This is a no-op, please remove the call.
ERROR: /home/tf/.cache/bazel/_bazel_tf/df2e2a63529870a88d6ad4f4a2babaae/external/bazel_tools/tools/jdk/BUILD:29:19: While resolving toolchains for target @bazel_tools//tools/jdk:current_java_runtime: no matching toolchains found for types @bazel_tools//tools/jdk:runtime_toolchain_type
ERROR: Analysis of target '//src:bazel' failed; build aborted:
INFO: Elapsed time: 239.920s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (186 packages loaded, 1709 targets configured)

@6eanut
Copy link
Author

6eanut commented Jul 22, 2024

hi, i am working on build bazel6.1.0 from source by the way "bazel build bazel".
i have the bazel5.3.0'rpm.
can you give me some advice on this? thanks!

@hexdae
Copy link
Owner

hexdae commented Jul 22, 2024

Hi @6eanut, this repo is meant to cross-compile RISCV code, I think what you are doing is trying to build bazel itself on a RISCV machine? is that possible?

You do not need this repo, bazel is JAVA based so you need to install the Java Development Kit (JDK) on your machine. The error you are seeing seems to be related to the lack of JAVA on the system.

Maybe checkout something like this: https://github.com/openjdk/riscv-port

@6eanut
Copy link
Author

6eanut commented Jul 23, 2024

@hexdae thanks for answering!
yes, i am trying to build bazel6.1.0 by bazel5.3.0 one a risc-v machine.
i have installed the jdk, but i still have the above problem.

$ java -version
openjdk version "11.0.22" 2024-01-16
OpenJDK Runtime Environment Bisheng (build 11.0.22+7)
OpenJDK 64-Bit Server VM Bisheng (build 11.0.22+7, mixed mode, sharing)
$ javac -version
javac 11.0.22

Thank you again for your reply, I am very excited!

@Boring545
Copy link

Boring545 commented Jul 24, 2024

The issues you are encountering may be related to your existing Bazel 5.3. If you follow the tutorial at https://bazel.google.cn/start/cpp and try to use your existing Bazel 5.3 with the example program cpp-tutorial/stage1, you will find that you encounter the same issue as when compiling with Bazel 6.1, specifically being unable to connect to the local Bazel server.

git clone https://github.com/bazelbuild/examples
cd examples/cpp-tutorial/stage1
bazel build //main:hello-world

>>>
Starting local Bazel server and connecting to it...
... still trying to connect to local Bazel server after 10 seconds ...
... still trying to connect to local Bazel server after 20 seconds ...
Illegal instruction (core dumped)

I also tried Bazel binaries provided by others but encountered the same issue.

@Boring545
Copy link

Boring545 commented Jul 24, 2024

sudo lz4 -d /var/lib/systemd/coredump/core.bazel-real.1000.25574d1065b14a3ba592156aff80a295.3453807.1721817570000000.lz4 /var/lib/systemd/coredump/core.bazel-real
sudo gdb /usr/bin/bazel-real /var/lib/systemd/coredump/core.bazel-real
(gdb) bt

>>>
#0  0x0000002ab4623f9e in absl::lts_20211102::base_internal::UnscaledCycleClock::Now() ()
#1  0x0000002ab46237dc in absl::lts_20211102::base_internal::CycleClock::Now() ()
#2  0x0000002ab461f008 in absl::lts_20211102::CondVar::WaitCommon(absl::lts_20211102::Mutex*, absl::lts_20211102::synchronization_internal::KernelTimeout) ()
#3  0x0000002ab460c97c in gpr_cv_wait ()
#4  0x0000002ab45e823c in timer_thread(void*) ()
#5  0x0000002ab460e25a in grpc_core::(anonymous namespace)::ThreadInternalsPosix::ThreadInternalsPosix(char const*, void (*)(void*), void*, bool*, grpc_core::Thread::Options const&)::{lambda(void*)#1}::_FUN(void*) ()
#6  0x0000003f90e538e8 in start_thread () from /usr/lib64/libc.so.6
#7  0x0000003f90e9fd0c in __thread_start_clone3 () from /usr/lib64/libc.so.6

The crash location of Bazel is concentrated in functions related to absl and grpc.
I found some reference information here, https://gitee.com/src-openeuler/bazel/pulls/29

@6eanut
Copy link
Author

6eanut commented Jul 25, 2024

@Boring545 ,hi boring545.
Thank you for your help. I read the bazel official tutorial you provided on building C++ projects, and it helped me in a new way.
I recently built TensorFlow on RISC-V, do you have any relevant experience?

@Boring545
Copy link

Sorry, I don’t have it, but if you make any progress on compiling Bazel, please let me know.

@hexdae
Copy link
Owner

hexdae commented Jul 26, 2024

@6eanut are you ok with closing this issue? It should still be searchable on google for people who have this issue, but we can't fix this problem in the repo.

@6eanut
Copy link
Author

6eanut commented Jul 26, 2024

@hexdae
ok, thanks!

@hexdae hexdae closed this as completed Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants