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
      @[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
      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.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
                @[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
                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] :
                  @[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
                  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
                      @[inline]
                      Instances For
                        Instances For
                          Instances For
                            @[inline]
                            Instances For
                              @[inline]
                              Instances For
                                @[inline]
                                Instances For
                                  @[inline]
                                  Instances For
                                    class Lake.ComputeHash (α : Type u) (m : outParam (TypeType v)) :
                                    Type (max u v)
                                    Instances
                                      @[inline]
                                      def Lake.pureHash {α : Type u_1} [Lake.ComputeHash α Id] (a : α) :
                                      Instances For
                                        @[inline]
                                        def Lake.computeHash {α : Type u_1} {m : TypeType u_2} {n : TypeType u_3} [Lake.ComputeHash α m] [MonadLiftT m n] (a : α) :
                                        Instances For
                                          @[inline]
                                          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) :

                                            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 α) :
                                              Instances For
                                                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
                                                    @[inline]
                                                    Instances For

                                                      Lake Build Trace (Hash + MTIme) #

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

                                                      Instances For
                                                        @[inline]
                                                        Instances For
                                                          @[inline]
                                                          Instances For
                                                            @[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) :
                                                            Instances For
                                                              @[inline]

                                                              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.

                                                              Instances For
                                                                @[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.

                                                                Instances For
                                                                  @[inline]

                                                                  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.

                                                                  Instances For
                                                                    @[inline]
                                                                    Instances For