Skip to content

fix: include modPkgExt in .ir file exports#13118

Merged
Kha merged 1 commit intoleanprover:masterfrom
Kha:push-mnzvxyotrxxq
Mar 25, 2026
Merged

fix: include modPkgExt in .ir file exports#13118
Kha merged 1 commit intoleanprover:masterfrom
Kha:push-mnzvxyotrxxq

Conversation

@Kha
Copy link
Copy Markdown
Member

@Kha Kha commented Mar 25, 2026

This PR fixes an incompatibility of --load-dynlib with the module system.

When a transitive non-public import's data came from the .ir file instead of .olean, getModulePackageByIdx? returned none, producing wrong symbol names (e.g., initialize_Batteries_Data_UInt instead of initialize_batteries_Batteries_Data_UInt), leading to dlsym failures and double-registration errors.

This PR fixes a bug where `.ir` files lacked `modPkgExt` entries, causing
incorrect module initialization function names when using `--load-dynlib`
with the module system. When a transitive non-public import's data came
from the `.ir` file instead of `.olean`, `getModulePackageByIdx?` returned
`none`, producing wrong symbol names (e.g., `initialize_Batteries_Data_UInt`
instead of `initialize_batteries_Batteries_Data_UInt`), leading to `dlsym`
failures and double-registration errors.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@Kha Kha requested review from hargoniX and leodemoura as code owners March 25, 2026 15:27
@Kha Kha added the changelog-compiler Compiler, runtime, and FFI label Mar 25, 2026
@Kha Kha enabled auto-merge March 25, 2026 15:30
@Kha Kha added this pull request to the merge queue Mar 25, 2026
Merged via the queue into leanprover:master with commit c77f212 Mar 25, 2026
23 checks passed
@github-actions github-actions bot added the toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN label Mar 25, 2026
@leanprover-bot
Copy link
Copy Markdown
Collaborator

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2026-03-24 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-manual, reference manual CI should run now. You can force reference manual CI using the force-manual-ci label. (2026-03-25 16:36:33)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Mar 25, 2026
@github-actions github-actions bot added the mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN label Mar 25, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 25, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Mar 25, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@Kha Kha deleted the push-mnzvxyotrxxq branch March 25, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

builds-mathlib CI has verified that Mathlib builds against this PR changelog-compiler Compiler, runtime, and FFI mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants