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.

  • reuse : JobAction

    Tried to reuse a cached build (e.g., can be set by replayCachedIfUpToDate).

  • replay : JobAction

    Tried to replay a completed build action (e.g., can be set by replayIfUpToDate).

  • unpack : JobAction

    Tried to unpack a build from an archive (e.g., unpacking a module ltar).

  • fetch : JobAction

    Tried to fetch a build from a remote store (e.g., set when downloading an artifact on-demand from a cache service in buildArtifactUnlessUpToDate).

  • build : JobAction

    Tried to perform a build action (e.g., set by buildAction).

Instances For
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    @[instance_reducible]
    Equations
    Equations
    Instances For
      def Lake.JobAction.verb (failed : Bool) (self : JobAction) :
      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.

        • 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
          Equations
          • One or more equations did not get rendered due to their size.
          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

                    For internal use only. Log message marking a job continuation canceled by the build's cancellation token. Do not match this directly; use JobResult.isCanceled.

                    Equations
                    Instances For

                      Whether this result is a cancellation.

                      Also correct on merged results (e.g., from zipResultWith, mix, collectArray): a result that contains both a genuine failure and cancellations is classified as failed.

                      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_reducible]
                            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
                                    @[instance_reducible]
                                    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
                                                  • One or more equations did not get rendered due to their size.
                                                  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
                                                      @[instance_reducible]
                                                      Equations

                                                      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
                                                              @[instance_reducible]
                                                              Equations