mathlib4 icon indicating copy to clipboard operation
mathlib4 copied to clipboard

feat: `lake exe mk_all` as a Lean executable

Open adomani opened this issue 1 year ago • 6 comments

Running

lake exe mk_all --git

should have the same effect as running

./script/mk_all.sh

that is, it creates the files Mathlib.lean, Mathlib/Tactic.lean, Archive.lean, Counterexamples.lean.

It does not create analogous files for Cache and LongestPole.

lake exe mk_all

is similar, but uses all the .lean files in Mathlib, not just the Git-managed ones.

See #11874 for using the script in CI.


Open in Gitpod

adomani avatar Apr 02 '24 16:04 adomani

@joneugster, do you think the same thing here as on #8361?

YaelDillies avatar Apr 05 '24 09:04 YaelDillies

Not necessarily. I personally care about import-analysis tools being outside of mathlib because I want to use them in my projects without importing mathlib.

But generally, while having separate packages with useful utilities is nice for projects not depending on mathlib, with the current in-development state of lake, it's still quite tedious to keep all packages in sync and up to date...

And finally, it's quite quick to extract useful stuff out of mathlib, once somebody concretely needs it. (The only reason I see to directly PR to a separate repo is that one can save some reviewer capacity if it's only utility-code)

joneugster avatar Apr 06 '24 04:04 joneugster

I also think that "import" requirements are quite project-specific.

Even this tool is not just "import all files and/or all libraries":

  • Cache is not created;
  • Mathlib/Tactic should also be created.

Std has its own tool that does something way more sophisticated.

It seems like one of these commands that are hard to implement in a way that pleases most projects.

adomani avatar Apr 06 '24 07:04 adomani

I just reviewed the script (and some CI bits) in #11874. Summarising what I said there: looks very good, I only have minor comments.

grunweg avatar May 23 '24 18:05 grunweg

Thanks for the quick response! I'll trust Mario and Kim on getLeanLibs, so this PR looks good to go, from my side. maintainer merge

grunweg avatar May 24 '24 17:05 grunweg

🚀 Pull request has been placed on the maintainer queue by grunweg.

github-actions[bot] avatar May 24 '24 17:05 github-actions[bot]

🚀 Pull request has been placed on the maintainer queue by Vierkantor.

github-actions[bot] avatar May 28 '24 10:05 github-actions[bot]

I've proposed moving the common code into Mathlib/Utils in #13339.

grunweg avatar May 29 '24 13:05 grunweg

bors merge

kim-em avatar May 29 '24 17:05 kim-em

Pull request successfully merged into master.

Build succeeded:

mathlib-bors[bot] avatar May 29 '24 18:05 mathlib-bors[bot]