On Fri, 14 Nov 2025 16:00:43 GMT, Henry Jen <[email protected]> wrote:
>> This PR include build changes from @magicus and jlink change to verify the
>> build signature.
>>
>> Tested with local builds for MacOS and Linux as below shows that cross
>> linking with same build is working while linking with different build failed
>> with error message.
>>
>> ❯ export
>> JAVA_HOME=./build/macosx-x86_64-server-fastdebug/images/jdk-bundle/jdk-26.jdk/Contents/Home
>>
>>
>>
>> ❯ java --version
>> openjdk 26-internal 2026-03-17
>> OpenJDK Runtime Environment (fastdebug build
>> 26-internal-adhoc.hjen.JDK-8347831)
>> OpenJDK 64-Bit Server VM (fastdebug build
>> 26-internal-adhoc.hjen.JDK-8347831, mixed mode, sharing)
>>
>>
>>
>> ❯ jlink --version
>>
>> 26-internal
>>
>>
>>
>> ❯ jlink --module-path ./build/linux-x86_64-server-release/images/jdk/jmods
>> --add-modules java.base --output linux
>>
>>
>>
>>
>>
>> ❯ jlink --add-modules java.base --output macos
>>
>> ❯ jlink --module-path ~/linux/jdk-25.0.1/jmods --add-modules java.base
>> --output linux25
>> Error: jlink build N/A-26-internal-adhoc.hjen.JDK-8347831-2026-03-17 does
>> not match target java.base build N/A
>>
>>
>>
>> ❯ jlink --module-path
>> /Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home/jmods
>> --add-modules java.base --output macos25
>> Error: jlink build N/A-26-internal-adhoc.hjen.JDK-8347831-2026-03-17 does
>> not match target java.base build N/A
>
> Henry Jen has updated the pull request incrementally with one additional
> commit since the last revision:
>
> adapt review feedbacks
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/JlinkTask.java line 259:
> 257:
> 258: try (var r = new BufferedReader(new
> InputStreamReader(release.get()))) {
> 259: return Optional.of(r.readLine());
As suggested on the CSR we should read the entire file, not just the first line
and treat the entire content as a string in a specific encoding. While I wasn't
able to get the JDK build a vendor name with new lines (due to jrt-fs.jar
putting `COMPANYNAME` in the MANIFEST.MF) it's conceivable that some
`release.txt` file might have more than one line.
Alternatively we need to specify that the file must not contain line breaks or
unusual encodings.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/28155#discussion_r2541860576