On Mon, 13 Mar 2023 10:26:23 GMT, Jaikiran Pai <j...@openjdk.org> wrote:

>> src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 827:
>> 
>>> 825:                     if (ref instanceof ModuleReferenceImpl modRefImpl
>>> 826:                             && modRefImpl.moduleTarget() != null) {
>>> 827:                         targetPlatform = 
>>> modRefImpl.moduleTarget().targetPlatform();
>> 
>> It might be better to only look for the ModuleTarget attribute when cross 
>> linking. modsPaths.get("java.base") will give you the path to the packaged 
>> module for java.base, getDefaultModulePath() will give you the location of 
>> the packaged modules in the current execution environment. If 
>> getDefaultModulePath() is the parent of the location containing java.base 
>> then it can use the current endianness.
>> 
>> Also just to say that if it would be an error if java.base is not in the 
>> Configuration, same thing if there is no packaged module for java.base.
>
> Hello Alan,
> 
>>  If getDefaultModulePath() is the parent of the location containing 
>> java.base then it can use the current endianness.
> 
> I've now updated this PR to implement this suggestion. The `ModuleTarget` 
> attribute in java.base's `module-info.class` will only be checked if the 
> java.base isn't from the current execution environment's default jmods 
> location.

> Also just to say that if it would be an error if java.base is not in the 
> Configuration, same thing if there is no packaged module for java.base.

I've now added `assert`s to expect this module to be present.

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

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

Reply via email to