Zulip Chat Archive

Stream: mathlib4

Topic: docPrime hell


Patrick Massot (Jan 07 2025 at 18:09):

Moving the discussion here to avoid cluttering the other thread: is it known that docPrime will flood lake build output for downstream project if there is nothing to build? I mean nothing in Mathlib and nothing in the downstream project.

Patrick Massot (Jan 07 2025 at 18:09):

Note that this happens in a situation where I don’t have oleans for all files in Mathlib, only for the files that are imported in my project.

Patrick Massot (Jan 07 2025 at 18:10):

Maybe I could un-xy this to: could we simply turn this linter off until it behaves properly?

Jireh Loreaux (Jan 07 2025 at 18:11):

If you are building Mathlib from scratch, can you not just update the lakefile to disable the linter?

Jireh Loreaux (Jan 07 2025 at 18:11):

oh nevermind, you're getting a partial cache, not building from scratch.

Patrick Massot (Jan 07 2025 at 18:11):

You mean the Mathlib lakefile?

Patrick Massot (Jan 07 2025 at 18:12):

To be honest the partial cache thing seems randomly half-broken so I’m actually half building from scratch.

Eric Wieser (Jan 07 2025 at 18:39):

"nothing to build" happens here because you flooded the build logs when you built it the first time, and lake now regurgitates these on a noop build.

Patrick Massot (Jan 07 2025 at 18:40):

And why does it feel the need to do that? It takes forever too.

Eric Wieser (Jan 07 2025 at 18:41):

The initial flooding is a linter bug

Patrick Massot (Jan 07 2025 at 18:41):

I feel closer and closer to simply switching back to Lean 3 and hope things will get usable next year.

Eric Wieser (Jan 07 2025 at 18:42):

The regurgitation of all messages is a feature, because it means you don't miss the previous warnings

Patrick Massot (Jan 07 2025 at 18:42):

Is there any way to switch off this “feature”?

Eric Wieser (Jan 07 2025 at 18:43):

That's a question for @Mac Malone I think

Patrick Massot (Jan 07 2025 at 18:44):

It seems the VSCode extension is less paralyzed than lean.nvim by this behavior, so there is some hope for my students.

Julian Berman (Jan 07 2025 at 18:44):

Yes I'm aware that docPrime basically makes lean.nvim fall over.

Julian Berman (Jan 07 2025 at 18:45):

(The fix is we need to restore the backoff behavior we used to have -- because what happens now is basically the LSP spams us with responses as it goes through the compilation.)

Damiano Testa (Jan 07 2025 at 21:39):

This came up already several times. I think that one of the reasons the linter complains is that it looks for allowed exceptions in the path where the exceptions file exists in mathlib. However, if you have mathlib as a dependency, that path is incorrect. I thought that there were plans to make the searchpath for dependencies be aware of this.

Damiano Testa (Jan 07 2025 at 21:40):

If that is not the case, then I can try to see if I can tease out of lake what the correct path for the exceptions file it: the file will be in rootDir/.lake somewhere, rather than in rootDir/scripts. The main issue is to get the right pathseparators/special names for everything right.

Patrick Massot (Jan 07 2025 at 21:40):

Can I insist that we simply deactivate this linter until the issue is fixed?

Patrick Massot (Jan 07 2025 at 21:41):

I don’t see this linter as being so much mission-critical that it warrants inflicting this pain on any downstream project.

Damiano Testa (Jan 07 2025 at 21:41):

Personally, I am not too attached to the linter: I like the idea of documenting mathlib, but it is unclear whether this linter is achieving it in a reasonable way.

Damiano Testa (Jan 07 2025 at 21:45):

#20559, in case anyone feels strongly enough about this to merge the PR! :smile:

Patrick Massot (Jan 07 2025 at 21:46):

Thanks Damiano. I’ll wait a couple of minutes to see if someone complains before borsing this.

Patrick Massot (Jan 07 2025 at 21:46):

Note this won’t help me because I’m stuck with Lean 4.14.0 anyway…

Eric Wieser (Jan 07 2025 at 21:50):

I delegated modulo opening a tracking issue for actually fixing it

Damiano Testa (Jan 07 2025 at 22:05):

#20560 is the tracking issue.

Damiano Testa (Jan 07 2025 at 22:05):

I'll wait for CI to go green on the PR and merge it.

Kim Morrison (Jan 07 2025 at 22:09):

@Patrick Massot, we can backport #20559 to a version of Mathlib that still uses v4.14.0

Kim Morrison (Jan 07 2025 at 22:10):

e.g. as well as simply having the v4.14.0 tag of Mathlib, we make a releases/v4.14.0 branch of Mathlib (initially starting at that tag), and we can backport critical fixes to that branch.

Eric Wieser (Jan 07 2025 at 22:11):

And them make a v4.14.0-mathlib1 tag on that branch?

Eric Wieser (Jan 07 2025 at 22:11):

Or just tell people to put releases/v4.14.0 in the lakefile if they want "almost v4.14.0 but with future fixes"?

Patrick Massot (Jan 07 2025 at 22:13):

Having this fix and the cc bug fix on a 4.14 Lean would definitely help me.

Patrick Massot (Jan 07 2025 at 22:15):

Or maybe I should forget about using a released Lean, push to remove the on notation from Mathlib master and try to upgrade to 4.16.

Patrick Massot (Jan 07 2025 at 22:18):

I don’t know. I must confess I’m kind of panicking here. My course starts in one week and a half and my two colleagues teaching with me still haven’t tried Lean 4 at all, they are waiting for me to give them instructions about installing Lean 4. During lunch I told one them I had installation size issues and he jokingly answered by asking me how many Gigabytes they needed to allocate. I had to answer that it would indeed be measured in Gigabytes…

Patrick Massot (Jan 07 2025 at 22:21):

Of course for my colleagues the big install is not a real issue, but he simply couldn’t imagine the multiplicative factor from Lean 3 size to Lean 4 size would be 50.

Eric Wieser (Jan 07 2025 at 22:52):

Patrick Massot said:

Or maybe I should forget about using a released Lean, push to remove the on notation from Mathlib master and try to upgrade to 4.16.

Another option is for you to just create a branch of mathlib with whatever quick fixes you need, and run your course from that.

Eric Wieser (Jan 07 2025 at 22:53):

(by pointing to the branch instead of master in the lakefile)

Kim Morrison (Jan 08 2025 at 00:39):

@Patrick Massot, I've just pushed a tag v4.14.0-patch1, which contains

  • #20559 (disabling docPrime linter)
  • #20422 (cc panic issue)

This tag is on the releases/v4.14.0 branch, and we can backport further fixes to that if needed.

Kim Morrison (Jan 08 2025 at 03:08):

@Patrick Massot there's also now v4.15.0-patch1, which contains

  • #20559 (disabling docPrime linter)
  • #20562 (scoping on notation)

Patrick Massot (Jan 08 2025 at 08:53):

Thanks, this is really great. All this boring work with the on notation is really appreciated. I think removing the notation entirely is probably a better idea, but the current patch is enough for me.


Last updated: May 02 2025 at 03:31 UTC