Skip to content

Conversation

@tydeu
Copy link
Member

@tydeu tydeu commented Nov 20, 2025

This PR adds a module resolution procedure to Lake to disambiguate modules that are defined in multiple packages.

On an import, Lake will now check if multiple packages within the workspace define the module. If so, it will verify that modules have sufficiently similar definitions (i.e., artifacts with the same content hashes). If not, Lake will report an error.

This verification is currently only done for direct imports. Transitive imports are not checked for consistency. An overhaul of transitive imports will come later.

@tydeu tydeu added the changelog-lake Lake label Nov 20, 2025
@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 Nov 20, 2025
@leanprover-community-bot
Copy link
Collaborator

leanprover-community-bot commented Nov 20, 2025

Mathlib CI status (docs):

  • ❗ Mathlib CI can not be attempted yet, as the nightly-testing-2025-11-19 tag does not exist there yet. We will retry when you push more commits. If you rebase your branch onto nightly-with-mathlib, Mathlib CI should run now. You can force Mathlib CI using the force-mathlib-ci label. (2025-11-20 04:02:33)
  • ✅ Mathlib branch lean-pr-testing-11270 has successfully built against this PR. (2025-11-22 00:13:50) View Log

@leanprover-bot
Copy link
Collaborator

leanprover-bot commented Nov 20, 2025

Reference manual CI status:

  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-11-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. (2025-11-20 04:02:35)
  • ❗ Reference manual CI can not be attempted yet, as the nightly-testing-2025-11-21 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. (2025-11-21 23:06:02)

@tydeu
Copy link
Member Author

tydeu commented Nov 20, 2025

!bench

@leanprover-radar
Copy link

leanprover-radar commented Nov 20, 2025

Benchmark results for 9a712ef against 6118662 are in! @tydeu

Major changes (2)
  • lake build no-op//instructions changed by +13.0% (🟥).
  • stdlib//instructions changed by +7.3% (🟥).

@tydeu
Copy link
Member Author

tydeu commented Nov 21, 2025

!bench

@leanprover-radar
Copy link

leanprover-radar commented Nov 21, 2025

Benchmark results for 6ba80e2 against 6118662 are in! @tydeu

Major changes (2)
  • lake build no-op//instructions changed by +27.0% (🟥).
  • stdlib//instructions changed by +7.3% (🟥).

@tydeu tydeu force-pushed the lake/disambiguate-mods branch from 6ba80e2 to b8895c4 Compare November 21, 2025 00:13
@tydeu
Copy link
Member Author

tydeu commented Nov 21, 2025

!bench

@leanprover-radar
Copy link

leanprover-radar commented Nov 21, 2025

Benchmark results for 6e151c6 against 6118662 are in! @tydeu

Major changes (1)
  • stdlib//instructions changed by +7.3% (🟥).
Minor changes (1)
  • channel.lean//instructions changed by +0.5% (🟥).

@tydeu tydeu changed the title feat: lake: resolve module clashes between packages feat: lake: resolve module clashes between packages on import Nov 21, 2025
@tydeu tydeu changed the title feat: lake: resolve module clashes between packages on import feat: lake: resolve module clashes on import Nov 21, 2025
@tydeu tydeu force-pushed the lake/disambiguate-mods branch from f8a07d6 to 8799c0c Compare November 21, 2025 22:08
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Nov 21, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Nov 21, 2025
@leanprover-community-bot leanprover-community-bot added the builds-mathlib CI has verified that Mathlib builds against this PR label Nov 22, 2025
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 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.

4 participants