environ icon indicating copy to clipboard operation
environ copied to clipboard

Consider exposing 'read-env'

Open cnuernber opened this issue 4 years ago • 2 comments

Hey, I am building a graal native executable and part of its dependencies use environ.

The issue is that the defonce env gets compiled into that native executable and is initialized at build time (which is something we have to do for Clojure programs). I think that is unavoidable really but for our systems I would like to call read-env at runtime but it is private.

Would you consider making read-env public?

cnuernber avatar Apr 17 '21 17:04 cnuernber

Hey, @cnuernber I also just faced this problem, what did you end up with?

I tried to use --initialize-at-run-time=environ.core option of the GraalVM native image, but that didn't work.

I would want to continue using environ, and seems like the #95 fixes it.

SerhiiKozachenko avatar Feb 04 '22 15:02 SerhiiKozachenko

I copied environ and exposed read-env. So we don't depend on this library any more. Then we have a system to save the program config to a variable that gets scanned by graal's compiler and hence saved as a static variable in the system and then use read-env to apply only the environmental changes to the static variable.

cnuernber avatar Feb 04 '22 16:02 cnuernber