Skip to content

[Backport releases/v4.19.0] feat: importModules without loading environment extensions#7787

Merged
kim-em merged 1 commit intoreleases/v4.19.0from
backport-6325-to-releases/v4.19.0
Apr 2, 2025
Merged

[Backport releases/v4.19.0] feat: importModules without loading environment extensions#7787
kim-em merged 1 commit intoreleases/v4.19.0from
backport-6325-to-releases/v4.19.0

Conversation

@github-actions
Copy link
Copy Markdown
Contributor

@github-actions github-actions bot commented Apr 2, 2025

Backport 5df4e48 from #6325.

This PR ensures that environments can be loaded, repeatedly, without
executing arbitrary code

(cherry picked from commit 5df4e48)
@github-actions github-actions bot requested a review from tydeu as a code owner April 2, 2025 11:24
@kim-em kim-em merged commit 3cb82da into releases/v4.19.0 Apr 2, 2025
mo271 added a commit to mo271/formal-conjectures that referenced this pull request Oct 23, 2025
The `overwrite_index.lean` script failed to count attributes after a
Lean version bump. This was due to changes in how module imports
handle environment extensions, as introduced in
leanprover/lean4#7787 .

`Lean.withImportModules` no longer loads environment extensions. This commit
refactors the `runWithImports` function to use the lower-level
`importModulesCore` and `finalizeImport` functions, explicitly setting
`loadExts := true` to ensure attributes are loaded and counted correctly.
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 this pull request may close these issues.

2 participants