Skip to content

feat: lake: precompileLibrary & precompileImports - #15015

Merged
tydeu merged 5 commits into
leanprover:masterfrom
tydeu:lake/precompile-split
Sep 5, 2026
Merged

feat: lake: precompileLibrary & precompileImports#15015
tydeu merged 5 commits into
leanprover:masterfrom
tydeu:lake/precompile-split

Conversation

@tydeu

@tydeu tydeu commented Sep 4, 2026

Copy link
Copy Markdown
Member

This PR adds two new configuration options that are subsets of precompileModules: precompileLibrary for lean_lib targets and precompileImports for all Lean configurations (e.g., settable on package, lean_lib, or lean_exe). precompileImports compiles a module's imports but not the module itself. precompileLibrary compiles the whole library for importers, but the library's modules do not compile their own imports during elaboration.

Closes #2757 with the finer-grain precompileLibrary instead of the more general precompilePackage.

@tydeu tydeu added the changelog-lake Lake label Sep 4, 2026
@github-actions github-actions Bot added toolchain-available A toolchain is available for this PR, at leanprover/lean4-pr-releases:pr-release-NNNN mathlib4-nightly-available A branch for this PR exists at leanprover-community/mathlib4-nightly-testing:lean-pr-testing-NNNN labels Sep 4, 2026
@leanprover-bot

leanprover-bot commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Reference manual CI status:

@leanprover-bot leanprover-bot added the breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. label Sep 4, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added the breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan label Sep 4, 2026
@mathlib-lean-pr-testing

mathlib-lean-pr-testing Bot commented Sep 4, 2026

Copy link
Copy Markdown

Mathlib CI status (docs):

@tydeu

tydeu commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Sep 4, 2026

Copy link
Copy Markdown

Benchmark results for aec9733 against e991a05 are in. No significant results found. @tydeu

  • 🟥 build//instructions: +1.9G (+0.02%)

Small changes (6🟥)

  • 🟥 build/module/Lake.CLI.Translate.Lean//instructions: +138.7M (+0.95%)
  • 🟥 build/module/Lake.CLI.Translate.Toml//instructions: +100.1M (+1.45%)
  • 🟥 build/module/Lake.Config.LeanConfig//instructions: +137.5M (+3.94%) (reduced significance based on *//lines)
  • 🟥 build/module/Lake.Config.LeanLib//instructions: +50.2M (+2.64%)
  • 🟥 build/module/Lake.Config.LeanLibConfig//instructions: +101.9M (+4.81%) (reduced significance based on *//lines)
  • 🟥 build/module/Lake.Load.Toml//instructions: +120.3M (+0.92%)

@tydeu

tydeu commented Sep 4, 2026

Copy link
Copy Markdown
Member Author

!bench

@leanprover-radar

leanprover-radar commented Sep 4, 2026

Copy link
Copy Markdown

Benchmark results for 31a6a7f against e991a05 are in. No significant results found. @tydeu

  • 🟥 build//instructions: +1.7G (+0.01%)

Medium changes (2🟥)

  • 🟥 compiled/liasolver//task-clock: +20ms (+11.47%)
  • 🟥 compiled/liasolver//wall-clock: +20ms (+11.49%)

Small changes (7🟥)

  • 🟥 build/module/Lake.CLI.Translate.Lean//instructions: +126.3M (+0.87%)
  • 🟥 build/module/Lake.CLI.Translate.Toml//instructions: +105.1M (+1.52%)
  • 🟥 build/module/Lake.Config.LeanConfig//instructions: +140.4M (+4.02%) (reduced significance based on *//lines)
  • 🟥 build/module/Lake.Config.LeanLib//instructions: +51.5M (+2.71%)
  • 🟥 build/module/Lake.Config.LeanLibConfig//instructions: +102.8M (+4.85%) (reduced significance based on *//lines)
  • 🟥 build/module/Lake.Load.Toml//instructions: +100.1M (+0.77%)
  • 🟥 vcgen/AdcChain/250/vcgen//wall-clock: +5ms (+9.34%)

mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 4, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 4, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Sep 4, 2026
tydeu and others added 5 commits September 4, 2026 12:57
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@tydeu
tydeu force-pushed the lake/precompile-split branch from 31a6a7f to 77bef28 Compare September 4, 2026 12:57
mathlib-nightly-testing Bot pushed a commit to leanprover-community/batteries that referenced this pull request Sep 4, 2026
leanprover-bot added a commit to leanprover/reference-manual that referenced this pull request Sep 4, 2026
mathlib-nightly-testing Bot pushed a commit to leanprover-community/mathlib4-nightly-testing that referenced this pull request Sep 4, 2026
@mathlib-lean-pr-testing mathlib-lean-pr-testing Bot added builds-mathlib CI has verified that Mathlib builds against this PR and removed breaks-mathlib This is not necessarily a blocker for merging: but there needs to be a plan labels Sep 4, 2026
@tydeu
tydeu marked this pull request as ready for review September 5, 2026 16:52
@tydeu
tydeu added this pull request to the merge queue Sep 5, 2026
Merged via the queue into leanprover:master with commit c155094 Sep 5, 2026
35 checks passed
@tydeu
tydeu deleted the lake/precompile-split branch September 5, 2026 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaks-manual This is not necessarily a blocker for merging, but there needs to be a plan. builds-mathlib CI has verified that Mathlib builds against this PR changelog-lake Lake 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.

Option for precompiling whole packages

3 participants