Skip to content

[Merged by Bors] - fix(Cache): correctly handle local copies of Mathlib - #8662

Closed
eric-wieser wants to merge 5 commits into
masterfrom
eric-wieser/fix-cache
Closed

eric-wieser wants to merge 5 commits into
masterfrom
eric-wieser/fix-cache

Conversation

@eric-wieser

@eric-wieser eric-wieser commented Nov 27, 2023 •

Copy link
Copy Markdown
Member

This parses the lake-manifest to work out where mathlib is.

Previously this assumed it was in .lake/packages, but this is only true of git packages. As a result, it would fail with:

uncaught exception: no such file or directory (error code: 2)
  file: .lake/packages/mathlib/lakefile.lean

Tested on a blank project created with lake new test math, with require mathlib from "../mathlib4" in the lakefile.


Open in Gitpod

@eric-wieser eric-wieser added awaiting-review awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. labels Nov 27, 2023
@arthurpaulino

Copy link
Copy Markdown
Contributor

Sorry, it's been a while since I've got in touch with this code so my review is definitely unsatisfactory.
But let me ask: is lake-manifest.json guaranteed to always be present when using this or will there be some egg-chicken problem?
In my memory, I wanted to do something like this. But for some reason, my plan of action was to parse the lakefile.lean directly.

@eric-wieser

eric-wieser commented Nov 27, 2023 •

Copy link
Copy Markdown
Member Author

lake-manifest should always be checked in next to the lakefile.

@github-actions github-actions Bot removed the awaiting-CI This PR does not pass CI yet. This label is automatically removed once it does. label Nov 27, 2023
Comment thread Cache/IO.lean Resolved
Comment thread Cache/Hashing.lean Resolved
Comment thread Cache/IO.lean Resolved
@arthurpaulino

Copy link
Copy Markdown
Contributor

lake-manifest should always be checked in next to the lakefile.

Is it there when you first create a project?

@kim-em

kim-em commented Nov 27, 2023

Copy link
Copy Markdown
Contributor

lake-manifest should always be checked in next to the lakefile.

Is it there when you first create a project?

No, sadly, it is not.

Comment thread Cache/IO.lean Resolved
eric-wieser and others added 2 commits November 27, 2023 23:18
Co-authored-by: Scott Morrison <[email protected]>
Co-authored-by: Scott Morrison <[email protected]>
@kim-em

kim-em commented Nov 27, 2023

Copy link
Copy Markdown
Contributor

bors d+

@mathlib-bors

mathlib-bors Bot commented Nov 27, 2023

Copy link
Copy Markdown
Contributor

✌️ eric-wieser can now approve this pull request. To approve and merge a pull request, simply reply with bors r+. More detailed instructions are available here.

@github-actions github-actions Bot added delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). and removed awaiting-review labels Nov 27, 2023
@eric-wieser

Copy link
Copy Markdown
Member Author

bors merge

@github-actions github-actions Bot added the ready-to-merge This PR has been sent to bors. label Nov 28, 2023
mathlib-bors Bot pushed a commit that referenced this pull request Nov 28, 2023
This parses the `lake-manifest` to work out where mathlib is.

Previously this assumed it was in `.lake/packages`, but this is only true of `git` packages. As a result, it would fail with:
```
uncaught exception: no such file or directory (error code: 2)
  file: .lake/packages/mathlib/lakefile.lean
```

Tested on a blank project created with `lake new test math`, with `require mathlib from "../mathlib4"` in the lakefile.
@mathlib-bors

mathlib-bors Bot commented Nov 28, 2023

Copy link
Copy Markdown
Contributor

Pull request successfully merged into master.

Build succeeded:

@mathlib-bors mathlib-bors Bot changed the title fix(Cache): correctly handle local copies of Mathlib [Merged by Bors] - fix(Cache): correctly handle local copies of Mathlib Nov 28, 2023
@mathlib-bors mathlib-bors Bot closed this Nov 28, 2023
@mathlib-bors
mathlib-bors Bot deleted the eric-wieser/fix-cache branch November 28, 2023 00:22
eric-wieser added a commit that referenced this pull request Dec 1, 2023
awueth pushed a commit that referenced this pull request Dec 19, 2023
This parses the `lake-manifest` to work out where mathlib is.

Previously this assumed it was in `.lake/packages`, but this is only true of `git` packages. As a result, it would fail with:
```
uncaught exception: no such file or directory (error code: 2)
  file: .lake/packages/mathlib/lakefile.lean
```

Tested on a blank project created with `lake new test math`, with `require mathlib from "../mathlib4"` in the lakefile.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

delegated This pull request has been delegated to the PR author (or occasionally another non-maintainer). ready-to-merge This PR has been sent to bors.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants