- Notifications
You must be signed in to change notification settings - Fork 80
Description
Unless I miss something, based on my tests with Liberica NIK only installed (but apply likely to GraalVM EE as well) and no GraalVM CE installation present locally (not easy because native-build-tools requires it to be built), even when applying disableToolchainDetection = true to BuildNativeImageTask implemented as part of #165 I get the following error:
> Task :nativeCompile FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':nativeCompile'. > Error while evaluating property 'options.javaLauncher' of task ':nativeCompile' > Failed to query the value of property 'javaLauncher'. > No compatible toolchains found for request filter: {languageVersion=11, vendor=matching('GraalVM'), implementation=vendor-specific} (auto-detect true, auto-download true) After a deeper analysis, I found that toolchain relate code in BaseNativeImageOptions need to be executed conditionally as well.
As a consequence, I propose to introduce disableToolchainDetection at DSL level (since it will be a popular option at least on Spring side for a while) to be able to just configure:
graalvmNative { disableToolchainDetection = true } And to apply it on both BaseNativeImageOptions and BuildNativeImageTask to be effective.
Be careful, to test you need to temporarily remove GraalVM CE from what is recognized by Gradle toolchain, for my tests I used Liberica NIK (available on SDKMAN) but GraalVM EE can also probably be used.
This issue is critical for Spring Native as it prevents Gradle users to use Liberica NIK which is now our default GraalVM distribution.