JuliaLang / julia

The Julia Programming Language
https://julialang.org/
MIT License
45.39k stars 5.45k forks source link

Environment variable for --sysimage flag #36843

Open kcajf opened 4 years ago

kcajf commented 4 years ago

Being able to specify this path with a variable such as JULIA_SYSIMAGE=/tmp/sysimage.so would be useful.

akosuas commented 3 years ago

It looks like a simple getenv could be added here? https://github.com/JuliaLang/julia/blob/93f8a45cf50aea577e07a4f5e8bacc602712af17/src/jloptions.c#L27

But I am not very familiar with the code. It would be good if someone else could weigh in.

JackDunnNZ commented 3 years ago

Bump, this would be great to have!

PallHaraldsson commented 2 years ago

I'm not sure about this. See: https://github.com/JuliaLang/julia/issues/37895#issuecomment-942723653

vtjnash commented 2 years ago

Most things do not need a environment variable duplicate

oschulz commented 2 years ago

I would argue that this would be very useful to have: The julia project/environment and the sysimage need to match - of course, one can use command line arguments for both, but since we have $JULIA_PROJECT it would make sense to have $JULIA_SYSIMAGE as well.

There are many relevant use cases for this: When deploying jobs on batch systems, for example, it's often easier to just forward environment variables. Also with Jupyter, it's often more convenient and flexible to set $JULIA_PROJECT compared to creating a special kernel spec that uses --sysimage. Also, environment variables make it easy to keep things consistent across a whole tool-chain (e.g. when Julia is called several times from scripts or dataflow management frameworks). Especially batch and dataflow applications are cases where custom system images can be very beneficial (many Julia processes running the same software both parallel and in series).

(Sorry, clicked the wrong button, didn't mean to reopen without asking, just wanted to comment, should I close again?)

bakaburg1 commented 2 years ago

I just had a similar problem. I'm using Julia from R with the JuliaConnector package and I cannot set the startup flags, so no custom sysimage. I was hoping a workaround already existed but it seems not...

essenciary commented 2 years ago

Up

Also useful for Docker/Dockerfile - I can set ENV JULIA_DEPOT_PATH and I'd like to also set the SYSIMAGE please.

oscardssmith commented 2 years ago

I also would very much like this to exist.