RFR: 8347755: Support static library in jmod [v4]
Alan Bateman
alanb at openjdk.org
Thu Mar 6 16:50:16 UTC 2025
On Thu, 6 Mar 2025 15:18:55 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:
>> The idea is without static lib, it's essential the same as the old format, using the old version so that old tools can be used if static is not included.
>
> I thought the idea was that the jmod format was left intentionally undefined, to not think you could rely on anything else than the corresponding JDK tools to process it? That would mean backwards compatibility should not be a concern.
(Just to be clear, this is about the JMOD format, not the jimage format. The jimage format is JDK internal and we are free to change it from release to release, even build to build, without compatibility concerns.)
You are right that the JMOD format is not documented but care is required when rev'ing the format because there are JDK tools that produce and consume this format. It should be possible for a project to produce a module in JMOD format with the `jmod` tool from JDK N, and put the package module on the module path when creating a run-time image with JDK N+1 `jlink`. So what Henry has looks right. It means the `jmod` tool will produce a 1.0 format when creating a package module that doesn't have static libs, and a JMOD in the new format when the module has static libs. This seems preferable to adding a `--release` option.
-------------
PR Review Comment: https://git.openjdk.org/leyden/pull/46#discussion_r1983719080
More information about the leyden-dev
mailing list