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

Toolchains needs a way to distinguish between the new Oracle GraalVM and GraalVM CE distributions #25521

Open
sschuberth opened this issue Jun 27, 2023 · 4 comments
Labels
a:feature A new functionality in:toolchains Java Toolchains

Comments

@sschuberth
Copy link
Contributor

sschuberth commented Jun 27, 2023

Expected Behavior

When requiring GraalVM as a JVM implementation, I expect to be able to choose between the Oracle GraalVM and GraalVM CE distributions (which differ in the license).

Current Behavior (optional)

Gradle currently only offers JvmVendorSpec.GRAAL_VM, but actually the vendor of the new "Oracle GraalVM" distribution is java.vendor = Oracle Corporation, so JvmVendorSpec.GRAAL_VM cannot be used to select "Oracle GraalVM".

Context

I'm trying to add "Oracle GraalVM" / newly-versioned "GraalVM CE" support in the context of gradle/foojay-toolchains#31 and am struggling with how to distinguish between those two (in the same release version).

My proposal would be to also add GRAAL_VM to JvmImplementation to be able to implement a mapping like

JvmVendorSpec JvmImplementation Distribution
GRAAL_VM (any) "GraalVM CE"
ORACLE GRAAL_VM "Oracle GraalVM"
ORACLE (any) (any non-GraalVM from Oracle)
@sschuberth sschuberth added a:feature A new functionality to-triage labels Jun 27, 2023
@sschuberth
Copy link
Contributor Author

FYI @fniephaus, @melix.

@sschuberth
Copy link
Contributor Author

sschuberth commented Jun 27, 2023

This issue basically is a follow-up to an earlier comment of mine as the situation now changed and using JvmVendor alone is not enough anymore to distinguish GraalVM distributions.

@fniephaus
Copy link

It seems that GRAAL_VM only matches GraalVM CE at the moment:

So that means it has never worked with GraalVM Enterprise Edition nor does it currently work with the new Oracle GraalVM.

I'm not sure adding GraalVM to JvmImplementation is the best solution because it's a JDK (even though you get SubstrateVM when you compile with Native Image). Maybe treating native-image as some sort of JDK capability, similar to JavaFX, may be the better approach. BTW: setup-java calls this "packaging variant", Disco API has a dedicated javafx_bundled property.

Note that we plan to drop gu soon, so there will no longer be a way to extend GraalVM JDKs with additional capabilities. For that, we are moving to Maven dependencies (see for example here).

@jbartok jbartok added in:toolchains Java Toolchains and removed to-triage labels Jun 28, 2023
@jbartok
Copy link
Member

jbartok commented Jun 28, 2023

Thank you for your interest in Gradle!

This feature request is in the backlog of the relevant team, but this area of Gradle is currently not a focus one, so it might take a while before it gets implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:feature A new functionality in:toolchains Java Toolchains
Projects
None yet
Development

No branches or pull requests

3 participants