Skip to content

Commit 4dbbb80

Browse files
authored
fix: add bibPrepass dependency to library_facet docs (#354)
The `library_facet docs` includes `references.bib` in its staticFiles array and attempts to compute its trace via `computeTrace`. However, this file is only created by the `bibPrepass` target, which runs before module documentation is generated. Without an explicit dependency on `bibPrepass`, Lake may attempt to compute the trace of `references.bib` before it exists, causing the build to fail with "no such file or directory" errors. This fix adds the missing `bibPrepass` dependency, matching the pattern already used in `module_facet docs` and `coreTarget`. Fixes leanprover-community/docgen-action#18 (the underlying cause)
1 parent 7be6082 commit 4dbbb80

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

lakefile.lean

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -283,6 +283,7 @@ library_facet docs (lib) : Array FilePath := do
283283
let moduleJobs := Job.collectArray <| ← mods.mapM (fetch <| ·.facet `docs)
284284
let coreJobs ← coreDocs.fetch
285285
let exeJob ← «doc-gen4».fetch
286+
let bibPrepassJob ← bibPrepass.fetch
286287
-- Shared with DocGen4.Output
287288
let buildDir := (← getRootPackage).buildDir
288289
let basePath := buildDir / "doc"
@@ -310,18 +311,19 @@ library_facet docs (lib) : Array FilePath := do
310311
basePath / "find" / "index.html",
311312
basePath / "find" / "find.js"
312313
]
313-
exeJob.bindM fun exeFile => do
314-
coreJobs.bindM fun coreDeps => do
315-
moduleJobs.mapM fun modDeps => do
316-
buildFileUnlessUpToDate' dataFile do
317-
logInfo "Documentation indexing"
318-
proc {
319-
cmd := exeFile.toString
320-
args := #["index", "--build", buildDir.toString]
321-
}
322-
let traces ← staticFiles.mapM computeTrace
323-
addTrace <| mixTraceArray traces
324-
return (DepSet.mk (#[dataFile] ++ staticFiles) (modDeps.push (.mk coreDeps #[]))).toArray
314+
bibPrepassJob.bindM fun _ => do
315+
exeJob.bindM fun exeFile => do
316+
coreJobs.bindM fun coreDeps => do
317+
moduleJobs.mapM fun modDeps => do
318+
buildFileUnlessUpToDate' dataFile do
319+
logInfo "Documentation indexing"
320+
proc {
321+
cmd := exeFile.toString
322+
args := #["index", "--build", buildDir.toString]
323+
}
324+
let traces ← staticFiles.mapM computeTrace
325+
addTrace <| mixTraceArray traces
326+
return (DepSet.mk (#[dataFile] ++ staticFiles) (modDeps.push (.mk coreDeps #[]))).toArray
325327

326328
library_facet docsHeader (lib) : FilePath := do
327329
let mods ← (← lib.modules.fetch).await

0 commit comments

Comments
 (0)