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 toolchain to gradle config file #149

Merged
merged 1 commit into from
Jan 12, 2023
Merged

Add toolchain to gradle config file #149

merged 1 commit into from
Jan 12, 2023

Conversation

dsyer
Copy link
Contributor

@dsyer dsyer commented Dec 12, 2022

This could probably be improved, but it looks to me like it might be needed to persuade the JDT Language Server (used by Eclipse and VSCode) to build the project cleanly.

In VSCode you have to import one of the test projects into the workspace (probably the same in Eclipse). If you do that before this change the build will fail and you won't be able to use the Java language features in the IDE.

With this change if you run with Java 17, but not the GraalVM edition:

$ ./gradlew clean test -Pcoordinates=io.netty:netty-common:4.1.80.Final

> Configure project :
GraalVM Reachability Metadata TCK
---------------------------------

> Task :test-io.netty-netty-common-4.1.80.Final
====================
Testing library: io.netty:netty-common:4.1.80.Final
Command: `/workspaces/graalvm-reachability-metadata/gradlew nativeTest`
Executing test...
-------
Command: [/workspaces/graalvm-reachability-metadata/gradlew, nativeTest]
Starting a Gradle Daemon, 4 busy and 4 incompatible and 6 stopped Daemons could not be reused, use --status for details
> Task :tck-build-logic:extractPluginRequests UP-TO-DATE
> Task :tck-build-logic:generatePluginAdapters UP-TO-DATE
> Task :tck-build-logic:compileJava UP-TO-DATE
> Task :tck-build-logic:compileGroovy UP-TO-DATE
> Task :tck-build-logic:compileGroovyPlugins UP-TO-DATE
> Task :tck-build-logic:pluginDescriptors UP-TO-DATE
> Task :tck-build-logic:processResources UP-TO-DATE
> Task :tck-build-logic:classes UP-TO-DATE
> Task :tck-build-logic:jar UP-TO-DATE
> Task :compileJava NO-SOURCE
> Task :processResources NO-SOURCE
> Task :classes UP-TO-DATE

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileTestJava'.
> Error while evaluating property 'javaCompiler' of task ':compileTestJava'
   > Failed to calculate the value of task ':compileTestJava' property 'javaCompiler'.
      > No compatible toolchains found for request filter: {languageVersion=17, vendor=GRAAL_VM, implementation=vendor-specific} (auto-detect true, auto-download true)
...

Without this change it just fails with no indication of how to fix it.

This could probably be improved, but it looks to me like it might
be needed to persuade the JDT Language Server (used by Eclipse and
VSCode) to build the project cleanly.
@dsyer
Copy link
Contributor Author

dsyer commented Dec 12, 2022

Fixes #147

@melix
Copy link
Member

melix commented Dec 14, 2022

Unfortunately I think this PR may become the root of other strange issues for users. In particular, using vendor=GRAAL_VM will only work for GraalVM Community Edition. So it means builds would start to fail locally for those using GraalVM EE (or potentially other VMs like Liberica). This is caused by a limitation in Gradle. I'm not quite sure how to reconcile the needs in Eclipse JDT and this :/

@dsyer
Copy link
Contributor Author

dsyer commented Dec 14, 2022

It actually doesn’t work with the Liberica build already. That was one of the reasons I added the vendor label.

@melix
Copy link
Member

melix commented Dec 15, 2022

It actually doesn’t work with the Liberica build already. That was one of the reasons I added the vendor label.

Indeed it seems it works because the vendor reported by Liberica is GraalVM.

@vjovanov vjovanov requested a review from melix January 10, 2023 16:53
Copy link
Member

@melix melix left a comment

Choose a reason for hiding this comment

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

So we can merge this, but it means that folks trying to make it work with EE will have to manually tweak the build.

@vjovanov
Copy link
Member

So we can merge this, but it means that folks trying to make it work with EE will have to manually tweak the build.

CC @dnestoro

@vjovanov vjovanov merged commit 2919636 into oracle:master Jan 12, 2023
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.

None yet

3 participants