leanprover / leanprover/lean4

lake build accepting flags but not running them

Open
#12,907 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug Lake P-medium
Dominant language
Lean
Stars
9.2k
Forks
990
Avg merge
1d 17h
Merged PRs (30d)
175

Description

Description

Inside a lake project, lake build would accept the flag --tstack=n however will ignore. A work-around is to add it to lakefile.toml (.lean alternatively) as moreLeanArgs = ["--tstack=n"].

Context

I have this large file (~40k loc) that woud throw stack overflow with the available stack in "4.28.0"
#lean4 > Stack overflow while working STT

Steps to Reproduce

I guess the best way to reproduce the file is to have a big file that throws and stack overflow error.

  1. run lake build -- -tstack=n in a lean4 project.
  2. after overflow error, add moreLeanArgs = ["--tstack=n"] to your lakefile.toml (.lean) file

Expected behavior: To build the file after first step.

Actual behavior: lake ignores the flag unless is given in the lakefile.toml (.lean) file

Versions

[Output of #version or #eval Lean.versionString] "4.28.0"
[OS version, if not using live.lean-lang.org.] 6.12.73+deb13-amd64 (64-bit)

Contributor guide

Open the contributing guide

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 by reproducing the behavior with lake build -- -tstack=n in a Lean 4 project, then compare it with moreLeanArgs = ["--tstack=n"] in lakefile.toml or a .lean lakefile. Done means the command-line flag is honored and the large-file build no longer requires the lakefile workaround.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.