leanprover / leanprover/lean4-cli

CLI fails silently on v4.30.0+ when using module system

Open
#89 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
120
Forks
30
Avg merge
5m
Merged PRs (30d)
4

Description

Up to v4.29.1, it was possible to use the module system for the entry point of an executabl (Main.lean in the template lake projects). In v4.30.0 this will cause lean4-cli to fail silently resulting in a no-op when the executable is called.

Reproduction

I've created an MWE-repo with 2 commits, one working in v4.29.1 and one failing in v4.30.0:

https://github.com/joneugster/lean-cli-bug-demo/commits/main/

The key is that Main.lean contains

module

...

public meta def main (args : List String) : IO UInt32 :=
  i18n.validate args

If module is removed from Main.lean turning it into a plain Lean file, it works again.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the linked two-commit MWE repository and compare its behavior under v4.29.1 and v4.30.0, focusing on Main.lean and its module declaration. Trace how lean4-cli discovers and invokes the public meta main entry point. Done means a module-based Main.lean executes normally instead of silently becoming a no-op, while the existing plain-file case still works.

Written by the indexing model from the issue text.

Assessment

Domain
cli, compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.