On Mon, 13 Mar 2023 15:51:46 GMT, Alan Bateman <al...@openjdk.org> wrote:

>>> Do you think this cross platform image creation would be relevant/used with 
>>> exploded builds and if so, should I update the PR to address it?
>> 
>> Actually, now that I think about it, this `isJavaBaseFromCurrentPlatform()` 
>> method will get executed even for regular (same platform) image generation. 
>> Which means if the `java.base` module file doesn't end in a `.jmod` 
>> extension then this part of the code can run into 
>> `java.nio.file.NoSuchFileException` . I will generate an exploded build and 
>> see if anything needs to be done.
>
>> Were you thinking of exploded builds? 
> 
> No, the exploded builds don't have the packaged modules so you should get an 
> error like this:
> 
> Error: --module-path is not specified and this runtime image does not contain 
> jmods directory.

I decided to remove the use of hardcoded `.jmod` extension while checking the 
paths. I have updated the PR to use a slightly different technique which 
doesn't require using hardcode file names for determining if this a 
cross-platform image generation.

Manual testing shows that this change continues to work fine when identifying 
cross-platform image generation. Existing automated tests too pass fine for 
same platform image generation.

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

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

Reply via email to