-
Notifications
You must be signed in to change notification settings - Fork 4
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
support --generate-cds-archive for Java 22 or higher? #34
Comments
Another point to keep in mind is that we no longer will produce new Java 20 JRE because it's EOL. So only LTS versions (11, 17, 21) and Java 23 (until EOL) and higher right now... There is currently a problem with Java 24 since +23: |
Yes, then the compare pattern could be, to support Java 21+: if [[ $java_version =~ ^[2-9][1-9]+(.[0-9]+(.[0-9]+)?)?$ ]]; then
Yes, Java 30 will be missed out, but it will be some 3+ years before we start worrying about it. But I don't know how to handle the LTS versions of 11 and 17, though. Perhaps via multiple if [[ $java_version =~ ^[1][1,7]+(.[0-9]+(.[0-9]+)?)?$ || $java_version =~ ^[2-9][1-9]+(.[0-9]+(.[0-9]+)?)?$ ]]; then |
A complete compare pattern can be, for all Java 11, 17 and 21+ (including Java 30): if [[ $java_version =~ ^[1][1,7]+(.[0-9]+(.[0-9]+)?)?$ || \
$java_version =~ ^[2][1-9]+(.[0-9]+(.[0-9]+)?)?$ || \
$java_version =~ ^[3-9][0-9]+(.[0-9]+(.[0-9]+)?)?$ ]]; then |
I'm not a shell expert... It would be nice just to pull out the major version number and treat it like a number that we can compare to another number... https://unix.stackexchange.com/questions/232384/argument-string-to-integer-in-bash |
If you only need the Java major version number greater than 20, the regex will be simpler: major_version_regex="^([0-9]+)"
if [[ $java_version =~ $major_version_regex ]] && (( 10#${BASH_REMATCH[1]} > 20 )); then
generate_cds_archive="--generate-cds-archive"
fi |
I created this little test script:
It prints these results:
This seems simple and readable. I will change the actual script this weekend when I have time. |
I simplified the logic; I haven't tested yet. For other cases, I wonder if we might initialize variables like this in some places, e.g.,
This way an environment variable can be set outside the script to determine the desired value, otherwise it's computed as the default value currently. In any case, I'm not sure at this point what exactly you want to change further... |
Yes, it does no harm, and it may help in overriding the default value when/if needed.
I've provided some comment in your above commit bec1c33, regarding other vendors' JDKs (other than Temurin's), about the possible OpenJ9 JVM in them. |
FYI, I tested on Windows x64 the following:
I'm not so happy with overlapping vendor prefixes which was only done historically to make it easy to switch from openjdk URLs to adoptium URL without changing the bundle symbolic names. But environment variables can be used to override the default. |
Using the latest from master, I've tested similar JDKs on my Linux x64 box: export JDK_URLS_LINUX="https://github.com/ibmruntimes/semeru21-binaries/releases/download/jdk-21.0.5%2B11_openj9-0.48.0/ibm-semeru-open-jdk_x64_linux_21.0.5_11_openj9-0.48.0.tar.gz \
https://corretto.aws/downloads/latest/amazon-corretto-21-x64-linux-jdk.tar.gz \
https://github.com/adoptium/temurin24-binaries/releases/download/jdk-24%2B23-ea-beta/OpenJDK-jdk_x64_linux_hotspot_24_23-ea.tar.gz \
https://download.oracle.com/java/23/latest/jdk-23_linux-x64_bin.tar.gz"
./build-jre.sh and I've encountered some errors:
I'm not sure what we can do about this JDK, apart from considering it an "edge case" to be ignored for now.
So I consider this Oracle-provided JDK as another "edge case" to be ignored for now. Anyway, thanks @merks for all your help. Last question: is there some task/goal in the existing Maven build script to generate the JREs and then create the p2 repo for them at the same time? |
It seems odd that they would name the folder in the windows zip different from the one in the tar.gz: This job does everything: https://ci.eclipse.org/justj/job/build-jres/ It uses this: https://github.com/eclipse-justj/justj/blob/master/releng/org.eclipse.justj.releng/Jenkinsfile It will be helpful to read this: https://eclipse.dev/justj/?page=developer The builds involves producing a manifest for the results of build-jre.sh https://download.eclipse.org/justj/jres/21/downloads/20241101_1100/justj.manifest This is then used/reuse in the generation step to generate the maven structure used to drive the build of the p2 update sites. |
Something like this could get the root name from the tar file:
Or this the root of the zip:
And then hope all the OSes produce the expected results from such a script... |
The issue with the folder name in the archive should be working now too, at least as far as I've tested in on Windows and in the build https://ci.eclipse.org/justj/job/build-jres/ (The build is failing because of signing problems on Windows and MacOs for Java 24+26.) |
I've re-run my script for Linux and it works now for the Amazon JDK (thanks for your hard work!), but still fails for the Oracle-provided JDK: https://download.oracle.com/java/23/latest/jdk-23_linux-x64_bin.tar.gz, as it works out the uncompressed JDK folder name wrongly:
where the correct folder name should have been:
I think it's due to this line:
Something's screwy there, but as I said before, it's an "edge case" to be ignored for now. |
- The tar file might not include folder names but only file names. Fixes #34
It looks like that tar file doesn't include folder names but only file names. Stripping out
|
According to the comments here in
build-jre.sh
script, Java 22 or higher would support the--generate-cds-archive
option ofjlink
:justj/releng/org.eclipse.justj.releng/build-jre.sh
Lines 274 to 275 in a6e5c31
But then in line 289:
justj/releng/org.eclipse.justj.releng/build-jre.sh
Line 289 in a6e5c31
as well as line 298:
justj/releng/org.eclipse.justj.releng/build-jre.sh
Line 298 in a6e5c31
the pattern to compare
$java_version
seems wrong, i.e. the compare pattern should be valid for Java 22+:Also, for JDKs which are not from Temurin, e.g. IBM Semeru JDKs, the current code to handle them:
justj/releng/org.eclipse.justj.releng/build-jre.sh
Lines 293 to 301 in a6e5c31
doesn't handle OpenJ9 JVM like that of the Temurin's, i.e. the code should be like:
I've got a PR for the above changes ready to submit, if the above issues are considered valid and acceptable.
The text was updated successfully, but these errors were encountered: