Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - feat: lake exe mk_all as a Lean executable #11853

Closed
wants to merge 26 commits into from

Conversation

adomani
Copy link
Collaborator

@adomani adomani commented Apr 2, 2024

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 adomani added the awaiting-review The author would like community review of the PR label Apr 2, 2024
@YaelDillies YaelDillies added the t-meta Tactics, attributes or user commands label Apr 2, 2024
@adomani adomani changed the title feat: mk_all script implemented in Lean feat: lake exe mkAll as a Lean executable Apr 3, 2024
@YaelDillies
Copy link
Collaborator

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

@joneugster
Copy link
Collaborator

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)

@adomani
Copy link
Collaborator Author

adomani commented Apr 6, 2024

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.

@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot added the merge-conflict The PR has a merge conflict with master, and needs manual merging. label May 2, 2024
@leanprover-community-mathlib4-bot leanprover-community-mathlib4-bot removed the merge-conflict The PR has a merge conflict with master, and needs manual merging. label May 9, 2024
@grunweg
Copy link
Collaborator

grunweg commented May 24, 2024

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

Copy link

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

Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks plausible enough to me but I don't have any real Lean scripting experience so I'm hesitant to give definitive judgement.

scripts/mk_all.lean Outdated Show resolved Hide resolved
scripts/mk_all.lean Show resolved Hide resolved
Copy link
Contributor

@Vierkantor Vierkantor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes! I'm going to hold off on merging as I said, so let's kick this back on the maintainer queue:

maintainer merge

Copy link

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

@grunweg
Copy link
Collaborator

grunweg commented May 29, 2024

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

@semorrison
Copy link
Contributor

bors merge

@github-actions github-actions bot added ready-to-merge This PR has been sent to bors. and removed awaiting-review The author would like community review of the PR labels May 29, 2024
mathlib-bors bot pushed a commit that referenced this pull request May 29, 2024
Running
```bash
lake exe mk_all --git
```
should have the same effect as running
```bash
./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`.

```bash
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.



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
@mathlib-bors
Copy link
Contributor

mathlib-bors bot commented May 29, 2024

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors bot changed the title feat: lake exe mk_all as a Lean executable [Merged by Bors] - feat: lake exe mk_all as a Lean executable May 29, 2024
@mathlib-bors mathlib-bors bot closed this May 29, 2024
@mathlib-bors mathlib-bors bot deleted the adomani/mkAll_in_lean branch May 29, 2024 18:15
mathlib-bors bot pushed a commit that referenced this pull request May 31, 2024
This PR replaces the shell commands for importing all the mathlib libraries by a lean executable defined in #11853.



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Jun 1, 2024
This PR replaces the shell commands for importing all the mathlib libraries by a lean executable defined in #11853.



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
mathlib-bors bot pushed a commit that referenced this pull request Jun 1, 2024
… `scripts` (#13339)

With #13245, two scripts in `scripts` would like to use very similar information:
move it to a central place instead (a file in `Mathlib/Util`). Suggestions for better locations are welcome!

Also, split the `getAll` function in two pieces, getting the file names and transforming this into module names.
While #11853 only requires the latter, #13245 needs the former (which is computed anyway).
Only accessible the converted module names and converting them back to files would be absurd.

- [x] depends on: #11853 which adds these utility functions
callesonne pushed a commit that referenced this pull request Jun 4, 2024
Running
```bash
lake exe mk_all --git
```
should have the same effect as running
```bash
./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`.

```bash
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.



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
callesonne pushed a commit that referenced this pull request Jun 4, 2024
This PR replaces the shell commands for importing all the mathlib libraries by a lean executable defined in #11853.



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
callesonne pushed a commit that referenced this pull request Jun 4, 2024
… `scripts` (#13339)

With #13245, two scripts in `scripts` would like to use very similar information:
move it to a central place instead (a file in `Mathlib/Util`). Suggestions for better locations are welcome!

Also, split the `getAll` function in two pieces, getting the file names and transforming this into module names.
While #11853 only requires the latter, #13245 needs the former (which is computed anyway).
Only accessible the converted module names and converting them back to files would be absurd.

- [x] depends on: #11853 which adds these utility functions
grunweg added a commit that referenced this pull request Jun 7, 2024
This PR replaces the shell commands for importing all the mathlib libraries by a lean executable defined in #11853.



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
grunweg added a commit that referenced this pull request Jun 7, 2024
… `scripts` (#13339)

With #13245, two scripts in `scripts` would like to use very similar information:
move it to a central place instead (a file in `Mathlib/Util`). Suggestions for better locations are welcome!

Also, split the `getAll` function in two pieces, getting the file names and transforming this into module names.
While #11853 only requires the latter, #13245 needs the former (which is computed anyway).
Only accessible the converted module names and converting them back to files would be absurd.

- [x] depends on: #11853 which adds these utility functions
js2357 pushed a commit that referenced this pull request Jun 18, 2024
Running
```bash
lake exe mk_all --git
```
should have the same effect as running
```bash
./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`.

```bash
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.



Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
This PR replaces the shell commands for importing all the mathlib libraries by a lean executable defined in #11853.



Co-authored-by: Michael Rothgang <rothgami@math.hu-berlin.de>
Co-authored-by: Yaël Dillies <yael.dillies@gmail.com>
AntoineChambert-Loir pushed a commit that referenced this pull request Jun 20, 2024
… `scripts` (#13339)

With #13245, two scripts in `scripts` would like to use very similar information:
move it to a central place instead (a file in `Mathlib/Util`). Suggestions for better locations are welcome!

Also, split the `getAll` function in two pieces, getting the file names and transforming this into module names.
While #11853 only requires the latter, #13245 needs the former (which is computed anyway).
Only accessible the converted module names and converting them back to files would be absurd.

- [x] depends on: #11853 which adds these utility functions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
maintainer-merge ready-to-merge This PR has been sent to bors. t-meta Tactics, attributes or user commands
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants