foojayio / discoapi

The foojay discovery api (discoapi) is made to discover java packages (jre/jdk) from different distributions.
GNU General Public License v2.0
112 stars 13 forks source link

JetBrains Java 17 runtimes point to debug symbol archives instead of the actual jdk jars #70

Closed eigenraven closed 1 year ago

eigenraven commented 1 year ago

The _diz archives contain only native debug symbols for the toolchain, while the real binaries and libraries are in the other archive (see https://github.com/JetBrains/JetBrainsRuntime/issues/164), it would be nice if the foojay resolver could point to the correct archives - I ran into this while trying to download the JetBrains runtime via the Gradle foojay toolchain resolver (to use the embedded DCEVM functionality for enhanced class redefinition at runtime).

Example query: https://api.foojay.io/disco/v3.0/packages?package_type=jdk&latest=available&version=17&operating_system=linux&architecture=x64&archive_type=tar.gz&distribution=jetbrains

Expected results (based on the list at https://github.com/JetBrains/JetBrainsRuntime/releases/tag/jbr-release-17.0.6b785.1):

Actual results:

HanSolo commented 1 year ago

Oh that should definitely not happen, will fix it asap. Thx for the heads up 👍🏻

HanSolo commented 1 year ago

It should work now as expected, could you give it another try?

eigenraven commented 1 year ago

It looks like the query I posted in the original report now reports the debug symbol tar and then the correct jar as 2 distributions. This seems to still confuse the gradle foojay-resolver plugin (https://github.com/gradle/foojay-toolchains) as it tries to download the first archive, which is the debug symbol archive.

I'm not sure what the exact intention of the API here is, so I can't tell if it's the API result being wrong or the gradle plugin using the wrong result (should it expect debug symbol archives to be listed?), but the end result is that gradle still can't fetch a toolchain with the following settings (with the java and foojay-resolver-convention plugins active):

java {
  toolchain {
    languageVersion.set(JavaLanguageVersion.of(17))
    vendor.set(JvmVendorSpec.matching("jetbrains"))
  }
}

If you think the API result for https://api.foojay.io/disco/v3.0/packages?package_type=jdk&latest=available&version=17&operating_system=linux&architecture=x64&archive_type=tar.gz&distribution=jetbrains is correct here in giving the debug symbols, I can open an issue against the gradle plugin.

HanSolo commented 1 year ago

The debug one should not appear, will have another look, thx for testing

HanSolo commented 1 year ago

Now the debug builds should not appear any more. So there are still more than one build per version available for the Jetbrains JDK's. They use the build number as part of the filename and I'm thinking about to parse that out and also use that for sorting to make sure you get the latest build on top but that's not in yet.

eigenraven commented 1 year ago

Thanks, gradle now seems to be able to at least download a working, optimized build.