julia-actions/julia-runtest

Julia 1.9 pkgimages disabled by default

Opened this issue · 2 comments

fonsp commented

Hi all!

I found out that julia-runtest disables Julia's pkgimages feature by default on Julia 1.9. You can test this by adding @test Base.JLOptions().use_pkgimages == 1 to one of your tests.

I think this because of this logic in Julia:

https://github.com/JuliaLang/julia/blob/8fbef6e3fc7b3b8a95dc44d0a0181d967219ddd5/src/jloptions.c#L824-L830

And in julia-runtest, we enable the --code-coverage flag by default.

I think this is actually a good default: disabling pkgimages is faster if you only run an environment once after compilation (The increase in precompilation time caused by generating the .so files is generally higher than the decrease in import Example.) This is the case for running tests once, and then discarding the worker, so it's good! This might change in a future Julia release, and enabling pkgimages might be the faster option for a one-off run. 🤞

Just wanted to share this discovery! It might be nice to document this, and/or to make this a flag that people can set.

That's interesting, thanks for pointing this out!

It might be nice to document this, and/or to make this a flag that people can set.

I'm not sure what the option should look like and if it wouldn't be best to go with a sensible default. If the behaviour for one-off runs changes, we might want to default to that being enabled unless other inputs, such as coverage-generation, take precedence.

But it should definitely be documented with the same info that you posted here!

Note that 1.11 will use pkgimages when coverage is enabled, but will regenerate the native code for tracked packages with the required coverage tracking mechanics JuliaLang/julia#52123

Should make CI faster