So because by default julia runs with check-bounds=auto,
but when testing it runs with check-bounds=yes
and those generate different package-images,
julia will have to re-precompile everything when you change from interactive use to ]test.
Even if you have no test time dependencies.
At least, that is my understanding.
Is there something i can monkey-patch to make testing also use check-bounds=auto ?
I can always leave it to CI for the final check anyway.
Not exactly answering your question, but in case you didn’t know that (I discovered this only recently) you can run tests with --check-bounds=auto with
No, because global flags like that need to be set before julia starts. stattup.jl runs after the global flags like --check-bounds are set. The test suite does that by launching a worker process where the test code is run, if I recall correctly.
I have now been doing this since this comment, and it has been a huge enhancement to my life.
I recommend everyone who is developing a lot of julia packages do this.
I do something complicated.
I have a bash script that starts my julia that I run from VS-Code because I want to run the VS-Code language server and the REPL using different versions of julia.
(I want my REPL running something near nightly)
and that script is like
#!/usr/bin/env bash
set -e
if [ -z "$JULIA_VSCODE_INTERNAL" ]; then
exec julia-crimes --check-bounds=yes "$@"
else
exec julia +release --check-bounds=yes "$@"
fi