On 2026/02/02 12:21, Theo Buehler wrote:
> jruby has a file containing the jdk version. whenever the jdk/21 minor
> version changes, jruby no longer packages. I fixed this up a couple of
> times recently but I wonder if there's a better way of handling this.
> 
> At least there should be a comment in jdk/21.

The .jsa file doesn't seem to work correctly anyway.

Firstly it doesn't seem to be picked up automatically, only if you pass
the path via JAVA_OPTS.

Secondly if it is present and used with

JAVA_OPTS="-XX:SharedArchiveFile=/usr/local/jruby/lib/jruby-java21.0.9.jsa"

(adjust as necessary for version), it's tied to a very specific jdk build
- I tried installing the current jruby package with jdk already installed,
and got this

[0.067s][warning][cds] The shared archive file was created by a different 
version or build of HotSpot

Adding -Xlog:cds gave more information:

$ VERIFY_JRUBY=1 
JAVA_OPTS="-XX:SharedArchiveFile=/usr/local/jruby/lib/jruby-java21.0.9.jsa 
-Xlog:cds " time jruby --dev -e 1
[0.063s][info][cds] trying to map /usr/local/jdk-21/lib/server/classes.jsa
[0.063s][info][cds] Opened archive /usr/local/jdk-21/lib/server/classes.jsa.
[0.063s][info][cds] Archive was created with UseCompressedOops = 1, 
UseCompressedClassPointers = 1
[0.063s][info][cds] Core region alignment: 4096
[0.063s][info][cds] trying to map /usr/local/jruby/lib/jruby-java21.0.9.jsa
[0.063s][info][cds] Opened archive /usr/local/jruby/lib/jruby-java21.0.9.jsa.
[0.063s][info][cds] _jvm_ident expected: OpenJDK 64-Bit Server VM (21.0.9+10-1) 
for bsd-amd64 JRE (21.0.9+10-1), built on 2026-01-27T17:33:34Z by "pbuild" with 
clang OpenBSD Clang 19.1.7
[0.064s][info][cds]              actual: OpenJDK 64-Bit Server VM (21.0.9+10-1) 
for bsd-amd64 JRE (21.0.9+10-1), built on 2026-01-30T04:56:02Z by "pbuild" with 
clang OpenBSD Clang 19.1.7
[0.064s][warning][cds] The shared archive file was created by a different 
version or build of HotSpot
[0.064s][info   ][cds] Initialize dynamic archive failed.
<snip>

Even with the matching jdk version for the jsa installed, there seems to
be no difference in startup time anyway.

So at this point I think @comment'ing the jsa file in jruby would not
degrade things and is probably the simplest approach.

Reply via email to