Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eval in OptimMOIExt fails to precompile #1087

Closed
ven-k opened this issue Mar 27, 2024 · 2 comments · Fixed by #1088
Closed

eval in OptimMOIExt fails to precompile #1087

ven-k opened this issue Mar 27, 2024 · 2 comments · Fixed by #1088

Comments

@ven-k
Copy link

ven-k commented Mar 27, 2024

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
@theogf
Copy link
Contributor

theogf commented Mar 27, 2024

For v1.9+ the solution is to use setglobal! I suppose, but what about v1.8- ?

@devmotion
Copy link
Contributor

I think the easiest is just to keep MOI as a regular dependency on Julia < 1.9: #1088

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants