A repository containing GraalVM native-image
configurations to be used as git
libraries in deps.edn
.
- Include this library as a git dependency in your native image classpath.
- Set
:deps/root
to"config/<org>/<lib>"
- In addition to this, include
com.github.clj-easy/graal-build-time
which automatically configures--initialize-at-build-time
with clojure packages. - Then build your native image!
Full example for both cheshire/cheshire
and com.taoensso/nippy
in one build:
(update versions as necessary):
{:deps
{cheshire/cheshire {:mvn/version "5.10.0"}
com.taoensso/nippy {:mvn/version "3.1.1"}
com.github.clj-easy/graal-config-cheshire {:git/url "https://github.com/clj-easy/graal-config"
:git/sha "b06e33694d2c878169958f7317ea01d9c0353ab4"
:deps/root "config/cheshire/cheshire"}
com.github.clj-easy/graal-config-nippy {:git/url "https://github.com/clj-easy/graal-config"
:git/sha "b06e33694d2c878169958f7317ea01d9c0353ab4"
:deps/root "config/com.taoensso/nippy"}}}
Library name | Config path | Additional steps |
---|---|---|
com.taoensso/nippy | link | None |
cheshire/cheshire | link | None |
com.h2database/h2 | link | "--allow-incomplete-classpath" (1*) |
com.github.seancorfield/next.jdbc | link | MERGED UPSTREAM |
org.slf4j/slf4j-simple | link | None |
clj-http | link | None |
ring/ring-jetty-adapter | link | None |
- Vote here, so that we can
allow-incomplete-classpath
for only the specific cases.
To add a library to your deps.edn
with neil:
neil add dep com.github.clj-easy/graal-config \
:deps/root config/com.taoensso/nippy \
:as com.github.clj-easy/graal-config-nippy :latest-sha true
Tested GraalVM versions (see here)
- Clone the repository.
- Run
bb recipe :org <org> :lib <lib>
- Provide config in
META-INF/native-image/organization/library/native-image.properties
+ additional JSON files if necessary.
Run bb native-image-test :dir config/<org>/<lib>/example :graalvm-version <graalvm-version>
.
E.g:
$ bb native-image-test :dir config/com.taoensso/nippy/example :graalvm-version 21.1.2`.