Skip to content

GraalVM native-image configurations distribution for Clojure libraries

License

Notifications You must be signed in to change notification settings

clj-easy/graal-config

Repository files navigation

Graal config

A repository containing GraalVM native-image configurations to be used as git libraries in deps.edn.

How to use

  • 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"}}}

Supported libraries

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
  1. Vote here, so that we can allow-incomplete-classpath for only the specific cases.

Neil

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)

Contributing

  1. Clone the repository.
  2. Run bb recipe :org <org> :lib <lib>
  3. Provide config in META-INF/native-image/organization/library/native-image.properties + additional JSON files if necessary.

Tests

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`.

About

GraalVM native-image configurations distribution for Clojure libraries

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published