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.

Assessment

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

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.

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.

Dominant language
Lean
Stars
133
Forks
30
Avg merge
2m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

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.

More from leanprover/lean4-cli

All issues in leanprover/lean4-cli

Similar issues

More CLI issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.