JuliaLang / Downloads.jl

MIT License
89 stars 34 forks source link

only run precompile workload when generating output #243

Open sjkelly opened 2 months ago

sjkelly commented 2 months ago

otherwise we run code at module load each time.

KristofferC commented 2 months ago

otherwise we run code at module load each time.

This is not really true, the toplevel code only runs during precompilation (or if you load the module and have turned off precompilation).

StefanKarpinski commented 2 months ago

Seems like this change is desirable so that this code isn't run when recompilation is off though, no?

sjkelly commented 2 months ago

I should have clarified that the main rationale for this is to make Downloads work at using time with juliac. I am not sure if juliac's compilation model is broken, but I felt that regardless this would be a strict improvement.

I supposed backwards compat needs to be fixed as well.

sjkelly commented 2 months ago

Note that https://github.com/JuliaLang/Downloads.jl/pull/242 is also required for juliac compatibility.

KristofferC commented 2 months ago

This fails on earlier julia versions, I think you need to use the ccall to be compatible.