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

      • wantsRebuild : Bool

        Whether this job failed due to a request to rebuild for --no-build.

      • trace : BuildTrace

        Current trace of a build job.

      • buildTime : Nat

        How long the job spent building (in milliseconds).

      Instances For
        @[implicit_reducible]
        Instances For
          @[inline]
          Instances For
            @[inline]
            Instances For

              JobTask #

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

              The result of a Lake job.

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

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

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

                  The Task of a Lake job.

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

                              For internal use.

                              Instances For
                                @[inline]
                                def Lake.Job.nop (log : Log := ) (caption : String := "") :
                                Instances For
                                  @[inline]
                                  def Lake.Job.nil (traceCaption : String := "<nil>") :
                                  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.

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

                                      Sets the job's caption.

                                      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.

                                        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 β
                                          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 β
                                            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 β
                                              Instances For
                                                @[implicit_reducible]

                                                OpaqueJob #

                                                @[reducible, inline]

                                                A Lake job task with an opaque value in Type.

                                                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.

                                                  Instances For
                                                    @[implicit_reducible]
                                                    @[reducible, inline]

                                                    A Lake job with an opaque value in Type.

                                                    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.

                                                      Instances For
                                                        @[implicit_reducible]