environ
environ copied to clipboard
Add runtime-env for graalvm native-image support
I added core/runtime-env
to better support graalvm native-image (where core/env
reflects the compile time environment).
Since it's a delay you just deref it:
(require '[environ.core :as environ])
@environ/runtime-env
...and it returns the same data structure as core/env
but reflects the runtime config environment.
It is a delay so that you it loads the config the first time you deref runtime-env
but then caches it after that (like env
does for compile time config).
Commit messages of this repository should follow the seven rules of a great Git commit message, as mentioned in the project's contributing guidelines. It looks like there's a few issues with the commit messages in this pull request:
- The commit message should not contain markdown.
- The commit message body has a line over 72 characters.
This is an alternative solution to #92
As an option, maybe use: *compile-files*
flag, https://groups.google.com/g/clojure/c/hhih2Ty7-Lc/m/yXa43-X441gJ
For example:
(defonce ^{:doc "A map of environment variables at runtime."}
env (when-not *compile-files* (read-env)))
Nevermind, that doesn't help with native-image.