-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add an artifact that downloads GraalVM and Native Image #100
Comments
Gradle already supports the notion of tool chains which this should support imo |
I totally agree that we should provide a more build-tool friendly API to fetch a GraalVM build with native image preinstalled. Gradle's toolchain mechanism is two fold:
For both, there is a problem with GraalVM: In 1., the problem is that even if you identify a GraalVM toolchain, there's no guarantee that the For 2., the automatic provisioning is optional in Gradle. It uses the AdoptOpenJDK API to do this, but Gradle can be configured to use a different base URL for the download service. It means that GraalVM could provide an AdoptOpenJDK compatible API service to supply JDKs. It should be relatively easy to do so. Note that the API itself has nothing specific to Adopt. It can be used by any other vendor. However, again, what would be downloaded would have to come with |
Related: gradle/gradle#18028 |
Related Gradle Roadmap entry: gradle/build-tool-roadmap#29 |
Agreed. For Gradle, that's basically the only reason why we're using https://github.com/palantir/gradle-graal in https://github.com/oss-review-toolkit/ort rather than the Gradle plugin from this repo. I'm really hoping for gradle/gradle#18028 to land soon (it's scheduled for Gradle 7.6 currently) to address the matter generically in Gradle itself. |
what is the problem here i simply use
so ensure installed is not a problem ?? |
@frank-dspeed, let me re-phrase your question: "What is the point of Gradle toolchain auto provisioning?". |
BTW, the lack of auto-provisioning is why I'm also using the https://github.com/palantir/gradle-graal plugin instead of this one. Slightly off topic: kudos to the GraalVM team (and the team behind this plugin)! It's very nice to be able to build a statically linked native Java executable. |
@cvmocanu do i understand you correct your using nativ image gradle and graal with stock JDK? |
@frank-dspeed: I'm using the https://github.com/palantir/gradle-graal Gradle plugin. The plugin adds a As others said, that plugin does auto-provisioning (it downloads the specified version of GraalVM community to |
I would love to use the official plugin (this one) though, instead of the palantir one. |
See [1]. Once [2] is resolved the official Gradle plugin should be used instead of the current Palantir plugin [3] to benefit from automatic download of reachability-metadata [4]. [1]: https://github.com/oracle/graalvm-reachability-metadata/blob/master/metadata/ch.qos.logback/logback-classic/1.2.11/reflect-config.json [2]: graalvm/native-build-tools#100 [3]: https://github.com/palantir/gradle-graal [4]: https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html#metadata-support Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
See [1]. Once [2] is resolved the official Gradle plugin should be used instead of the current Palantir plugin [3] to benefit from automatic download of reachability-metadata [4]. Note that still more work is required to make the native-image build succeed. [1]: https://github.com/oracle/graalvm-reachability-metadata/blob/master/metadata/ch.qos.logback/logback-classic/1.2.11/reflect-config.json [2]: graalvm/native-build-tools#100 [3]: https://github.com/palantir/gradle-graal [4]: https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html#metadata-support Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
See [1]. Once [2] is resolved the official Gradle plugin should be used instead of the current Palantir plugin [3] to benefit from automatic download of reachability-metadata [4]. Note that still more work is required to make the native-image build succeed. [1]: https://github.com/oracle/graalvm-reachability-metadata/blob/master/metadata/ch.qos.logback/logback-classic/1.2.11/reflect-config.json [2]: graalvm/native-build-tools#100 [3]: https://github.com/palantir/gradle-graal [4]: https://graalvm.github.io/native-build-tools/latest/gradle-plugin.html#metadata-support Signed-off-by: Sebastian Schuberth <sschuberth@gmail.com>
Just wondering, could the work on this topic for the Gradle plugin already start now that Gradle 7.6 RC1 added support for Java Toolchain downloads from arbitrary repositories, despite gradle/gradle#18028 not being merged yet? |
i guess this gets solved as most of the graalvm parts get moved now to stock openjdk |
I'm not sure whether it's worth waiting for that to happen in a new JDK release. Releasing a new plugin version that's able to bootstrap GraalVM with native image support now seems to be the much lower hanging fruit. |
@sschuberth that was exactly what i did want to say 👍🏻 simply create a bash script and call it a day much faster written then java or use kotlin and not bash. |
That, however, is not what I wanted to say 😉 : Adding a few lines of Kotlin / Java code to implement a toolchain resolver plugin is quicker than waiting for a new JDK release, and much more generic / self-contained than requiring developers to run an external script. |
@sschuberth i make it even more generic i am working on a https://google.github.io/blockly-samples/plugins/block-dynamic-connection/test/ graalvm build tool ok it is not related to graalvm but it can build graalvm and that is in my view the most generic as it runs generic in my browser and is able to execute it directly else where or save it to a local file. i simply connect my input processing and output blocks click run and call it a day and even get debug output if needed and so on. As also can edit on the fly if needed. |
GraalVM has become more easily accessible in the last couple of months (e.g., SDKMAN!, GitHub Actions, script-friendly download URLs). It is also integrated in the Foojay API, which can be used by Gradle's toolchain detection. Given this issue hasn't been updated for more than a year, I'm going to close it for now. In case you still see a problem or potentials for improvement, please speak up :) |
This should really be reopened. None of the variants listed allow for automatic management of the GraalVM SDK, or insures that all developers use same version for a particular project. |
It can be a bit tricky for the end users to download and configure GraalVM. We can automate this process by providing an artifact that downloads and configures GraalVM and Native Image.
This artifact would be invoked by both Gradle and Maven plugins and would be configurable trough them (by specifying version, distribution, and/or even the URL) using extensions and configuration options.
Note that Windows support for this might be a bit harder (but certainly doable).
The text was updated successfully, but these errors were encountered: