Keep tactic modules out of the executable's import closure - #45
Merged
Conversation
The exe was still 114M because two library modules imported *tactic* modules, and a module's `initialize_*` transitively references the initializers of everything it imports — so `Std.Tactic.BVDecide` (Basic.lean) and `Batteries.Tactic.Lint` (Dialect.lean) linked the entire elaborator (libLean, plus libStd/libLake) into every downstream binary, even though tactics only ever run at proof-checking time. * Basic.lean: drop `import Std.Tactic.BVDecide` and the one `bv_decide` sanity example that used it. * Dialect.lean / Dialect/EVMExec.lean: drop `import Batteries.Tactic.Lint`; replace the two derived `Repr` instances whose unused `prec` argument needed `@[nolint unusedArguments]` with handwritten instances that don't trip the linter. Batteries remains a package dependency solely as the `lake lint` driver; no library module imports it anymore. The placeholder executable drops from 114M to 4.3M (2.8M stripped), with zero `Lean.Elab` symbols left in the binary. `lake build`, `lake lint`, and `lake build yul-semantics` all pass; the exe runs. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The exe was still 114M because two library modules imported tactic modules, and a module's
initialize_*transitively references the initializers of everything it imports — soStd.Tactic.BVDecide(Basic.lean) andBatteries.Tactic.Lint(Dialect.lean) linked the entire elaborator (libLean, plus libStd/libLake) into every downstream binary, even though tactics only ever run at proof-checking time.import Std.Tactic.BVDecideand the onebv_decidesanity example that used it.import Batteries.Tactic.Lint; replace the two derivedReprinstances whose unusedprecargument needed@[nolint unusedArguments]with handwritten instances that don't trip the linter.Batteries remains a package dependency solely as the
lake lintdriver; no library module imports it anymore.The placeholder executable drops from 114M to 4.3M (2.8M stripped), with zero
Lean.Elabsymbols left in the binary.lake build,lake lint, andlake build yul-semanticsall pass; the exe runs.