Documentation

Lake.Build.Job.Basic

Job Primitives #

This module contains the basic definitions of a Lake Job. In particular, it defines OpaqueJob, which is needed for BuildContext. More complex utilities are defined in Lake.Build.Job.Monad, which depends on BuildContext.

JobAction #

inductive Lake.JobAction :

Information on what this job did.

  • unknown : JobAction

    No information about this job's action is available.

  • replay : JobAction

    Tried to replay a cached build action (set by buildFileUnlessUpToDate)

  • fetch : JobAction

    Tried to fetch a build from a store (can be set by buildUnlessUpToDate?)

  • build : JobAction

    Tried to perform a build action (set by buildUnlessUpToDate?)

Instances For
    Equations
      Instances For
        Equations
          Instances For

            JobState #

            structure Lake.JobState :

            Mutable state of a Lake job.

            • log : Log

              The job's log.

            • action : JobAction

              Tracks whether this job performed any significant build action.

            • trace : BuildTrace

              Current trace of a build job.

            Instances For
              Equations
                Instances For
                  @[inline]
                  Equations
                    Instances For
                      @[inline]
                      Equations
                        Instances For

                          JobTask #

                          @[reducible, inline]
                          abbrev Lake.JobResult (α : Type u_1) :
                          Type u_1

                          The result of a Lake job.

                          Equations
                            Instances For
                              def Lake.JobResult.prependLog {α : Type u_1} (log : Log) (self : JobResult α) :

                              Add log entries to the beginning of the job's log.

                              Equations
                                Instances For
                                  @[reducible, inline]
                                  abbrev Lake.JobTask (α : Type u_1) :
                                  Type u_1

                                  The Task of a Lake job.

                                  Equations
                                    Instances For

                                      Job #

                                      structure Lake.Job (α : Type u) :

                                      A Lake job.

                                      • task : JobTask α

                                        The Lean Task object for the job.

                                      • kind : OptDataKind α

                                        The kind of data this job produces.

                                      • caption : String

                                        A caption for the job in Lake's build monitor. Will be formatted like ✔ [3/5] Ran <caption>.

                                      • optional : Bool

                                        Whether this job failing should cause the build to fail.

                                      Instances For
                                        instance Lake.instInhabitedJob {α : Type u_1} :
                                        Equations
                                          def Lake.Job.cast {α : Type u_1} (self : Job α) (h : ¬self.kind.isAnonymous = true) :
                                          Equations
                                            Instances For
                                              @[inline]
                                              def Lake.Job.ofTask {α : Type u_1} [OptDataKind α] (task : JobTask α) (caption : String := "") :
                                              Job α
                                              Equations
                                                Instances For
                                                  @[inline]
                                                  def Lake.Job.error {α : Type u_1} [OptDataKind α] (log : Log := ) (caption : String := "") :
                                                  Job α
                                                  Equations
                                                    Instances For
                                                      @[inline]
                                                      def Lake.Job.pure {α : Type u_1} [kind : OptDataKind α] (a : α) (log : Log := ) (caption : String := "") :
                                                      Job α
                                                      Equations
                                                        Instances For
                                                          Equations
                                                            @[inline]
                                                            def Lake.Job.traceRoot {α : Type u_1} (a : α) (caption : String := "<root>") :
                                                            Job α

                                                            For internal use.

                                                            Equations
                                                              Instances For
                                                                @[inline]
                                                                def Lake.Job.nop (log : Log := ) (caption : String := "") :
                                                                Equations
                                                                  Instances For
                                                                    @[inline]
                                                                    def Lake.Job.nil (traceCaption : String := "<nil>") :
                                                                    Equations
                                                                      Instances For
                                                                        @[inline]
                                                                        def Lake.Job.getTrace {α : Type u_1} (job : Job α) :

                                                                        Waits for the job and returns it trace. Useful if the job is already known to be completed.

                                                                        Equations
                                                                          Instances For
                                                                            @[inline]
                                                                            def Lake.Job.setCaption {α : Type u_1} (caption : String) (job : Job α) :
                                                                            Job α

                                                                            Sets the job's caption.

                                                                            Equations
                                                                              Instances For
                                                                                @[inline]
                                                                                def Lake.Job.setCaption? {α : Type u_1} (caption : String) (job : Job α) :
                                                                                Job α

                                                                                Sets the job's caption if the job's current caption is empty.

                                                                                Equations
                                                                                  Instances For
                                                                                    @[inline]
                                                                                    def Lake.Job.mapResult {β : Type u_1} {α : Type u_2} [OptDataKind β] (f : JobResult αJobResult β) (self : Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                                    Job β
                                                                                    Equations
                                                                                      Instances For
                                                                                        @[inline]
                                                                                        def Lake.Job.mapOk {β : Type u_1} {α : Type u_2} [OptDataKind β] (f : αJobStateJobResult β) (self : Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                                        Job β
                                                                                        Equations
                                                                                          Instances For
                                                                                            @[inline]
                                                                                            def Lake.Job.map {β : Type u_1} {α : Type u_2} [OptDataKind β] (f : αβ) (self : Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                                            Job β
                                                                                            Equations
                                                                                              Instances For

                                                                                                OpaqueJob #

                                                                                                @[reducible, inline]

                                                                                                A Lake job task with an opaque value in Type.

                                                                                                Equations
                                                                                                  Instances For
                                                                                                    @[implemented_by _private.Lake.Build.Job.Basic.0.Lake.JobTask.toOpaqueImpl]
                                                                                                    def Lake.JobTask.toOpaque {α : Type u_1} (self : JobTask α) :

                                                                                                    Forget the value of a job task. Implemented as a no-op cast.

                                                                                                    Equations
                                                                                                      Instances For
                                                                                                        @[reducible, inline]

                                                                                                        A Lake job with an opaque value in Type.

                                                                                                        Equations
                                                                                                          Instances For
                                                                                                            def Lake.Job.toOpaque {α : Type u_1} (job : Job α) :

                                                                                                            Forget the value of a job. Implemented as a no-op cast on the task.

                                                                                                            Equations
                                                                                                              Instances For
                                                                                                                Equations