RFC: `lake shake` over the roots of two or more executables in one call
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Idoneità per principianti
- 25/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- tooling
Direzione di ricerca
Read Lake/CLI/Shake.lean for lake shake root handling and Lean/Environment.lean around ImportState.markAllExported; the proposal identifies both as change locations. The linked branch includes a test, so inspect it for the expected behavior and run the relevant Lake shake tests. Done means multiple executable roots are handled together, including grouped imports, with suggestions or --fix applied only after every group succeeds.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Proposal
lake shake refuses the roots of two or more executables in one call: each declares main, and loading them into one environment fails in finalizeImport:
error: import B failed, environment already contains 'main' from A
A project with two or more executables runs one lake shake per root, each loading its whole import closure again. Each call sees only the modules under its own roots, and on a project of ours, applying the suggestions of separate calls for two of its modules alone left five others unbuildable.
The proposal is to accept such roots in one call:
- Before
finalizeImport, everymainpast the first, with the declarations its own module names under it, gets a name of its own,<module>._shake_main, in its module and the modules importing it. - When the roots' modules don't load together, each root joins the first group whose modules, with its own, do, the groups checked within one process, each analysing the modules under all of the call's roots, so an edit in one group reaches the modules of a later group.
- With two groups or more, suggestions are printed, and
--fixwrites files, only once every group has succeeded;--add-downstreamis refused when the roots are split into groups.
User experience: one call checks all of a project's executables together, and when a module's re-export is removed, its dependents in other executables are told to import what they use.
Beneficiaries: projects with two or more executables. On a project of ours (not public) of 120 modules and 45 executables, one patched call over every module took 5.36 s of wall time, against 15.99 s for one unpatched call per module, 25 at a time.
Maintainability: the change adds to Lean/Environment.lean a structure and five functions on ImportState, documented as intended for shake only, beside ImportState.markAllExported, and the grouping to Lake/CLI/Shake.lean. A branch with the change and a test is ready. It was compiled and tested on the Lean nightly nightly-2026-11-16, whose Environment.lean and Shake.lean are those of the commit it is based on, and measured on v4.36.0-rc2.
Community Feedback
An issue search for shake found none about two or more executables in one call.
- Lingua principale
- Lean
- Stelle
- 10.3k
- Fork
- 1.1k
- Merge medio
- 19h 8m
- PR unite (30g)
- 421
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di leanprover/lean4
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16681 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
leanprover/lean4#16305 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
leanprover/lean4#16299 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
leanprover/lean4#16257 ·
I maintainer di solito rispondono entro 1 giorno
-
`IO.FS.realPath` reports every failure as `noFileOrDirectory` instead of classifying by `errno`Apertabug
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
leanprover/lean4#15683 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di leanprover/lean4
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 80/100
speakeasy-api/speakeasy#2159 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
hubverse-org/hubDevs#83 ·
-
garden
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
taecontrol/google-accounts-mcp#92 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
I maintainer di solito rispondono entro 1 giorno