Fork me on GitHub
#graalvm
<
2019-08-18
>
gerred17:08:47

👋

gerred17:08:06

@borkdude thanks for all of the CLIs you've been putting out with graal.

gerred17:08:03

has anyone tried to use environ with graal yet? no matter what I do, everything seems to be fully evaluated at compile time. i'd like to pull off what I do in Go/Rust (thinking 12-factor) and parse environment variables at runtime.

gerred17:08:38

ignoring whether or not this is a good idea of course, if I'm instead using say, a config.edn file.

gerred17:08:27

i'm wanting to put together a general configuration library a la https://github.com/spf13/viper

borkdude17:08:35

@gerred I just use (System/getenv), but you should not do this as a top-level expression, that will indeed be evaluated at compile time

gerred17:08:07

got it. do you have an example somewhere?

gerred17:08:07

oh interesting ok

gerred17:08:31

it's interesting since environ's .cljc does boil down to System/getenv

gerred17:08:39

but environ doesn't work and System/getenv does.

gerred17:08:45

¯\(ツ)/¯

borkdude17:08:49

I don't know how environ works, but maybe it uses macros that are executed at compile time

gerred17:08:11

it's using defonce on env.

gerred17:08:13

maybe it's that.

gerred17:08:51

oh well, not needed for this library

gerred17:08:25

the whole lib is simple enough to just....well, use the clj parts. 🙂

borkdude17:08:30

then I bet it's also not suited with AOT?

gerred17:08:56

it would be interesting to be able to use tools.deps to eventually re-def forms during AOT compilation. for example, in the Go project I work on, we set the version, git commit sha, etc., for our versioning at build-time with -X on ldflags: https://github.com/kudobuilder/kudo/blob/master/Makefile#L15

gerred17:08:05

i see you're putting files in resources/ right now.

gerred17:08:57

actually, I don't see why there can't be an alias with extra-deps that does that now without adjustments to tools.deps actually and just use interns or a build-metadata namespace :thinking_face:

borkdude17:08:35

if you compile your namespaces with the right environment variables set at compile time, that should fix it right?

borkdude17:08:47

if you want to capture some information from build time