Skip to content

fix: detect TOML lean_lib modules for nanoda - #187

Open
SMC17 wants to merge 2 commits into
leanprover:mainfrom
SMC17:fix/nanoda-top-level-toml-main
Open

fix: detect TOML lean_lib modules for nanoda#187
SMC17 wants to merge 2 commits into
leanprover:mainfrom
SMC17:fix/nanoda-top-level-toml-main

Conversation

@SMC17

@SMC17 SMC17 commented Aug 20, 2026

Copy link
Copy Markdown

This PR fixes nanoda module discovery for current Lake TOML projects.

lake init name .toml emits a top-level package name and a distinct [[lean_lib]] module name. The nanoda runner previously searched only for a legacy [package] section and failed before independent checking. Reading the package name alone would also be incorrect when its spelling differs from the Lean module root.

The detector now prefers the first lean_lib name and retains the old first-name fallback for compatibility. A functional test generates a standard TOML package and requires the nanoda status to be SUCCESS with sorryAx disabled.

Supersedes #168: that branch had diverged from main and GitHub marked it CONFLICTING even though the intended file-level change is these four paths. This branch is current leanprover/main plus:

  • scripts/run_nanoda.sh — prefer [[lean_lib]] name
  • CHANGELOG.md — Unreleased note
  • .github/workflows/functional_tests.ymlnanoda-toml-package job
  • .github/functional_tests/nanoda_toml/action.yml — fixture

Configurable nanoda module selection remains out of scope here and is tracked in #179 / #180.

Prefer the first [[lean_lib]] name when exporting for nanoda. Current
`lake init name .toml` emits a package name distinct from the Lean
module root, so searching only for a legacy [package] section fails.
Full nanoda SUCCESS is blocked by leanprover#169 (debug-branch NDJSON parse).
The fixture now runs run_nanoda.sh in detect-only mode against
`lake init name .toml` and requires the lean_lib module name.
@SMC17

SMC17 commented Aug 20, 2026

Copy link
Copy Markdown
Author

Ready for review. GitHub has not started Actionlint / Functional Tests / ShellCheck on this fork PR (action_required — first-time contributor). A maintainer Approve and run workflows is the next click.

What this PR does: lake init foo .toml currently has package name foo and lean_lib name Foo. nanoda has to export the module, not the package. scripts/run_nanoda.sh now prefers the first [[lean_lib]] name.

What this PR does not do: it does not fix nanoda Error: invalid digit found in string on current Lean 4.28 export (that is #169 / #177, debug-branch NDJSON). The new nanoda-toml-package job asserts detection (Nanodatoml vs nanodatoml) only.

Preview on the fork (including nanoda-toml-package green in 24s): https://github.com/SMC17/lean-action/actions/runs/32407274723

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.

1 participant