RFR: 8345259: Disallow ALL-MODULE-PATH without explicit --module-path [v8]
Mandy Chung
mchung at openjdk.org
Mon Dec 16 19:10:39 UTC 2024
On Mon, 16 Dec 2024 18:55:38 GMT, Mandy Chung <mchung at openjdk.org> wrote:
>>> But this would be for a different bug so as to prevent scope-creep.
>>
>> Filed https://bugs.openjdk.org/browse/JDK-8346299 for this.
>
> jlink --add-modules ALL-MODULE-PATH --limit-modules jdk.jfr --module-path jmods --output all-mods-limit-mods.image
>
>
> The set of observable modules only has `java.base` and `jdk.jfr` because of `--limit-modules`. Hence `com.baz.runtime` from `jmods` is not observable. `ALL-MODULE-PATH` adds all observable modules found on the relevant module paths are added to the root set. This matches the run-time behavior.
>
>
> $ java --list-modules -p com.baz.runtime.jar --add-modules ALL-MODULE-PATH --limit-modules jdk.jfr
> java.base at 25-internal
> jdk.jfr at 25-internal
Limiting the observable modules is sometimes useful for testing/debugging and to reduce the number of modules resolved when the main module is the unnamed module.
@AlanBateman Is `--limit-modules` needed at link time?
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22494#discussion_r1887356122
More information about the core-libs-dev
mailing list