Integrated: 8345185: Update jpackage to not include service bindings by default

Severin Gehwolf sgehwolf at openjdk.org
Mon Jan 13 09:29:53 UTC 2025


On Mon, 9 Dec 2024 12:57:22 GMT, Severin Gehwolf <sgehwolf at openjdk.org> wrote:

> Please review these changes to jpackage in light of [JEP 493](https://openjdk.org/jeps/493). When this feature is enabled, then some of the `jpackage` tests fail. The failures fall into the following categories:
> 
> - `ALL-DEFAULT` notion from `jpackage` which includes all modules that export an API, which includes `jdk.jlink`, which is prevented from being included when linking from the run-time image (see the [JEP 493](https://openjdk.org/jeps/493) restrictions). The proposal is to change module resolution from `Configuration.resolveAndBind()` to `Configuration.resolve()`. I.e. don't perform service binding which is in line what [JEP 392](https://openjdk.org/jeps/392) and [JEP 343](https://openjdk.org/jeps/343) claim. That is, this patch brings the implementation aligned to what it says on the JEPs
> - `ALL-MODULE-PATH` changes: `BasicTest.java` verifies the `--add-modules` argument to `jpackage`. Using `ALL-MODULE-PATH` for JDK modules won't be supported for JEP 493-enabled builds. So I've changed this test to skip the test using `ALL-MODULE-PATH` when we have such an enabled build. Other tests, such as `RuntimeImageTest.java` and `RuntimeImageSymbolicLinksTest.java` tests verify something else not related to `ALL-MODULE-PATH` or `--add-modules`. It seems more appropriate to use the smaller set of modules to use for the runtime JDK image.
> - `JLinkOptionsTest.java`: That test verifies options passed to `jlink` via the `ToolProvider` API. For some reason, it uses `--bind-services` extensively and that - in turn - and, when not limited with the `--limit-modules` option as well, will include `jdk.jlink` in the resulting image, again running afoul the JEP 493 restriction of not allowing `jdk.jlink` for now. I propose to use suitable options including `--limit-modules` which would then no longer include `jdk.jlink` in the runtime image and the link from a run-time image works as well. These changes depend on [JDK-8345573](https://bugs.openjdk.org/browse/JDK-8345573) for it to work fully.
> 
> Testing:
> - [x] GHA
> - [x] running tests in `test/jdk/tools/jpackage` on a JEP 493 enabled JDK. As far as I could see the failures that I was seeing weren't any more related to JEP 493 (some RPM requirements showing up that it didn't expect to). 
> 
> Thoughts? Opinions?

This pull request has now been integrated.

Changeset: 85ed78c0
Author:    Severin Gehwolf <sgehwolf at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/85ed78c063493259247d88f5ca51b47b7a45fcb0
Stats:     60 lines in 7 files changed: 36 ins; 11 del; 13 mod

8345185: Update jpackage to not include service bindings by default

Reviewed-by: asemenyuk

-------------

PR: https://git.openjdk.org/jdk/pull/22644


More information about the core-libs-dev mailing list