-
Notifications
You must be signed in to change notification settings - Fork 70
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
Introduce disableToolchainDetection DSL property and fix toolchain handling in BaseNativeImageOptions #183
Labels
Milestone
Comments
This was referenced Dec 18, 2021
I'm going to take a look, but the code you pointed at does the right thing: it's a convention so it doesn't mean that it will be used. |
I think it is used one way or another since when I remove it, #165 works as expected. |
It is used internally by Gradle to snapshot inputs, but the plugin doesn't use it, which is why it's messy. I'm working on a fix. |
melix
added a commit
that referenced
this issue
Dec 20, 2021
Disabling the toolchain detection by tasks wasn't sufficient, because Gradle would use the nested `BaseImageOptions` as an input, and even if the particular `JavaLauchner` input wasn't used if that flag was disabled, it would still be used internally by Gradle to snapshot inputs. As a consequence, the fix only worked if Gradle actually detected a GraalVM installation somewhere, even if it didn't use it! To fix this, this commit introduces a top-level DSL method called `disableToolchainDetection()` which effectively sets the toolchain to `null` by convention. By making the toolchain optional and null now Gradle wouldn't complain anymore. Fixes #183
melix
added a commit
that referenced
this issue
Dec 20, 2021
Disabling the toolchain detection by tasks wasn't sufficient, because Gradle would use the nested `BaseImageOptions` as an input, and even if the particular `JavaLauchner` input wasn't used if that flag was disabled, it would still be used internally by Gradle to snapshot inputs. As a consequence, the fix only worked if Gradle actually detected a GraalVM installation somewhere, even if it didn't use it! To fix this, this commit introduces a top-level DSL method called `disableToolchainDetection()` which effectively sets the toolchain to `null` by convention. By making the toolchain optional and null now Gradle wouldn't complain anymore. Fixes #183
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 applyingdisableToolchainDetection = true
toBuildNativeImageTask
implemented as part of #165 I get the following error: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:And to apply it on both
BaseNativeImageOptions
andBuildNativeImageTask
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.
The text was updated successfully, but these errors were encountered: