Avoiding recompilation between interactive use and testing by making testing also checkbounds=auto?

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.

Why not use check-bounds=yes in the REPL?

2 Likes

also an option.
is there an easy way to do that in my startup.jl?
i don’t want to deal with shell aliases.

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

Pkg.test("MyPackage"; julia_args=`--check-bounds=auto`)
1 Like

Related to your question, I think you want to hack

1 Like

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.