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

[native-image --version] No way to tell version in use when JDK isn't jlinked nor compiled to binary #6319

Closed
jerboaa opened this issue Mar 30, 2023 · 5 comments · Fixed by #6356

Comments

@jerboaa
Copy link
Collaborator

jerboaa commented Mar 30, 2023

Describe the issue
After #6302 there is no way for us (Mandrel) to tell which codeline is in use based on the native-image --version output. We use the bash launcher (deliberately) and don't jlink the base JDK that is in use (plain OpenJDK).

java.vendor.version is a protected property, which cannot be set on the command line:

$ java -Djava.vendor.version=foo -XshowSettings:properties --version 2>&1 | grep vendor
    java.specification.vendor = Oracle Corporation
    java.vendor = Red Hat, Inc.
    java.vendor.url = https://www.redhat.com/
    java.vendor.url.bug = https://bugzilla.redhat.com/enter_bug.cgi?product=Fedora&component=java-17-openjdk&version=37
    java.vendor.version = (Red_Hat-17.0.6.0.10-1.fc37)
    java.vm.specification.vendor = Oracle Corporation
    java.vm.vendor = Red Hat, Inc.

That means, the new native-image --version output solely contains JDK version properties, which is unfortunate since we cannot tell which code line is in use (23.x or 24.x or...).

Example (of a recent mandrel build from graal master):

$ native-image --version
native-image 20.0.1-internal 2023-04-18
OpenJDK Runtime Environment null (build 20.0.1-internal-adhoc.sgehwolf.jdk20u)
OpenJDK 64-Bit Server VM null (build 20.0.1-internal-adhoc.sgehwolf.jdk20u, mixed mode)
@jerboaa
Copy link
Collaborator Author

jerboaa commented Mar 30, 2023

/cc @fniephaus

@fniephaus fniephaus self-assigned this Mar 30, 2023
jerboaa added a commit to jerboaa/graal that referenced this issue Mar 30, 2023
This allows for the bash launcher to print a sensible `native-image
--version` output. Otherwise it would only contain OpenJDK properties,
which gives no info on the actual code level in use.

Also add the vendor version to the build output as otherwise, the
same issue applies. Only Java version information is present.

Closes: oracle#6319
jerboaa added a commit to jerboaa/graal that referenced this issue Mar 30, 2023
This allows for the bash launcher to print a sensible `native-image
--version` output. Otherwise it would only contain OpenJDK properties,
which gives no info on the actual code level in use.

Also add the vendor version to the build output as otherwise, the
same issue applies. Only Java version information is present.

Closes: oracle#6319
@jerboaa
Copy link
Collaborator Author

jerboaa commented Apr 3, 2023

@fniephaus Would you have any eta for something like this getting integrated? The version change produces a lot of noise in our CI.

@fniephaus
Copy link
Member

I will reach out tomorrow and hope we can merge a fix asap and within the next 48 hours.

@fniephaus fniephaus linked a pull request Apr 4, 2023 that will close this issue
@fniephaus
Copy link
Member

I've just opened #6356 with a more comprehensive fix for this (incl updating the build output infra). PTAL and let me know what you think. Thanks!

@jerboaa
Copy link
Collaborator Author

jerboaa commented Apr 4, 2023

Thank you!

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