Documentation

Lake.Build.Trace

Utilities #

class Lake.CheckExists (i : Type u) :
  • checkExists : iBaseIO Bool

    Check whether there already exists an artifact for the given target info.

Instances

Trace Abstraction #

@[inline]
def Lake.computeTrace {i : Type u_1} {m : Type u_2 → Type u_3} {t : Type u_2} {n : Type u_2 → Type u_4} [Lake.ComputeTrace i m t] [MonadLiftT m n] (info : i) :
n t
Equations
class Lake.NilTrace (t : Type u) :
  • nilTrace : t

    The nil trace. Should not unduly clash with a proper trace.

Instances
Equations
  • Lake.inhabitedOfNilTrace = { default := Lake.nilTrace }
class Lake.MixTrace (t : Type u) :
  • mixTrace : ttt

    Combine two traces. The result should be dirty if either of the inputs is dirty.

Instances
def Lake.mixTraceList {t : Type u_1} [Lake.MixTrace t] [Lake.NilTrace t] (traces : List t) :
t
Equations
def Lake.mixTraceArray {t : Type u_1} [Lake.MixTrace t] [Lake.NilTrace t] (traces : Array t) :
t
Equations
@[specialize #[]]
def Lake.computeListTrace {t : Type u_1} {i : Type u_2} {m : Type u_1 → Type u_3} [Lake.MixTrace t] [Lake.NilTrace t] [Lake.ComputeTrace i m t] {n : Type u_1 → Type u_4} [MonadLiftT m n] [Monad n] (artifacts : List i) :
n t
Equations
instance Lake.instComputeTraceListOfMonad {t : Type u_1} {i : Type u_2} {m : Type u_1 → Type u_3} [Lake.MixTrace t] [Lake.NilTrace t] [Lake.ComputeTrace i m t] [Monad m] :
Equations
  • Lake.instComputeTraceListOfMonad = { computeTrace := Lake.computeListTrace }
@[specialize #[]]
def Lake.computeArrayTrace {t : Type u_1} {i : Type u_2} {m : Type u_1 → Type u_3} [Lake.MixTrace t] [Lake.NilTrace t] [Lake.ComputeTrace i m t] {n : Type u_1 → Type u_4} [MonadLiftT m n] [Monad n] (artifacts : Array i) :
n t
Equations
instance Lake.instComputeTraceArrayOfMonad {t : Type u_1} {i : Type u_2} {m : Type u_1 → Type u_3} [Lake.MixTrace t] [Lake.NilTrace t] [Lake.ComputeTrace i m t] [Monad m] :
Equations
  • Lake.instComputeTraceArrayOfMonad = { computeTrace := Lake.computeArrayTrace }

Hash Trace #

@[inline]
Equations
Equations
@[inline]
Equations
  • h1.mix h2 = { val := mixHash h1.val h2.val }
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
@[inline]
Equations
Equations
  • Lake.instComputeTraceHashOfComputeHash = { computeTrace := Lake.ComputeHash.computeHash }
@[inline]
def Lake.computeHash {α : Type u_1} {m : TypeType u_2} {n : TypeType u_3} [Lake.ComputeHash α m] [MonadLiftT m n] (a : α) :
Equations
Equations

A wrapper around FilePath that adjusts its ComputeHash implementation to normalize \r\n sequences to \n for cross-platform compatibility.

Instances For
@[specialize #[]]
def Lake.computeArrayHash {α : Type u_1} {m : TypeType u_2} [Lake.ComputeHash α m] [Monad m] (xs : Array α) :
Equations
instance Lake.instComputeHashArrayOfMonad {α : Type u_1} {m : TypeType u_2} [Lake.ComputeHash α m] [Monad m] :
Equations
  • Lake.instComputeHashArrayOfMonad = { computeHash := Lake.computeArrayHash }

Modification Time (MTime) Trace #

Equations
Equations
  • Lake.instComputeTraceIOMTimeOfGetMTime = { computeTrace := Lake.getMTime }
@[inline]
Equations
@[specialize #[]]
def Lake.MTime.checkUpToDate {i : Sort u_1} [Lake.GetMTime i] (info : i) (self : Lake.MTime) :

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.

Lake Build Trace (Hash + MTIme) #

@[inline]
Equations
@[inline]
Equations
@[specialize #[]]
def Lake.BuildTrace.compute {i : Type u_1} {m : TypeType u_2} [Lake.ComputeHash i m] [MonadLiftT m IO] [Lake.GetMTime i] (info : i) :
Equations
Equations
  • Lake.BuildTrace.instComputeTraceIOOfComputeHashOfMonadLiftTOfGetMTime = { computeTrace := Lake.BuildTrace.compute }
Equations
  • t1.mix t2 = { hash := t1.hash.mix t2.hash, mtime := max t1.mtime t2.mtime }
@[specialize #[]]

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
@[inline]

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
@[specialize #[], deprecated]

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.
@[deprecated]

Write trace to a file.

Deprecated: Should not be done manually, but as part of buildUnlessUpToDate.

Equations