Skip to content

Commit

Permalink
chore: add further comments in #7291 (#7317)
Browse files Browse the repository at this point in the history
Just recording an explanation from the review of #7291 into the source code.



Co-authored-by: Scott Morrison <scott.morrison@gmail.com>
  • Loading branch information
semorrison and semorrison committed Sep 22, 2023
1 parent 3d4c881 commit 4220ff1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion Cache/IO.lean
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,8 @@ Each build file also has a `Bool` indicating whether that file is required for c
def mkBuildPaths (path : FilePath) : IO $ List (FilePath × Bool) := do
let packageDir ← getPackageDir path
return [
(packageDir / LIBDIR / path.withExtension "trace", true), -- this one has to be first
-- Note that `packCache` below requires that the `.trace` file is first in this list.
(packageDir / LIBDIR / path.withExtension "trace", true),
(packageDir / LIBDIR / path.withExtension "olean", true),
(packageDir / LIBDIR / path.withExtension "olean.hash", true),
(packageDir / LIBDIR / path.withExtension "ilean", true),
Expand Down Expand Up @@ -274,6 +275,8 @@ def packCache (hashMap : HashMap) (overwrite : Bool) (comment : Option String :=
if ← allExist buildPaths then
if overwrite || !(← zipPath.pathExists) then
tasks := tasks.push <| ← IO.asTask do
-- Note here we require that the `.trace` file is first
-- in the list generated by `mkBuildPaths`.
let trace :: args := (← buildPaths.filterM (·.1.pathExists)) |>.map (·.1.toString)
| unreachable!
runCmd (← getLeanTar) $ #[zipPath.toString, trace] ++
Expand Down

0 comments on commit 4220ff1

Please sign in to comment.