Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add basic jlink smoke test for Temurin #4067

Merged

Conversation

jerboaa
Copy link
Contributor

@jerboaa jerboaa commented Nov 29, 2024

Basically runs jlink --add-modules java.base --output <output> --verbose. This is to ensure that signing of builds don't break the jlink functionality. Especially when linking from the run-time image (JEP 493 in JDK 24+).

@jerboaa
Copy link
Contributor Author

jerboaa commented Nov 29, 2024

Grinder that fails the test on Windows due to #4057 (signing issue):
https://ci.adoptium.net/job/Grinder/11879/

12:48:51  openjdk version "24-beta" 2025-03-18
12:48:51  OpenJDK Runtime Environment Temurin-24+25-202411212006 (build 24-beta+25-ea)
12:48:51  OpenJDK 64-Bit Server VM Temurin-24+25-202411212006 (build 24-beta+25-ea, mixed mode, sharing)
12:48:51  Linking based on the current run-time image
12:48:51  java.base jrt:/java.base (run-time image)
12:48:51  
12:48:51  Providers:
12:48:51    java.base provides java.nio.file.spi.FileSystemProvider used by java.base
12:48:52  Error: c:\jenkins\workspace\Grinder\jdkbinary\j2sdk-image\bin\java.exe has been modified

Grinder that passes the test on Linux (doesn't have the signing issue):
https://ci.adoptium.net/job/Grinder/11882

12:51:48  openjdk version "24-beta" 2025-03-18
12:51:48  OpenJDK Runtime Environment Temurin-24+25-202411212015 (build 24-beta+25-ea)
12:51:48  OpenJDK 64-Bit Server VM Temurin-24+25-202411212015 (build 24-beta+25-ea, mixed mode, sharing)
12:51:48  Linking based on the current run-time image
12:51:48  java.base jrt:/java.base (run-time image)
12:51:48  
12:51:48  Providers:
12:51:48    java.base provides java.nio.file.spi.FileSystemProvider used by java.base
12:51:50  Nov 29, 2024 11:51:49 AM net.adoptium.test.FeatureTests testJlinkJdk11AndBetter
12:51:50  INFO: Basic jlink smoke test passed. Command was: [/home/jenkins/workspace/Grinder/jdkbinary/j2sdk-image/bin/jlink, --add-modules, java.base, --output, java.base-image, --verbose]

Grinder that fails on mac for the same issue as Windows:
https://ci.adoptium.net/job/Grinder/11881/

12:51:34  openjdk version "24-beta" 2025-03-18
12:51:34  OpenJDK Runtime Environment Temurin-24+25-202411212003 (build 24-beta+25-ea)
12:51:34  OpenJDK 64-Bit Server VM Temurin-24+25-202411212003 (build 24-beta+25-ea, mixed mode, sharing)
12:51:34  Linking based on the current run-time image
12:51:34  java.base jrt:/java.base (run-time image)
12:51:34  
12:51:34  Providers:
12:51:34    java.base provides java.nio.file.spi.FileSystemProvider used by java.base
12:51:34  Error: /Users/admin/workspace/workspace/Grinder/jdkbinary/j2sdk-image/Contents/Home/bin/keytool has been modified

@jerboaa
Copy link
Contributor Author

jerboaa commented Nov 29, 2024

@andrew-m-leonard This should be a basic test that you could use for the build changes that we need. FYI.

Copy link
Member

@sxa sxa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note to any other reviewers: I got a bit nervous when the git view seemed to indicate you'd changed

import org.testng.annotations.BeforeTest;
import org.testng.annotations.Test;

to

import static org.testng.Assert.assertEquals;
import static org.testng.Assert.assertTrue;

But the originals have just been moved, so there are only additions to the imports here.

Approving on the basis that the tests results from the Grinders look like they're doing what is required :-)

If we haven't already got them we should possibly also ensure that Grinders run clean on the 24+23 builds (before the changes assiciated with the JEP went in) and a jdk11u to make sure they're ok with "good" builds on the range of versions we support.

@jerboaa
Copy link
Contributor Author

jerboaa commented Nov 29, 2024

Grinder pipeline for JDK 21, 17, 11, 23 - Linux, Windows, Mac:
https://ci.adoptium.net/blue/organizations/jenkins/Grinder/detail/Grinder/11883/pipeline

@jerboaa
Copy link
Contributor Author

jerboaa commented Nov 29, 2024

The windows result on JDK 17 for example looks like this:

15:17:39  openjdk version "17.0.14-beta" 2025-01-21
15:17:39  OpenJDK Runtime Environment Temurin-17.0.14+4-202411202319 (build 17.0.14-beta+4-ea)
15:17:39  OpenJDK 64-Bit Server VM Temurin-17.0.14+4-202411202319 (build 17.0.14-beta+4-ea, mixed mode, sharing)
15:17:40  java.base file:///c:/jenkins/workspace/Grinder/jdkbinary/j2sdk-image/jmods/java.base.jmod
15:17:40  
15:17:40  Providers:
15:17:40    java.base provides java.nio.file.spi.FileSystemProvider used by java.base
15:17:40    java.base provides java.util.random.RandomGenerator used by java.base
15:17:43  Nov 29, 2024 2:17:42 PM net.adoptium.test.FeatureTests testJlinkJdk11AndBetter
15:17:43  INFO: Basic jlink smoke test passed. Command was: [c:/jenkins/workspace/Grinder/jdkbinary/j2sdk-image/bin/jlink, --add-modules, java.base, --output, java.base-image, --verbose]

Copy link
Contributor

@andrew-m-leonard andrew-m-leonard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@jerboaa
Copy link
Contributor Author

jerboaa commented Dec 3, 2024

Thanks. I'll leave this for @andrew-m-leonard to merge when he thinks it's a good time. E.g. when a fix for #4057 is available too.

@sxa
Copy link
Member

sxa commented Dec 3, 2024

Thanks. I'll leave this for @andrew-m-leonard to merge when he thinks it's a good time. E.g. when a fix for #4057 is available too.

Yes I guess we shouldn't merge this until 4057 is resolved too otherwise the smoke tests will fail for 24 and no other testing will run (Although maybe that's a good thing for one EA cycle? ;-) I'll also leave it to @andrew-m-leonard to decide)

