-
Notifications
You must be signed in to change notification settings - Fork 128
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
doc: add tips about lake usage #510
base: lean4
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for writing this! I have a left minor comments, mostly about copy-editing/grammar.
Co-authored-by: grunweg <[email protected]>
Thank you @grunweg for the review! I completely forgot this PR, but now I've addressed all your suggestions |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR was mentioned again on Zulip today, so I thought I should take another look. Below are some comments I had on on the shared mathlib section. In regards to the local versions section, the next version of Lake should, hopefully, have some built-in support local versions of dependency, making that section much less hacky. :-)
```bash | ||
rm -rf .lake # because `lake clean` does not remove `.lake/packages/mathlib` which might have been downloaded by `lake new`. | ||
lake clean # or potentially `lake update -R mathlib` instead | ||
``` | ||
*(note: it looks like a bug that with a simple `lake clean`, there might still be a folder `.lake/packages/mathlib` floating around from before you changed the `lakefile.lean`. However, deleting `.lake/` is a reasonably safe action as it only contains build artifacts that are fully recovered by the next `lake` call.)* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
```bash | |
rm -rf .lake # because `lake clean` does not remove `.lake/packages/mathlib` which might have been downloaded by `lake new`. | |
lake clean # or potentially `lake update -R mathlib` instead | |
``` | |
*(note: it looks like a bug that with a simple `lake clean`, there might still be a folder `.lake/packages/mathlib` floating around from before you changed the `lakefile.lean`. However, deleting `.lake/` is a reasonably safe action as it only contains build artifacts that are fully recovered by the next `lake` call.)* | |
```bash | |
lake update -R mathlib # use the new path for mathlib | |
rm -rf .lake/packages/mathlib # delete the previous local clone of mathlib | |
``` |
lake update -R mathlib
should be enough to switch to the relative mathlib. If not, that is a bug. Also, lake clean
does not delete Lake packages, it merely removes build outputs.
6) When you updated your global mathlib it might be enough to call | ||
``` | ||
lake update -R mathlib | ||
``` | ||
which would in theory update everything automatically. | ||
However, if there are breaking changes to the `lakefile` parsing, you might need to | ||
* edit `lean-toolchain` to be the same as your global mathlib. | ||
* make sure `lakefile.lean` parses without error in the new version. | ||
* try `lake update -R mathlib` again. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
6) When you updated your global mathlib it might be enough to call | |
``` | |
lake update -R mathlib | |
``` | |
which would in theory update everything automatically. | |
However, if there are breaking changes to the `lakefile` parsing, you might need to | |
* edit `lean-toolchain` to be the same as your global mathlib. | |
* make sure `lakefile.lean` parses without error in the new version. | |
* try `lake update -R mathlib` again. | |
6) Updating your global mathlib should, in theory, update everything automatically. | |
However, if there are breaking changes to the `lakefile` parsing, you might need to | |
* edit `lean-toolchain` to be the same as your global mathlib. | |
* make sure `lakefile.lean` parses without error in the new version. | |
* try whatever broke again. |
You should not need to lake update
a relative dependency. (as path dependencies are not versioned).
Adding some notes about custom setups that are possible with a
lakefile.lean
, in particular how to use a single sharedmathlib
in multiple projects.This might be useful for people with little disk space as well as for teaching setups where it might be reasonable to have a single
mathlib
on a shared drive and then have students reference this instead of downloading their own copy.