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 #

    class Lake.ComputeTrace (i : Type u) (m : outParam (Type v → Type w)) (t : Type v) :
    Type (max u w)
    • computeTrace : im t

      Compute the trace of some target info using information from the monadic context.

    Instances
      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
      Instances For
        class Lake.NilTrace (t : Type u) :
        • nilTrace : t

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

        Instances
          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.mixTraceM {t : Type u_1} {m : Type u_1 → Type u_2} [Lake.MixTrace t] [Pure m] (t1 : t) (t2 : t) :
            m t
            Instances For
              def Lake.mixTraceList {t : Type u_1} [Lake.MixTrace t] [Lake.NilTrace t] (traces : List t) :
              t
              Instances For
                def Lake.mixTraceArray {t : Type u_1} [Lake.MixTrace t] [Lake.NilTrace t] (traces : Array t) :
                t
                Instances For
                  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
                  Instances For
                    instance Lake.instComputeTraceList {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] :
                    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
                    Instances For
                      instance Lake.instComputeTraceArray {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] :

                      Hash Trace #

                      structure Lake.Hash :

                      A content hash. TODO: Use a secure hash rather than the builtin Lean hash function.

                      Instances For
                        Instances For
                          Instances For
                            Instances For
                              Instances For
                                Instances For
                                  Instances For
                                    class Lake.ComputeHash (α : Type u) (m : outParam (TypeType v)) :
                                    Type (max u v)
                                    Instances
                                      def Lake.pureHash {α : Type u_1} [Lake.ComputeHash α Id] (a : α) :
                                      Instances For
                                        def Lake.computeHash {α : Type u_1} {m : TypeType u_2} {n : TypeType u_3} [Lake.ComputeHash α m] [MonadLiftT m n] (a : α) :
                                        Instances For

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

                                          Instances For
                                            def Lake.crlf2lf (text : String) :

                                            This is the same as String.replace text "\r\n" "\n", but more efficient.

                                            Instances For
                                              partial def Lake.crlf2lf.go (text : String) (acc : String) (accStop : String.Pos) (pos : String.Pos) :
                                              instance Lake.instComputeHashArray {α : Type u_1} {m : TypeType u_2} [Lake.ComputeHash α m] [Monad m] :

                                              Modification Time (MTime) Trace #

                                              A modification time.

                                              Instances For
                                                class Lake.GetMTime (α : Sort u_1) :
                                                Sort (max 1 u_1)
                                                Instances
                                                  def Lake.checkIfNewer {i : Sort u_1} [Lake.GetMTime i] (info : i) (depMTime : Lake.MTime) :

                                                  Check if the info's MTIme is at least depMTime.

                                                  Instances For

                                                    Lake Build Trace (Hash + MTIme) #

                                                    Trace used for common Lake targets. Combines Hash and MTime.

                                                    Instances For
                                                      def Lake.BuildTrace.compute {i : Type u_1} {m : TypeType u_2} [Lake.ComputeHash i m] [MonadLiftT m IO] [Lake.GetMTime i] (info : i) :
                                                      Instances For

                                                        Check the build trace against the given target info and hash to see if the target is up-to-date.

                                                        Instances For

                                                          Check the build trace against the given target info and its modification time to see if the target is up-to-date.

                                                          Instances For

                                                            Check the build trace against the given target info and its trace file to see if the target is up-to-date.

                                                            Instances For