Skip to content

Conversation

@tydeu
Copy link
Member

@tydeu tydeu commented May 23, 2025

This PR makes use of lean --setup in Lake builds of Lean modules and adds Lake support for the new .olean artifacts produced by the module system.

Lake now computes the entire transitive import graph of a module for Lean, allowing it eagerly provide the artifacts managed by Lake to Lean via the modules field of lean --setup.

lake setup-file no longer respects the imports passed to it and instead just parses the file's header for imports. This is necessary because import statements are now more complex than a simple module name.

@tydeu tydeu added the changelog-lake Lake label May 23, 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 May 24, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request May 24, 2025
@tydeu tydeu force-pushed the lake/lean-setup branch from 287a213 to 29fbeab Compare June 2, 2025 18:52
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 2, 2025
@tydeu tydeu force-pushed the lake/lean-setup branch from 04347d2 to 2a18e3c Compare June 7, 2025 07:08
@tydeu tydeu force-pushed the lake/lean-setup branch from 2a18e3c to d69fcc1 Compare June 8, 2025 00:44
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 8, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 8, 2025
@tydeu tydeu added the release-ci Enable all CI checks for a PR, like is done for releases label Jun 8, 2025
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 8, 2025
@tydeu tydeu removed the release-ci Enable all CI checks for a PR, like is done for releases label Jun 8, 2025
@tydeu tydeu force-pushed the lake/lean-setup branch from ba2b05b to ba6b4db Compare June 8, 2025 05:47
@tydeu tydeu marked this pull request as ready for review June 8, 2025 05:48
leanprover-community-mathlib4-bot added a commit to leanprover-community/batteries that referenced this pull request Jun 8, 2025
@tydeu tydeu added this pull request to the merge queue Jun 8, 2025
Merged via the queue into leanprover:master with commit fcaae1d Jun 8, 2025
16 checks passed
@tydeu tydeu deleted the lake/lean-setup branch June 9, 2025 15:42
github-merge-queue bot pushed a commit that referenced this pull request Jun 10, 2025
This PR exports `LeanOption` in the `Lean` namespace from the `Lake`
namespace. `LeanOption` was moved from `Lean` to `Lake` in #8447, which
can cause unnecessary breakage without this.
@tydeu
Copy link
Member Author

tydeu commented Jun 17, 2025

!bench

@leanprover-bot
Copy link
Collaborator

Here are the benchmark results for commit ba6b4db.
There were significant changes against commit 0339cd2:

  Benchmark                            Metric            Change
  ========================================================================
+ Init.Data.BitVec.Lemmas re-elab      branch-misses      -1.3%  (-21.7 σ)
+ Init.Data.List.Sublist re-elab -j4   wall-clock         -1.3% (-322.4 σ)
- lake build clean                     instructions       40.5%  (156.2 σ)
- lake build clean                     maxrss             93.8%   (30.1 σ)
- lake build clean                     task-clock         36.5%   (34.8 σ)
- lake build clean                     wall-clock         84.3%   (36.0 σ)
- lake build no-op                     instructions     4639.7%  (101.2 σ)
- lake build no-op                     maxrss             93.7%  (203.0 σ)
- lake build no-op                     task-clock      15514.6%   (20.2 σ)
- lake build no-op                     wall-clock       2438.8%   (73.6 σ)
+ reduceMatch                          wall-clock         -2.3%  (-20.5 σ)
+ stdlib                               task-clock         -1.5%  (-29.2 σ)

github-merge-queue bot pushed a commit that referenced this pull request Jun 18, 2025
This PR reintroduces the basics of `lean --setup` integration into Lake
without the module computation which is still undergoing performance
debugging in #8787.

Partially reverts #8736 and partially reimplements #8447.
algebraic-dev pushed a commit to algebraic-dev/lean4 that referenced this pull request Jun 18, 2025
This PR makes use of `lean --setup` in Lake builds of Lean modules and
adds Lake support for the new `.olean` artifacts produced by the module
system.

Lake now computes the entire transitive import graph of a module for
Lean, allowing it eagerly provide the artifacts managed by Lake to Lean
via the `modules` field of `lean --setup`.

`lake setup-file` no longer respects the imports passed to it and
instead just parses the file's header for imports. This is necessary
because import statements are now more complex than a simple module
name.
algebraic-dev pushed a commit to algebraic-dev/lean4 that referenced this pull request Jun 18, 2025
This PR exports `LeanOption` in the `Lean` namespace from the `Lake`
namespace. `LeanOption` was moved from `Lean` to `Lake` in leanprover#8447, which
can cause unnecessary breakage without this.
algebraic-dev pushed a commit to algebraic-dev/lean4 that referenced this pull request Jun 18, 2025
This PR reintroduces the basics of `lean --setup` integration into Lake
without the module computation which is still undergoing performance
debugging in leanprover#8787.

Partially reverts leanprover#8736 and partially reimplements leanprover#8447.
wkrozowski pushed a commit to wkrozowski/lean4 that referenced this pull request Jun 24, 2025
This PR reintroduces the basics of `lean --setup` integration into Lake
without the module computation which is still undergoing performance
debugging in leanprover#8787.

Partially reverts leanprover#8736 and partially reimplements leanprover#8447.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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.

2 participants