adoptium / temurin-build

Eclipse Temurin™ build scripts - common across all releases/versions
Apache License 2.0
1.03k stars 249 forks source link

[JDK 24] Enable JEP 493 in Temurin 24 builds #4035

Open jerboaa opened 3 days ago

jerboaa commented 3 days ago

Description

JEP 493 has this summary:

Reduce the size of the JDK by approximately 25% by enabling the jlink tool
to create custom run-time images without using the JDK's JMOD files. This
feature must be enabled when the JDK is built; it will not be enabled by
default, and some JDK vendors may choose not to enable it.

Proposal

Add --enable-linkable-runtime to Temurin 24 builds so as to enable this feature. It only affects users running jlink so as to produce custom runtimes. The nice property would be that the Temurin 24 JDK would ship without jmods directory by default. In order to cover cases where a link from the run-time image is not suitable I suggest to also package the jmods image as a separate artefact (like testimage, static-libs and friends) and make those available for each build via the API for users actually needing them.

Pros

By default, the Temurin 24 JDK download shrinks in size without any restrictions in terms of run-time needs. jlink users should be able to use it to link custom runtimes.

Cons

Certain use-cases might not be possible. For example, cross linking, linking from a modified runtime. See JEP 493 for details. For those users there would be the option to download the jmods artefact separately and get the same features as JDK 23+ had.

sxa commented 3 days ago

Test build (locked) with the parameter enabled is at https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk/job/jdk-linux-aarch64-temurin/380 if anyone wants to play

judovana commented 3 days ago

The jmods (like testimage, static-libs and friends) should be also separate rpms subpkg.

jerboaa commented 3 days ago

The jmods (like testimage, static-libs and friends) should be also separate rpms subpkg.

Please file this in https://github.com/adoptium/installer/issues Thanks!

judovana commented 3 days ago

https://github.com/adoptium/installer/issues/1050

jerboaa commented 2 days ago

Agreed to enable this for JDK 24 at the PMC meeting on Wednesday Nov. 13. For now we won't package the jmods image, which might change if there is user-demand.

sxa commented 2 days ago

Quick point of note - this is all documented somewhere but we do have multiple options for where such options can be set:

jerboaa commented 2 days ago

Thanks!

jerboaa commented 1 day ago

PR enabling this option is here: https://github.com/adoptium/temurin-build/pull/4039

jerboaa commented 1 day ago

PR enabling this option is here: #4039

I'm working on added smoke tests for this. Any build with it should have this output in jlink --help

$ ./jdk-24+23/bin/jlink --help | tail -n2
Capabilities:
      Linking from run-time image enabled
jerboaa commented 1 day ago

PR with a smoke test is here: #4040