Zulip Chat Archive
Stream: lean4
Topic: lake update issue
Patrick Massot (Aug 28 2023 at 20:05):
Trying to run lake update
in an old project returns:
lake update
updating lake-packages/mathlib to revision 08334f552c6d6d6d8ae7ea02ac6dd2d88f51e083
error: ./lake-packages/mathlib/lakefile.lean:30:2: error: 'weakLeanArgs' is not a field of structure 'Lake.LeanLibConfig'
error: ./lake-packages/mathlib/lakefile.lean:53:2: error: 'weakLeanArgs' is not a field of structure 'Lake.LeanLibConfig'
error: ./lake-packages/mathlib/lakefile.lean: package configuration has errors
It looks like the Lean version of the project is too old to know about weakLeanArgs
.
Patrick Massot (Aug 28 2023 at 20:06):
The project is on nightly-2023-06-20
.
Patrick Massot (Aug 28 2023 at 20:07):
Updating the project lean-toolchain
before running lake update
will probably fix this, but I wanted to point out this isn't super user-friendly.
Mac Malone (Aug 28 2023 at 20:13):
@Patrick Massot Yeah, the underlying issue here is that Lake should parse and compare the lean-toolchain
s of projects and only permit a certain range.
Patrick Massot (Aug 28 2023 at 20:18):
Well, I didn't want to stay on a version without weakLeanArgs
. It sounds like lake missed the point when it should have called the golden instruction cp lake-packages/mathlib/lean-toolchain .
.
Mac Malone (Aug 28 2023 at 20:29):
@Patrick Massot The problem is that Lake itself is too old, so it needs error out and be rerun within a newer lean-toolchain
. It could give an informative error about this, though. Technically, it could also copy the new toolchain, but it would need some help from the user to know which package to take the toolchain from (since there could easily be another dependency which needs an even newer toolchain in the general case).
Kayla Thomas (Sep 29 2023 at 22:30):
I have also been getting this error. I ran elan update
and elan default leanprover/lean4:stable
beforehand. I haven't tried to do any updates for a while and was trying to update both Lean and the mathlib in my project. I'm not sure I understand what I need to do to fix it.
Julian Berman (Sep 29 2023 at 23:22):
@Kayla Thomas does running precisely the 4 steps in this comment work:
Kayla Thomas (Sep 29 2023 at 23:27):
@Julian Berman It did. Thank you!
Kayla Thomas (Sep 29 2023 at 23:28):
Do I need to do anything in addition to that? Did that update mathlib?
Kayla Thomas (Sep 29 2023 at 23:29):
I guess by reading the comment, it did.
Last updated: Dec 20 2023 at 11:08 UTC