`eval` in OptimMOIExt fails to precompile
ven-k opened this issue · comments
Venkateshprasad commented
fatal: error thrown and no exception handler available.
InitError(mod=:OptimMOIExt, error=ErrorException("Evaluation into the closed module `Optim` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Optim` with `eval` during precompilation - don't do this."))
MWE:
With a optim-test/OptimTest.jl
file that has:
module OptimTest
using MathOptInterface
using Optim
end
pushfirst!(LOAD_PATH, "optim-test")
using OptimTest
Théo Galy-Fajou commented
For v1.9+ the solution is to use setglobal!
I suppose, but what about v1.8- ?
David Widmann commented
I think the easiest is just to keep MOI as a regular dependency on Julia < 1.9: #1088