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 for BELLSOFT download AdoptOpenJDK #17148

Closed
tomaszmichalak opened this issue May 10, 2021 · 4 comments
Closed

Toolchains for BELLSOFT download AdoptOpenJDK #17148

tomaszmichalak opened this issue May 10, 2021 · 4 comments
Assignees
Labels
a:bug closed:duplicate Duplicated or superseeded by another issue in:toolchains Java Toolchains

Comments

@tomaszmichalak
Copy link

tomaszmichalak commented May 10, 2021

Expected Behavior

Liberica JDK is downloaded when it is specified in java.toolchain:

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(15))
        vendor.set(JvmVendorSpec.BELLSOFT)
    }
}

Current Behavior

AdoptOpenJDK is downloaded. See the log:

./gradlew bootRun --info
2021-05-10T14:11:56.283+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Toolchain detection' started
2021-05-10T14:11:56.288+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Starting process 'command '/usr/libexec/java_home''. Working directory: /Users/tomasz.michalak/.gradle/daemon/6.9 Command: /usr/libexec/java_home -V
2021-05-10T14:11:56.288+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTING
2021-05-10T14:11:56.288+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Waiting until process started: command '/usr/libexec/java_home'.
2021-05-10T14:11:56.301+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: STARTED
2021-05-10T14:11:56.302+0200 [DEBUG] [org.gradle.process.internal.ExecHandleRunner] waiting until streams are handled...
2021-05-10T14:11:56.302+0200 [INFO] [org.gradle.process.internal.DefaultExecHandle] Successfully started process 'command '/usr/libexec/java_home''
2021-05-10T14:11:56.324+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Changing state to: SUCCEEDED
2021-05-10T14:11:56.324+0200 [DEBUG] [org.gradle.process.internal.DefaultExecHandle] Process 'command '/usr/libexec/java_home'' finished with exit value 0 (state: SUCCEEDED)
2021-05-10T14:11:56.325+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Toolchain detection'
2021-05-10T14:11:56.325+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Toolchain detection' completed
2021-05-10T14:11:56.326+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Waiting to acquire exclusive lock on adoptopenjdk-15-x64-mac.tar.gz.
2021-05-10T14:11:56.327+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Lock acquired on adoptopenjdk-15-x64-mac.tar.gz.
2021-05-10T14:11:56.327+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Provisioning toolchain adoptopenjdk-15-x64-mac.tar.gz' started
2021-05-10T14:11:56.327+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Unpacking toolchain archive' started
2021-05-10T14:12:01.008+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Unpacking toolchain archive'
2021-05-10T14:12:01.009+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Unpacking toolchain archive' completed
2021-05-10T14:12:01.009+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Completing Build operation 'Provisioning toolchain adoptopenjdk-15-x64-mac.tar.gz'
2021-05-10T14:12:01.009+0200 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Provisioning toolchain adoptopenjdk-15-x64-mac.tar.gz' completed
2021-05-10T14:12:01.009+0200 [DEBUG] [org.gradle.cache.internal.DefaultFileLockManager] Releasing lock on adoptopenjdk-15-x64-mac.tar.gz.

Context

I want to use Liberica JDK when creating my Spring Boot project. Spring Boot uses the Packeto buildpack support for Gradle buildinig a Docker image that uses Liberica internally.

Steps to Reproduce

Create a sample Spring Boot project and add:

java {
    toolchain {
        languageVersion.set(JavaLanguageVersion.of(15))
        vendor.set(JvmVendorSpec.BELLSOFT)
    }
}

Your Environment

  • macOs BigSur,
  • Gradle 6.9

Build scan URL: Not required

@tomaszmichalak
Copy link
Author

I've checked also with Gradle 7.0. The result is the same.

@bmuskalla bmuskalla self-assigned this May 10, 2021
@bmuskalla bmuskalla added the in:toolchains Java Toolchains label May 10, 2021
@bmuskalla
Copy link
Contributor

bmuskalla commented May 11, 2021

Tried to reproduce this here. Using gradle init and the snippet you provide, I can't reproduce the wrong jdk to be downloaded. It properly fails with

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':lib:compileJava'.
> Could not resolve all dependencies for configuration ':lib:compileClasspath'.
   > Failed to calculate the value of task ':lib:compileJava' property 'javaCompiler'.
      > No compatible toolchains found for request filter: {languageVersion=15, vendor=BELLSOFT, implementation=vendor-specific} (auto-detect false, auto-download true)

I'd like to understand if you see a specific defect that the wrong jdk is downloaded. Nonetheless, downloading JDKs for Bellsoft would be a feature request to be looked at (dup of #16596).

Would you be able to share a reproducer which downloads the wrong JDK?

@bmuskalla
Copy link
Contributor

Marking as dup of #16596 for now

@bmuskalla bmuskalla added closed:duplicate Duplicated or superseeded by another issue and removed to-triage labels May 26, 2021
@mlopatkin
Copy link
Member

Downloading the AdoptOpenJDK (actually, unpacking the already downloaded one) when the vendor is specified for the toolchain was fixed in #17509.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:bug closed:duplicate Duplicated or superseeded by another issue in:toolchains Java Toolchains
Projects
None yet
Development

No branches or pull requests

3 participants