Skip to content

chore(build): silence Lake's module-system warning with allowNonModules - #39

Merged
arademaker merged 1 commit into
mainfrom
chore/allow-non-modules
Oct 19, 2026
Merged

arademaker merged 1 commit into
mainfrom
chore/allow-non-modules

Conversation

@arademaker

Copy link
Copy Markdown
Member

Mathlib sets requiresModuleSystem, so since v4.35.0 Lake warns on every Mathlib import from a file without a module header ("consider adding module to the start of this file"). The chapters stay out of the module system on purpose for now; this sets allowNonModules = true in lakefile.toml and in the lakefile template of the generated per-variant projects (CSwLMeta/Save/Project.lean).

Adopting the module system is tracked in #38.

Verified locally: make all builds all four variants with no module-system warnings; the generated projects carry allowNonModules = true, and the solutions project compiles standalone.

This change was prepared with the assistance of Claude Code (Anthropic); all edits were reviewed by the author.

Mathlib sets requiresModuleSystem, so Lake warns on every Mathlib
import from a file without a `module` header. The chapters stay out
of the module system on purpose; declare that in CSwL's lakefile and
in the lakefile of the generated per-variant projects. Adopting the
module system is tracked in #38.

This change was prepared with the assistance of Claude Code (Anthropic);
all edits were reviewed by the author.
Copilot AI balanced review requested due to automatic review settings October 19, 2026 00:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both configuration changes consistently implement the intended warning suppression, with no blocking issues identified.

No open issues 🎉

What changed in this PR

Suppresses Lake’s module-system warnings while keeping chapters outside the module system, pending the decision tracked in #38.

Changes:

  • Enables allowNonModules in the main package and generated variant projects.
  • Documents the reason for the opt-out.
File Description
lakefile.toml Enables and explains package-wide warning suppression.
CSwLMeta/​Save/​Project.lean Adds the same setting to generated project configurations.

Review effort: Balanced

@arademaker
arademaker merged commit 7531b2a into main Oct 19, 2026
2 checks passed
@arademaker
arademaker deleted the chore/allow-non-modules branch October 19, 2026 00:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants