-
Notifications
You must be signed in to change notification settings - Fork 462
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
feat: importModules
without loading environment extensions
#6325
base: master
Are you sure you want to change the base?
Conversation
Mathlib CI status (docs):
|
570f669
to
81447dd
Compare
@Kha Also, what is the reason for privatizing EDIT: Personally, I would suggest splitting |
But we're not loading any non-builtin extensions when initializers are disabled, as discussed before.
So |
Agreed, this would be really annoying. I am calling that function in lean4lean, this will need me to copy paste a lot of code. |
81447dd
to
0c4532f
Compare
I didn't reply to that part because I was already reverting it :) |
True, so it is currently safe. It does mean that we have to continually be careful to not introduce any opportunity for arbitrary I/O in a
Sorry, I should have been more specific. Only loading plugins in Lean code (via |
@digama0 Actually could you explain what |
0c4532f
to
542c80d
Compare
cb6d977
to
8e6f0cc
Compare
8e6f0cc
to
e5b8ce6
Compare
I forget all the details, but looking at it now it seems to be a one-step unrolling of |
leanprover-community/mathlib4#20355 should stop the bleeding downstream of Mathlib until this lands. |
These are not supported unless `enableInitializersExecution` is called, and various downstream scripts do not call this. https://leanprover.zulipchat.com/#narrow/channel/270676-lean4/topic/lean4checker.20failure/near/486191171 has some context for the underlying issue, which seems to be that Lean tries to finalize environment extensions even if initializers are disabled, leading to crashes if those extensions (such as the parser alias table) expect initializers to have run. To prove this works, this removes `Lean.enableInitializersExecution` from the script to check the yaml files. This is what we will want to do anyway after leanprover/lean4#6325 lands, as this script should not need to run any extensions.
This PR ensures that environments can be loaded, repeatedly, without executing arbitrary code