Utilities #
Equations
- Lake.instCheckExistsFilePath = { checkExists := System.FilePath.pathExists }
Trace Abstraction #
Equations
- Lake.computeTrace info = liftM (Lake.ComputeTrace.computeTrace info)
Instances For
- nilTrace : t
The nil trace. Should not unduly clash with a proper trace.
Instances
Equations
- Lake.inhabitedOfNilTrace = { default := Lake.nilTrace }
- mixTrace : t → t → t
Combine two traces. The result should be dirty if either of the inputs is dirty.
Instances
Equations
- Lake.mixTraceList traces = List.foldl Lake.mixTrace Lake.nilTrace traces
Instances For
Equations
- Lake.mixTraceArray traces = Array.foldl Lake.mixTrace Lake.nilTrace traces
Instances For
Equations
- Lake.computeListTrace artifacts = List.foldlM (fun (ts : t) (t_1 : i) => do let __do_lift ← Lake.computeTrace t_1 pure (Lake.mixTrace ts __do_lift)) Lake.nilTrace artifacts
Instances For
Equations
- Lake.instComputeTraceListOfMonad = { computeTrace := Lake.computeListTrace }
Equations
- Lake.computeArrayTrace artifacts = Array.foldlM (fun (ts : t) (t_1 : i) => do let __do_lift ← Lake.computeTrace t_1 pure (Lake.mixTrace ts __do_lift)) Lake.nilTrace artifacts
Instances For
Equations
- Lake.instComputeTraceArrayOfMonad = { computeTrace := Lake.computeArrayTrace }
Hash Trace #
Equations
Equations
- Lake.instReprHash = { reprPrec := Lake.reprHash✝ }
Equations
- Lake.Hash.ofString? s = Option.map Lake.Hash.ofNat (inline s.toNat?)
Instances For
Equations
- Lake.Hash.load? hashFile = EIO.catchExceptions (Lake.Hash.ofString? <$> IO.FS.readFile hashFile) fun (x : IO.Error) => pure none
Instances For
Equations
- Lake.Hash.instNilTrace = { nilTrace := Lake.Hash.nil }
Equations
- Lake.Hash.instMixTrace = { mixTrace := Lake.Hash.mix }
Equations
- Lake.Hash.instToString = { toString := Lake.Hash.toString }
Equations
- Lake.Hash.instToJson = { toJson := Lake.Hash.toJson }
Equations
- Lake.Hash.fromJson? json = (fun (x : UInt64) => { val := x }) <$> Lean.fromJson? json
Instances For
Equations
- Lake.Hash.instFromJson = { fromJson? := Lake.Hash.fromJson? }
Equations
- Lake.instComputeTraceHashOfComputeHash = { computeTrace := Lake.ComputeHash.computeHash }
Equations
Instances For
Equations
Instances For
Equations
- Lake.instComputeHashStringId = { computeHash := Lake.Hash.ofString }
Equations
Instances For
Equations
- Lake.instComputeHashFilePathIO = { computeHash := Lake.computeFileHash }
Equations
- Lake.computeTextFileHash file = do let text ← IO.FS.readFile file let text : String := text.crlfToLf pure (Lake.Hash.ofString text)
Instances For
A wrapper around FilePath
that adjusts its ComputeHash
implementation
to normalize \r\n
sequences to \n
for cross-platform compatibility.
- path : Lake.FilePath
Instances For
Equations
- Lake.instCoeTextFilePathFilePath = { coe := fun (x : Lake.TextFilePath) => x.path }
Equations
- Lake.instComputeHashTextFilePathIO = { computeHash := fun (file : Lake.TextFilePath) => Lake.computeTextFileHash file.path }
Equations
- Lake.computeArrayHash xs = Array.foldlM (fun (h : Lake.Hash) (a : α) => do let __do_lift ← Lake.computeHash a pure (h.mix __do_lift)) Lake.Hash.nil xs
Instances For
Equations
- Lake.instComputeHashArrayOfMonad = { computeHash := Lake.computeArrayHash }
Modification Time (MTime) Trace #
Equations
- Lake.MTime.instOfNat = { ofNat := { sec := 0, nsec := 0 } }
Equations
Equations
Equations
Equations
- Lake.MTime.instNilTrace = { nilTrace := 0 }
Equations
- Lake.MTime.instMixTrace = { mixTrace := max }
Equations
- Lake.instComputeTraceIOMTimeOfGetMTime = { computeTrace := Lake.getMTime }
Equations
- Lake.getFileMTime file = do let __do_lift ← file.metadata pure __do_lift.modified
Instances For
Equations
- Lake.instGetMTimeFilePath = { getMTime := Lake.getFileMTime }
Equations
- Lake.instGetMTimeTextFilePath = { getMTime := fun (x : Lake.TextFilePath) => Lake.getFileMTime x.path }
Check if info
is up-to-date using modification time.
That is, check if the info is newer than self
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Lake Build Trace (Hash + MTIme) #
Trace used for common Lake targets. Combines Hash
and MTime
.
- hash : Lake.Hash
- mtime : Lake.MTime
Instances For
Equations
- Lake.instReprBuildTrace = { reprPrec := Lake.reprBuildTrace✝ }
Equations
- Lake.BuildTrace.instCoeHash = { coe := Lake.BuildTrace.ofHash }
Equations
- Lake.BuildTrace.ofMTime mtime = { hash := Lake.Hash.nil, mtime := mtime }
Instances For
Equations
- Lake.BuildTrace.instCoeMTime = { coe := Lake.BuildTrace.ofMTime }
Equations
- Lake.BuildTrace.nil = { hash := Lake.Hash.nil, mtime := 0 }
Instances For
Equations
- Lake.BuildTrace.instNilTrace = { nilTrace := Lake.BuildTrace.nil }
Equations
- Lake.BuildTrace.compute info = do let __do_lift ← Lake.computeHash info let __do_lift_1 ← Lake.getMTime info pure { hash := __do_lift, mtime := __do_lift_1 }
Instances For
Equations
- Lake.BuildTrace.instComputeTraceIOOfComputeHashOfMonadLiftTOfGetMTime = { computeTrace := Lake.BuildTrace.compute }
Instances For
Equations
- Lake.BuildTrace.instMixTrace = { mixTrace := Lake.BuildTrace.mix }
Check if the info is up-to-date using a hash. That is, check that info exists and its input hash matches this trace's hash.
Equations
- Lake.BuildTrace.checkAgainstHash info hash self = (pure (hash == self.hash) <&&> Lake.checkExists info)
Instances For
Check if the info is up-to-date using modification time. That is, check if the info is newer than this input trace's modification time.
Equations
- Lake.BuildTrace.checkAgainstTime info self = Lake.MTime.checkUpToDate info self.mtime
Instances For
Check if the info is up-to-date using a trace file. If the file exists, match its hash to this trace's hash. If not, check if the info is newer than this trace's modification time.
Deprecated: Should not be done manually,
but as part of buildUnlessUpToDate
.
Equations
- One or more equations did not get rendered due to their size.
Instances For
Write trace to a file.
Deprecated: Should not be done manually,
but as part of buildUnlessUpToDate
.
Equations
- Lake.BuildTrace.writeToFile traceFile self = do Lake.createParentDirs traceFile IO.FS.writeFile traceFile self.hash.toString