Zulip Chat Archive
Stream: mathlib4
Topic: How does build & deploy document for Mathlib4 currently?
SnO2WMaN (Oct 13 2024 at 09:15):
According to https://github.com/leanprover-community/mathlib4/pull/14229, I know "meta if" in mathlib's lakefile.lean
for doc-gen has veen removed. And we want to remove "meta if" in our project because it's troublesome when we update deps. However, I think if it's removed, we won't generate & deploy the documentation, so I have a question. What is the workflow for build and deploy Mathlib4 documentation currently? As I saw It seems not to be found way in mathlib4 repository.
Ruben Van de Velde (Oct 13 2024 at 11:03):
@Kim Morrison may have the link on hand; it's in a separate repository
Henrik Böving (Oct 13 2024 at 11:33):
https://github.com/leanprover-community/mathlib4_docs
Notification Bot (Oct 13 2024 at 22:00):
SnO2WMaN has marked this topic as resolved.
Filippo A. E. Nuccio (Oct 14 2024 at 14:07):
Probably related to this problem : I am trying to build an old mathlib
doc for a teaching project for which I do not want to update mathlib. @Yaël Dillies 's suggestion was simply to import Mathlib
in the main lean file
and then to build the doc
for the project, as this will build the doc for every mathlib file in the project, which will be the "right, old" ones. Unfortunately I cannot make this work, although I followed the instructions here
https://github.com/leanprover/doc-gen4
Notification Bot (Oct 14 2024 at 14:07):
Filippo A. E. Nuccio has marked this topic as unresolved.
Filippo A. E. Nuccio (Oct 14 2024 at 14:08):
Are those instructions still up-to-date?
Henrik Böving (Oct 14 2024 at 15:05):
You don't need to import Mathlib at the top level, doc-gen picks up on the transitive dependencies of all your files on its own.
Henrik Böving (Oct 14 2024 at 15:05):
And the instructions are correct yes
Filippo A. E. Nuccio (Oct 14 2024 at 15:10):
Well, but I only want the mathlib doc, so I only import mathlib, no?
Filippo A. E. Nuccio (Oct 14 2024 at 15:11):
What I mean is that all other files will be classes, and I do not want any doc for them.
Filippo A. E. Nuccio (Oct 14 2024 at 15:17):
And at any rate I get an error, that begins with
$ lake -R -Kenv=dev build M2Lyon2425:docs
✖ [7/10123] Building DocGen4.Process.Hierarchy
trace: .> LEAN_PATH=.\.\.lake/packages\batteries\.lake\build\lib;.\.\.lake/packages\Qq\.lake\build\lib;.\.\.lake/packages\aesop\.lake\build\lib;.\.\.lake/packages\proofwidgets\.lake\build\lib;.\.\.lake/packages\Cli\.lake\build\lib;.\.\.lake/packages\importGraph\.lake\build\lib;.\.\.lake/packages\mathlib\.lake\build\lib;.\.\.lake/packages\MD4Lean\.lake\build\lib;.\.\.lake/packages\UnicodeBasic\.lake\build\lib;.\.\.lake/packages\BibtexQuery\.lake\build\lib;.\.\.lake/packages\doc-gen4\.lake\build\lib;.\.\.lake\build\lib PATH c:\Users\nf51454h\.elan\toolchains\leanprover--lean4---v4.11.0-rc2\bin\lean.exe .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean -R .\.\.lake/packages\doc-gen4\.\. -o .\.\.lake/packages\doc-gen4\.lake\build\lib\DocGen4\Process\Hierarchy.olean -i .\.\.lake/packages\doc-gen4\.lake\build\lib\DocGen4\Process\Hierarchy.ilean -c .\.\.lake/packages\doc-gen4\.lake\build\ir\DocGen4\Process\Hierarchy.c --json
error: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:80:23: unknown identifier 'Std.HashSet'
error: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:81:2: unknown identifier 'Std.HashSet.ofList'
warning: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:111:4: declaration uses 'sorry'
error: Lean exited with code 1
Ruben Van de Velde (Oct 14 2024 at 15:41):
Sounds like your version of doc-gen doesn't agree with your version of lean
Filippo A. E. Nuccio (Oct 16 2024 at 08:49):
Indeed, you're right. I was using v4.11.0-rc2
but doc-gen is now based upon 4.13.0-rc1
. Now I do not know how to proceed:
- If I change the
lean-toolchain
my project does not build anymore, because I need tolake update
and I don't think I want to do this basically for the same reason that put me in this situation: I do not want to updatemathlib
because all students have already started working on some version that I do not want to touch. - I tried changing
"https://github.com/leanprover/doc-gen4" @ "main"
with"https://github.com/leanprover/doc-gen4" @ "114aabc6f0f8d117eb1a853c0dc1591126d9c559"
(pointing to this commit) but this does not seem to work.
Any idea?
Ruben Van de Velde (Oct 16 2024 at 08:51):
Did you lake update
after that?
Filippo A. E. Nuccio (Oct 16 2024 at 08:54):
Well, as explained in 1. I do not want to do this...
Yaël Dillies (Oct 16 2024 at 08:55):
lake update
with a pinned dependency won't actually update past the pinned version
Yaël Dillies (Oct 16 2024 at 08:56):
So you should lake update
to see what happens. It won't change the toolchain
Filippo A. E. Nuccio (Oct 16 2024 at 08:57):
Well, but as @Ruben Van de Velde said if my toolchain is not aligned with the lean version in doc-gen
I get an error.
Filippo A. E. Nuccio (Oct 16 2024 at 08:59):
I think that if I change the toolchain and I lake update
with a pinned version of mathlib
, this could work (I can try, actually, I am on a trial branch)...
Filippo A. E. Nuccio (Oct 16 2024 at 08:59):
Let me try
Ruben Van de Velde (Oct 16 2024 at 09:09):
My point is, just changing lakefile.lean
doesn't help, you also need to update the json to match the commit you put in the the lakefile
Filippo A. E. Nuccio (Oct 16 2024 at 09:11):
Ah, I see. But in the json
should I update the commit for doc-gen only or for all the other dependencies?
Ruben Van de Velde (Oct 16 2024 at 09:18):
I guess lake update doc-gen4
might work?
Filippo A. E. Nuccio (Oct 16 2024 at 09:32):
Let me try
Kevin Buzzard (Oct 16 2024 at 09:54):
If only there were a lake downdate
Filippo A. E. Nuccio (Oct 16 2024 at 15:15):
No, unfortunately after lake update
although my lake build
gives no error, I am still stuck with the following
$ lake -R -Kenv=dev build M2Lyon2425:docs
✖ [7/10123] Building DocGen4.Process.Hierarchy
trace: .> LEAN_PATH=.\.\.lake/packages\batteries\.lake\build\lib;.\.\.lake/packages\Qq\.lake\build\lib;.\.\.lake/packages\aesop\.lake\build\lib;.\.\.lake/packages\proofwidgets\.lake\build\lib;.\.\.lake/packages\Cli\.lake\build\lib;.\.\.lake/packages\importGraph\.lake\build\lib;.\.\.lake/packages\mathlib\.lake\build\lib;.\.\.lake/packages\MD4Lean\.lake\build\lib;.\.\.lake/packages\UnicodeBasic\.lake\build\lib;.\.\.lake/packages\BibtexQuery\.lake\build\lib;.\.\.lake/packages\doc-gen4\.lake\build\lib;.\.\.lake\build\lib PATH c:\Users\nf51454h\.elan\toolchains\leanprover--lean4---v4.11.0-rc2\bin\lean.exe .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean -R .\.\.lake/packages\doc-gen4\.\. -o .\.\.lake/packages\doc-gen4\.lake\build\lib\DocGen4\Process\Hierarchy.olean -i .\.\.lake/packages\doc-gen4\.lake\build\lib\DocGen4\Process\Hierarchy.ilean -c .\.\.lake/packages\doc-gen4\.lake\build\ir\DocGen4\Process\Hierarchy.c --json
error: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:80:23: unknown identifier 'Std.HashSet'
error: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:81:2: unknown identifier 'Std.HashSet.ofList'
warning: .\.\.lake/packages\doc-gen4\.\.\DocGen4\Process\Hierarchy.lean:111:4: declaration uses 'sorry'
error: Lean exited with code 1
Filippo A. E. Nuccio (Oct 16 2024 at 18:30):
I am still completely stuck. I think I have tried all possible combinations of
- Manually changing the
lakefile
- running
lake update
- running
lake update doc-gen4
and I still get all sort of errors. @Ruben Van de Velde or @Henrik Böving , do you have any idea?
Filippo A. E. Nuccio (Oct 17 2024 at 14:50):
Well, I realized that after lake update
even if I manually change the lakefile
to leanprover/lean4:v4.13.0-rc1
, it gets reverted immediately to leanprover/lean4:v4.11.0-rc1
, probably because I am forcing the mathlib
rev to be an old one what used that version of lean. So I do not really know how to follow @Ruben Van de Velde 's suggestion of having lean and doc-gen4 being aligned on the same version.
Last updated: May 02 2025 at 03:31 UTC