Skip to content
This repository was archived by the owner on Feb 23, 2023. It is now read-only.

Gradle nativeBuild does not work with Bellsoft Liberica NIK SDK #1381

Closed
lukas-krecan opened this issue Dec 16, 2021 · 7 comments
Closed

Gradle nativeBuild does not work with Bellsoft Liberica NIK SDK #1381

lukas-krecan opened this issue Dec 16, 2021 · 7 comments
Assignees
Labels
type: documentation A documentation task
Milestone

Comments

@lukas-krecan
Copy link

lukas-krecan commented Dec 16, 2021

The documentation recommends to use Bellsoft Liberica NIK SDK but if you run ./gradlew nativeBuild you get

 No compatible toolchains found for request filter: {languageVersion=17, vendor=matching('GraalVM'), implementation=vendor-specific} (auto-detect true, auto-download true)

If I switch to grl SDK, it works

It would be nice to either fix the docs or the build.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Dec 16, 2021
@sdeleuze
Copy link
Contributor

I tried and it works for me. Please make sure you ran gu install native-image with Liberica NIK before since this is a per SDK command to run. Side note : nativeBuild is now deprecated in favor of nativeCompile.

Please let me know how it goes.

@sdeleuze sdeleuze added status: waiting-for-feedback We need additional information before we can continue and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Dec 16, 2021
@lukas-krecan
Copy link
Author

I did gu install native-image (I spent around an hour trying fixing it). Can you try to uninstall the grl? My suspicion is that Gradle looks for GraalVM vendor and if you have it installed, it just finds it.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Dec 16, 2021
@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 16, 2021

Yes we will, maybe the is something specific we should fine tune on https://github.com/graalvm/native-build-tools side.

@sdeleuze sdeleuze self-assigned this Dec 16, 2021
@sdeleuze sdeleuze added this to the 0.11.1 milestone Dec 17, 2021
@sdeleuze sdeleuze added type: documentation A documentation task and removed status: feedback-provided Feedback has been provided labels Dec 17, 2021
@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 17, 2021

Ok so short term we are going to disable toolchain support as implemented via graalvm/native-build-tools#164 on start.spring.io and document that as part of Spring Native 0.11.1, see related documentation.

Middle term, Gradle Toolchain support should be made more powerful to support native-image flavors of Java, you can follow gradle/gradle#18896 for more details. gradle/gradle#18028 is also kind of related.

@sdeleuze
Copy link
Contributor

At the moment, the documented workaround does not seems to work:

tasks.withType(org.graalvm.buildtools.gradle.tasks.BuildNativeImageTask).configureEach {
	disableToolchainDetection = true
}

I have asked NBT team feedback on this and will keep you informed.

@sdeleuze
Copy link
Contributor

I think I understand why it does not work, and it looks like a NBT 0.9.8 bug from what I can say. I created graalvm/native-build-tools#183 and will try to see how fast we can get NBT 0.9.9 to fix it.

For now, with Gradle and Native Build Tools use GraalVM CE.

@sdeleuze
Copy link
Contributor

sdeleuze commented Dec 20, 2021

The bug is now confirmed and fixed in Native Build Tools 0.9.9-SNAPSHOT.

I am waiting to know if a quick NBT 0.9.9 release is possible, in that case, we will disable by default Gradle toolchain for native compilation.

Otherwise, I will move that issue to Spring Native 0.11.2 milestone and document in 0.11.1 that Liberica NIK is not yet supported with NBT + Gradle (GraalVM CE should be used instead).

@sbrannen sbrannen changed the title Gradle nativeBuild does not with Bellsoft Liberica NIK SDK Gradle nativeBuild does not work with Bellsoft Liberica NIK SDK Dec 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: documentation A documentation task
Development

No branches or pull requests

3 participants