@karianna karianna marked this pull request as draft December 5, 2024 07:10
@karianna
Copy link
Contributor

karianna commented Dec 5, 2024

Putting into draft to avoid accidental early merge

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Dec 9, 2024

Dual signing and post build signing fix:adoptium/ci-jenkins-pipelines#1157
Build: https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk/job/jdk-windows-x64-temurin/388/artifact/workspace/target/
Grinder with this SmokeTest: https://ci.adoptium.net/job/Grinder/12006/ - SUCCESS

@jerboaa
Copy link
Contributor Author

jerboaa commented Dec 9, 2024

Dual signing and post build signing fix:adoptium/ci-jenkins-pipelines#1157

Nice work! So it didn't require any changes to the signing setup pre-jlink after all. Just skip the signing step after. Nice.

Build: https://ci.adoptium.net/job/build-scripts/job/jobs/job/jdk/job/jdk-windows-x64-temurin/388/artifact/workspace/target/ Grinder with this SmokeTest: https://ci.adoptium.net/job/Grinder/12006/ - SUCCESS

Confirmed!

13:39:47  Linking based on the current run-time image
13:39:47  java.base jrt:/java.base (run-time image)
13:39:47  
13:39:47  Providers:
13:39:47    java.base provides java.nio.file.spi.FileSystemProvider used by java.base
13:39:50  Dec 09, 2024 12:39:49 PM net.adoptium.test.FeatureTests testJlinkJdk11AndBetter
13:39:50  INFO: Basic jlink smoke test passed. Command was: [c:/jenkins/workspace/Grinder/jdkbinary/j2sdk-image/bin/jlink, --add-modules, java.base, --output, java.base-image, --verbose]
13:39:50  Dec 09, 2024 12:39:50 PM net.adoptium.test.FeatureTests testLinkableRuntimeJDK24Plus
13:39:50  INFO: Matched 'Capabilities:' line: Linking from run-time image enabled
[...]
13:39:50  PASSED: testJlinkJdk11AndBetter
13:39:50  PASSED: testLinkableRuntimeJDK24Plus

Do you have a Grinder run for mac as well?

@andrew-m-leonard
Copy link
Contributor

@jerboaa

Do you have a Grinder run for mac as well?

Seems a problem with Orka not provisioning currently...

@andrew-m-leonard
Copy link
Contributor

andrew-m-leonard commented Dec 11, 2024

Created new fix that handles Mac libjli.dylib problem.
Grinders:

@jerboaa
Copy link
Contributor Author

jerboaa commented Dec 11, 2024

Created new fix that handles Mac libjli.dylib problem.

Well done! Where is the new fix that handles the above?

@andrew-m-leonard
Copy link
Contributor

Created new fix that handles Mac libjli.dylib problem.

Well done! Where is the new fix that handles the above?

For review please @jerboaa #4083

@jerboaa jerboaa force-pushed the add-basic-jlink-smoke-test branch from 45671c8 to d844a53 Compare December 11, 2024 10:08
Basically runs `jlink --add-modules java.base --output <output>
--verbose`. This is to ensure that signing of builds don't break the
jlink functionality. Especially when linking from the run-time image
(JEP 493 in JDK 24+).
@jerboaa jerboaa force-pushed the add-basic-jlink-smoke-test branch from d844a53 to 55d74ae Compare December 11, 2024 10:31
@andrew-m-leonard andrew-m-leonard self-assigned this Dec 11, 2024
@andrew-m-leonard andrew-m-leonard marked this pull request as ready for review December 11, 2024 15:39
@andrew-m-leonard
Copy link
Contributor

#4083 now merged

@andrew-m-leonard andrew-m-leonard merged commit bf70b81 into adoptium:master Dec 11, 2024
10 checks passed
@jerboaa
Copy link
Contributor Author

jerboaa commented Dec 11, 2024

Thanks, Andrew!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants