google / nearby

🐿️ A collection of projects focused on connectivity that enable building cross-device experiences.
https://developers.google.com/nearby
Apache License 2.0
727 stars 153 forks source link

Build fails (connections, Arch Linux) #2013

Closed alba4k closed 9 months ago

alba4k commented 1 year ago

CC=clang CXX=clang++ bazel build -s --check_visibility=false //connections:core --spawn_strategy=standalone --verbose_failures

Starting local Bazel server and connecting to it...
Server crashed during startup. Now printing /home/alba4k/.cache/bazel/_bazel_alba4k/08dd8884ffe2d5fea3ae4d4b8a6e5ff3/server/jvm.out
Unrecognized option: --add-opens=java.base/java.lang=ALL-UNNAMED
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

Is there anything that I am doing wrong? (I followed the instructions in the relevant README.md.

bazel 6.3.0 up-to-date arch linux system openjre and openjdk 11

bourdakos1 commented 1 year ago

Are you still seeing this issue? Looks like a problem with JVM, but I've never seen this before :/ Maybe try updating java?

alba4k commented 1 year ago

Yes to both

Java is up to date

pacman -Q | grep jre

jre-openjdk 20.0.2.u9-3
jre-openjdk-headless 20.0.2.u9-3
jre11-openjdk 11.0.20.u8-2
jre11-openjdk-headless 11.0.20.u8-2
jre17-openjdk 17.0.8.u7-1
jre17-openjdk-headless 17.0.8.u7-1
jre8-openjdk 8.382.u05-1
jre8-openjdk-headless 8.382.u05-1
pramodhrachuri commented 1 year ago

I too couldn't compile. Got the following error

DEBUG: Rule 'rules_foreign_cc' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "69023642d5781c68911beda769f91fcbc8ca48711db935a75da7f6536b65047f"
DEBUG: Repository rules_foreign_cc instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
  /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
DEBUG: Rule 'com_google_protobuf' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "eaba1dd133ac5167e8b08bc3268b2d33c6e9f2dcb14ec0f97f3d3eed9b395863"
DEBUG: Repository com_google_protobuf instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
  /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
DEBUG: Rule 'com_google_nisaba' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "5fda92e45b05d2d2b327081bcb2406c07b0d2383d311edd0ba840bb3aea307c2"
DEBUG: Repository com_google_nisaba instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
  /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "862cdabb3e81ad644de4c4b65a1c2af03b203942b5e390ca43d21524a2afe655"
DEBUG: Repository com_google_absl instantiated at:
  no stack (--record_rule_instantiation_callstack not enabled)
Repository rule http_archive defined at:
  /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/bazel_tools/tools/build_defs/repo/http.bzl:336:31: in <toplevel>
ERROR: /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/com_google_absl/absl/time/BUILD.bazel:74:8: @com_google_absl//absl/time:time_test: no such attribute 'env' in 'cc_test' rule
ERROR: /home/pramodh/.cache/bazel/_bazel_pramodh/ca66db5ca77facb84646ee62600fc0d9/external/com_google_absl/absl/time/BUILD.bazel:124:8: @com_google_absl//absl/time:time_benchmark: no such attribute 'env' in 'cc_test' rule
ERROR: /home/pramodh/Downloads/nearby/connections/BUILD:16:11: Target '@com_google_absl//absl/time:time' contains an error and its package is in error and referenced by '//connections:core'
ERROR: Analysis of target '//connections:core' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.035s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (0 packages loaded, 0 targets configured)
jorgeajimenezl commented 9 months ago

@alba4k Hi, try with archlinux-java set java-11-openjdk. That happens to me yesterday and I solved just changing the default Java to version 11.

alba4k commented 9 months ago

@jorgeajimenezl seems to work, thanks

Should I close this?

jorgeajimenezl commented 9 months ago

Should I close this?

@alba4k I think you should do it