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

Auto-provisioning/auto-detection of IBM Semeru toolchains is broken with Gradle 7.6 #23053

Closed
simon-spinner opened this issue Dec 8, 2022 · 5 comments
Assignees
Labels
a:regression This used to work in:toolchains Java Toolchains
Milestone

Comments

@simon-spinner
Copy link

simon-spinner commented Dec 8, 2022

Expected Behavior

Build works with gradle 7.5.1 and jdks are auto provisioned as declared in build.gradle:

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(11))
        vendor = JvmVendorSpec.IBM_SEMERU
        implementation = JvmImplementation.J9
    }
}

Current Behavior

Upgrading to gradle 7.6 the build now fails with:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':buildSrc:compileGroovy'.
> Could not resolve all dependencies for configuration ':buildSrc:compileClasspath'.
   > Failed to calculate the value of task ':buildSrc:compileJava' property 'javaCompiler'.
      > Unable to download toolchain matching the requirements ({languageVersion=11, vendor=IBM_SEMERU, implementation=J9}) from 'https://api.adoptopenjdk.net/v3/binary/latest/11/ga/linux/x64/jdk/openj9/normal/adoptopenjdk'.
         > Toolchain provisioned from 'https://api.adoptopenjdk.net/v3/binary/latest/11/ga/linux/x64/jdk/openj9/normal/adoptopenjdk' doesn't satisfy the specification: {languageVersion=11, vendor=IBM_SEMERU, implementation=J9}.

Context

Auto-detection/auto-provisioning of Gradle toolchains is broken with gradle 7.6

Steps to Reproduce

Your Environment

Detected toolchains:

❯ ./gradlew -q javaToolchains

 + Options
     | Auto-detection:     Enabled
     | Auto-download:      Enabled

 + IBM JDK 11.0.17+8
     | Location:           ~/.gradle/jdks/ibm-semeru-open-jdk_x64_linux_11/jdk-11.0.17+8
     | Language Version:   11
     | Vendor:             IBM
     | Architecture:       amd64
     | Is JDK:             true
     | Detected by:        Auto-provisioned by Gradle

 + IBM JDK 11.0.15+10
     | Location:           ~/.gradle/jdks/ibm_semeru-11-x64-openj9-linux/jdk-11.0.15+10
     | Language Version:   11
     | Vendor:             IBM
     | Architecture:       amd64
     | Is JDK:             true
     | Detected by:        Auto-provisioned by Gradle
@jbartok jbartok self-assigned this Dec 9, 2022
@jbartok jbartok added a:regression This used to work and removed a:bug labels Dec 9, 2022
@jbartok jbartok added this to the 7.6.1 milestone Dec 9, 2022
@jbartok jbartok added in:toolchains Java Toolchains and removed to-triage labels Dec 9, 2022
@jbartok
Copy link
Member

jbartok commented Dec 9, 2022

Is caused by the fact that the IBM Semeru JVMs for Java 11 provide the wrong metadata/vendor system property after minor version 14... Checking if we can work around it somehow.

image

@AdamBrousseau
Copy link

AdamBrousseau commented Dec 12, 2022

@jbartok could you please provide clarity on your previous statement? I don't quite understand where you/Gradle are getting Vendor: IBM Semeru Runtimes from. Perhaps it is a value set by Gradle or SDKMAN?
When we released 11.0.15 this year (2022) we corrected the java.vendor property back to IBM Corporation. I don't believe we have any system properties that are set to IBM Semeru Runtimes. I could be missing something.

Thanks,
Adam

Edit: I see now from the fix. Thanks.

bot-gradle added a commit that referenced this issue Dec 15, 2022
…eru runtimes (backport)

Fixes #23053

It doesn't make sense to have both the IBM and IBM_SEMERU vendor values.

Co-authored-by: József Bartók <jbartok@gradle.com>
@EdGue42
Copy link

EdGue42 commented Dec 15, 2022

@jbartok

I assume this means that one of the next nightly builds could be used for verifying your changes?

@jbartok
Copy link
Member

jbartok commented Dec 18, 2022

@jbartok

I assume this means that one of the next nightly builds could be used for verifying your changes?

Yes, https://gradle.org/release-nightly/ should contain the fix (but this is a nightly for the upcoming 8.0 version).
7.6.1 should contain the fix too, but I don't see any nightlies available for that atm. Let me know if the above mentioned nightly is not ok for you to test with.

@EdGue42
Copy link

EdGue42 commented Dec 19, 2022

I changed my build setup to use jdk-11.0.17+8 and then pointed to gradle-8.0-20221216001954:

JAVA_HOME=/Users/xxxx/java/ibm/jdk-11.0.17+8/Contents/Home ./gradlew -q javaToolchain

  • Options
    | Auto-detection: Enabled
    | Auto-download: Enabled

  • IBM JDK 11.0.17+8
    | Location: /Users/guenthne/java/ibm/jdk-11.0.17+8/Contents/Home
    | Language Version: 11
    | Vendor: IBM
    | Architecture: x86_64
    | Is JDK: true
    | Detected by: Current JVM

So, that part is working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:regression This used to work in:toolchains Java Toolchains
Projects
None yet
Development

No branches or pull requests

4 participants