Skip to content

fix: lake: error on executables with duplicate root module names#13028

Merged
tydeu merged 6 commits intoleanprover:masterfrom
tydeu:lake/issue-13013
Mar 23, 2026
Merged

fix: lake: error on executables with duplicate root module names#13028
tydeu merged 6 commits intoleanprover:masterfrom
tydeu:lake/issue-13013

Conversation

@tydeu
Copy link
Copy Markdown
Member

@tydeu tydeu commented Mar 21, 2026

This PR adds a check that rejects Lake configurations where multiple executables share the same root module name. Previously, Lake would silently compile the root module once and link it into all executables, producing identical binaries regardless of differing srcDir settings.

Lake (and Lean) rely on module names being unique within a package. Rather than attempting to support duplicate module names, Lake now produces a clear error at configuration load time, for both TOML and Lean configuration files.

Closes #13013

🤖 Prepared with Claude Code

tydeu and others added 3 commits March 21, 2026 20:16
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
@tydeu tydeu added changelog-lake Lake lake-ci Run all Lake tests labels Mar 21, 2026
@tydeu tydeu force-pushed the lake/issue-13013 branch from d6ce3d0 to e791c8c Compare March 21, 2026 23:26
@tydeu tydeu force-pushed the lake/issue-13013 branch from e791c8c to 80042b2 Compare March 21, 2026 23:26
@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 22, 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-19 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-22 01:13:17)

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Mar 22, 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 22, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 22, 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 22, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Mar 22, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 22, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/batteries that referenced this pull request Mar 22, 2026
mathlib-nightly-testing bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Mar 22, 2026
@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@mathlib-lean-pr-testing
Copy link
Copy Markdown

Mathlib CI status (docs):

@tydeu tydeu marked this pull request as ready for review March 23, 2026 12:39
@tydeu tydeu added this pull request to the merge queue Mar 23, 2026
Merged via the queue into leanprover:master with commit 9eb249e Mar 23, 2026
30 of 32 checks passed
@tydeu tydeu deleted the lake/issue-13013 branch March 24, 2026 00:03
kim-em added a commit to leanprover/verso that referenced this pull request Apr 7, 2026
Rename executable root modules to be unique, as Lake now rejects
duplicate root module names across executables (leanprover/lean4#13028).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kim-em added a commit to leanprover/verso that referenced this pull request Apr 8, 2026
Rename executable root modules to be unique, as Lake now rejects
duplicate root module names across executables (leanprover/lean4#13028).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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-lake Lake lake-ci Run all Lake tests 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.

Lake: multiple lean_exe targets with the same root module name produce identical executables

2 participants