Skip to content

Insert '--' terminator before the sandboxed command in buildLandrunArgs - #60

Merged
hargoniX merged 1 commit into
leanprover:masterfrom
matteo-ax:landrun-flag-terminator
Jul 31, 2026
Merged

Insert '--' terminator before the sandboxed command in buildLandrunArgs#60
hargoniX merged 1 commit into
leanprover:masterfrom
matteo-ax:landrun-flag-terminator

Conversation

@matteo-ax

Copy link
Copy Markdown
Contributor

landrun's CLI parser continues flag-scanning past positionals and consumes the first bare -- in the command tail. safeExport passes exactly such a -- to lean4export as the module/declaration separator (#[module.toString, "--"]), so lean4export receives the declaration names as module names and fails with:

uncaught exception: unknown module prefix 'wielandt_wintner'
No directory 'wielandt_wintner' or file 'wielandt_wintner.olean' in the search path entries: …

(lean4export v4.31.0 supports the -- separator via args.span (· != "--") — the separator simply never reaches it.)

One-line fix: add the explicit flag terminator before the command in buildLandrunArgs, which also hardens the other sandboxed invocations (lake build, nanoda) against any future -- in their argument lists.

Verified end-to-end on a real project (4-theorem config): with this patch the export, statement comparison, and axiom check all complete; without it the run dies at export.

🤖 Generated with Claude Code

landrun's CLI parser continues flag-scanning past positionals and consumes the
first bare '--' in the command tail. safeExport passes exactly such a '--' to
lean4export as the module/declaration separator, so lean4export receives the
declaration names as module names and fails with 'unknown module prefix'.

Adding the explicit flag terminator before the command protects every sandboxed
invocation's arguments.
@hargoniX

Copy link
Copy Markdown
Member

Can you provide a test that did not pass before but passes now? The bug in the generality you are describing it would just cause everything to currently be broken would it not?

@hargoniX

Copy link
Copy Markdown
Member

Oh, it seems this is a new landrun development that we should catch in this way, great!

@hargoniX
hargoniX merged commit 552bad1 into leanprover:master Jul 31, 2026
1 check passed
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