Opened 3 years ago

Closed 3 years ago

#63908 closed defect (fixed)

bazel @4.2.1_0 install error: `module java.base does not "opens java.lang" to unnamed module`

Reported by: flwyd (Trevor Stone) Owned by:
Priority: Normal Milestone:
Component: ports Version: 2.7.1
Keywords: Cc: missa-prime (Mohamed Issa), cjones051073 (Chris Jones)
Port: bazel

Description

Running port install bazel on macOS Mojave 10.14.6 fails with an error.

bazel crashed due to an internal error. Printing stack trace:
:info:build java.lang.ExceptionInInitializerError
:info:build     at com.google.devtools.build.lib.actions.ParameterFile.writeContent(ParameterFile.ja
va:118)
:info:build     at com.google.devtools.build.lib.actions.ParameterFile.writeParameterFile(ParameterF
ile.java:111)
…
:info:build Caused by: java.lang.reflect.InaccessibleObjectException: Unable to make java.lang.String(byte[],byte) accessible: module java.base does not "opens java.lang" to unnamed module @647c3190
:info:build     at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:354)

Attachments (1)

bazel-main.log (2.0 MB) - added by flwyd (Trevor Stone) 3 years ago.
install log: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/main.log

Change History (7)

Changed 3 years ago by flwyd (Trevor Stone)

Attachment: bazel-main.log added

install log: /opt/local/var/macports/logs/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_devel_bazel/bazel/main.log

comment:1 Changed 3 years ago by cjones051073 (Chris Jones)

Yeah, i am aware the bazel port, which provides the most recent version has some trouble on old systems.

https://ports.macports.org/port/bazel/details/

I suggest in the meantime if you dont need the very latest, try one of the older sub-ports, like bazel-3.7

comment:2 Changed 3 years ago by Chris Jones <jonesc@…>

In c58a730be064ba434f2fedb8acc6d5773eacdd66/macports-ports (master):

bazel: require only openjdk11
Seems to have issues with newer versions
See: #63908

comment:3 Changed 3 years ago by cjones051073 (Chris Jones)

Out of interest, what openjdk ports do you have installed ? bazel currently requires openjdk11 or newer, but I have a suspicion it doesn't like the very newest versions. I had openjdk17 installed and bazel failed to build for me, on macOS12, using that, but seems to be OK with openjdk11 (the main one tested).

comment:4 Changed 3 years ago by flwyd (Trevor Stone)

% port installed | grep jdk
  openjdk17 @17_0 (active)
  openjdk17-temurin @17_0
  openjdk17-temurin @17.0.1_0 (active)

I noticed in the attached log file that it was using openjdk17, but there was a set of "fetching @remotejdk11_macos" lines shortly above the exception.

comment:5 Changed 3 years ago by cjones051073 (Chris Jones)

yes, that fetch is normal... try again with openjdk11

comment:6 Changed 3 years ago by cjones051073 (Chris Jones)

Resolution: fixed
Status: newclosed

ooenjdk11 worked for me via above commit, so closing. Please report back if you still have issues.

Note: See TracTickets for help on using tickets.