Documentation

Lake.Build.Job

Equations
Instances For
    @[inline]

    Resets the job state after a checkpoint (e.g., registering the job). Preserves state that downstream jobs want to depend on while resetting job-local state that should not be inherited by downstream jobs.

    Equations
    Instances For
      Equations
      • a.merge b = { log := a.log ++ b.log, action := a.action.merge b.action, trace := Lake.mixTrace a.trace b.trace }
      Instances For
        @[inline]
        Equations
        Instances For

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

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

            The monad of asynchronous Lake jobs.

            While this can be lifted into FetchM, job action should generally be wrapped into an asynchronous job (e.g., via Job.async) instead of being run directly in FetchM.

            Equations
            Instances For
              Equations
              Equations
              • One or more equations did not get rendered due to their size.
              @[inline]

              Record that this job is trying to perform some action.

              Equations
              Instances For
                @[inline]

                Returns the current job's build trace.

                Equations
                Instances For
                  @[inline]

                  Sets the current job's build trace.

                  Equations
                  Instances For
                    @[inline]

                    Mix a trace into the current job's build trace.

                    Equations
                    Instances For
                      @[inline]

                      Returns the current job's build trace and removes it from the state.

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

                        The monad used to spawn asynchronous Lake build jobs. Lifts into FetchM.

                        Equations
                        Instances For
                          @[inline]
                          Equations
                          Instances For
                            @[reducible, inline, deprecated Lake.SpawnM (since := "2024-05-21")]
                            abbrev Lake.SchedulerM (α : Type) :

                            The monad used to spawn asynchronous Lake build jobs. Replaced by SpawnM.

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

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

                              Equations
                              Instances For
                                @[inline]
                                def Lake.Job.ofTask {α : Type u_1} (task : Lake.JobTask α) (caption : String := "") :
                                Equations
                                Instances For
                                  @[inline]
                                  def Lake.Job.error {α : Type u_1} (log : Lake.Log := ) (caption : String := "") :
                                  Equations
                                  • One or more equations did not get rendered due to their size.
                                  Instances For
                                    @[inline]
                                    def Lake.Job.pure {α : Type u_1} (a : α) (log : Lake.Log := ) (caption : String := "") :
                                    Equations
                                    Instances For
                                      Equations
                                      instance Lake.Job.instInhabited {α : Type u_1} [Inhabited α] :
                                      Equations
                                      @[inline]
                                      def Lake.Job.nop (log : Lake.Log := ) (caption : String := "") :
                                      Equations
                                      Instances For
                                        @[inline]
                                        Equations
                                        Instances For
                                          @[inline]
                                          def Lake.Job.setCaption {α : Type u_1} (caption : String) (job : Lake.Job α) :

                                          Sets the job's caption.

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

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

                                            Equations
                                            • Lake.Job.setCaption? caption job = if job.caption.isEmpty = true then { task := job.task, caption := caption, optional := job.optional } else job
                                            Instances For
                                              @[inline]
                                              def Lake.Job.mapResult {α : Type u_1} {β : Type u_2} (f : Lake.JobResult αLake.JobResult β) (self : Lake.Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                              Equations
                                              Instances For
                                                @[inline]
                                                def Lake.Job.mapOk {α : Type u_1} {β : Type u_2} (f : αLake.JobStateLake.JobResult β) (self : Lake.Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                Equations
                                                • One or more equations did not get rendered due to their size.
                                                Instances For
                                                  @[inline]
                                                  def Lake.Job.bindTask {m : Type u_1 → Type u_2} {α : Type u_3} {β : Type u_1} [Monad m] (f : Lake.JobTask αm (Lake.JobTask β)) (self : Lake.Job α) :
                                                  m (Lake.Job β)
                                                  Equations
                                                  • Lake.Job.bindTask f self = do let __do_liftf self.task pure { task := __do_lift, caption := self.caption, optional := self.optional }
                                                  Instances For
                                                    @[inline]
                                                    def Lake.Job.map {α : Type u_1} {β : Type u_2} (f : αβ) (self : Lake.Job α) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                    Equations
                                                    Instances For
                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      def Lake.Job.renew {α : Type u_1} (self : Lake.Job α) :

                                                      Resets the job's state after a checkpoint (e.g., registering the job). Preserves information that downstream jobs want to depend on while resetting job-local information that should not be inherited by downstream jobs.

                                                      Equations
                                                      • One or more equations did not get rendered due to their size.
                                                      Instances For
                                                        @[inline]

                                                        Spawn a job that asynchronously performs act.

                                                        Equations
                                                        • One or more equations did not get rendered due to their size.
                                                        Instances For
                                                          @[inline]
                                                          def Lake.Job.wait {α : Type} (self : Lake.Job α) :

                                                          Wait a the job to complete and return the result.

                                                          Equations
                                                          Instances For
                                                            @[inline]
                                                            def Lake.Job.wait? {α : Type} (self : Lake.Job α) :

                                                            Wait for a job to complete and return the produced value. If an error occurred, return none and discarded any logs produced.

                                                            Equations
                                                            Instances For
                                                              @[inline]
                                                              def Lake.Job.await {α : Type} (self : Lake.Job α) :

                                                              Wait for a job to complete and return the produced value. Logs the job's log and throws if there was an error.

                                                              Equations
                                                              • One or more equations did not get rendered due to their size.
                                                              Instances For
                                                                def Lake.Job.mapM {α : Type u_1} {β : Type} (self : Lake.Job α) (f : αLake.JobM β) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :

                                                                Apply f asynchronously to the job's output.

                                                                Equations
                                                                • One or more equations did not get rendered due to their size.
                                                                Instances For
                                                                  @[reducible, inline, deprecated Lake.Job.mapM (since := "2024-12-06")]
                                                                  abbrev Lake.Job.bindSync {α : Type u_1} {β : Type} (self : Lake.Job α) (f : αLake.JobM β) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                  Equations
                                                                  • self.bindSync f prio sync = self.mapM f prio sync
                                                                  Instances For
                                                                    def Lake.Job.bindM {α : Type u_1} {β : Type} (self : Lake.Job α) (f : αLake.JobM (Lake.Job β)) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :

                                                                    Apply f asynchronously to the job's output and asynchronously await the resulting job.

                                                                    Equations
                                                                    • One or more equations did not get rendered due to their size.
                                                                    Instances For
                                                                      @[reducible, inline, deprecated Lake.Job.bindM (since := "2024-12-06")]
                                                                      abbrev Lake.Job.bindAsync {α : Type u_1} {β : Type} (self : Lake.Job α) (f : αLake.SpawnM (Lake.Job β)) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                      Equations
                                                                      • self.bindAsync f prio sync = self.bindM (fun (a : α) => liftM (f a)) prio sync
                                                                      Instances For
                                                                        @[inline]
                                                                        def Lake.Job.zipResultWith {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : Lake.JobResult αLake.JobResult βLake.JobResult γ) (self : Lake.Job α) (other : Lake.Job β) (prio : Task.Priority := Task.Priority.default) (sync : Bool := true) :

                                                                        a.zipWith f b produces a new job c that applies f to the results of a and b. The job c errors if either a or b error.

                                                                        Equations
                                                                        • One or more equations did not get rendered due to their size.
                                                                        Instances For
                                                                          @[inline]
                                                                          def Lake.Job.zipWith {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβγ) (self : Lake.Job α) (other : Lake.Job β) (prio : Task.Priority := Task.Priority.default) (sync : Bool := true) :

                                                                          a.zipWith f b produces a new job c that applies f to the results of a and b. The job c errors if either a or b error.

                                                                          Equations
                                                                          • One or more equations did not get rendered due to their size.
                                                                          Instances For
                                                                            def Lake.Job.add {α : Type u_1} {β : Type u_2} (self : Lake.Job α) (other : Lake.Job β) :

                                                                            Merges this job with another, discarding its output and trace.

                                                                            Equations
                                                                            • One or more equations did not get rendered due to their size.
                                                                            Instances For
                                                                              def Lake.Job.mix {α : Type u_1} {β : Type u_2} (self : Lake.Job α) (other : Lake.Job β) :

                                                                              Merges this job with another, discarding both outputs.

                                                                              Equations
                                                                              Instances For
                                                                                def Lake.Job.mixList {α : Type u_1} (jobs : List (Lake.Job α)) :

                                                                                Merge a List of jobs into one, discarding their outputs.

                                                                                Equations
                                                                                Instances For
                                                                                  def Lake.Job.mixArray {α : Type u_1} (jobs : Array (Lake.Job α)) :

                                                                                  Merge an Array of jobs into one, discarding their outputs.

                                                                                  Equations
                                                                                  Instances For
                                                                                    def Lake.Job.collectList {α : Type u_1} (jobs : List (Lake.Job α)) :

                                                                                    Merge a List of jobs into one, collecting their outputs into a List.

                                                                                    Equations
                                                                                    Instances For
                                                                                      def Lake.Job.collectArray {α : Type u_1} (jobs : Array (Lake.Job α)) :

                                                                                      Merge an Array of jobs into one, collecting their outputs into an Array.

                                                                                      Equations
                                                                                      Instances For
                                                                                        @[reducible, inline, deprecated Lake.Job (since := "2024-12-06")]
                                                                                        abbrev Lake.BuildJob (α : Type u_1) :
                                                                                        Type u_1

                                                                                        A Lake build job.

                                                                                        Equations
                                                                                        Instances For
                                                                                          @[inline, deprecated "Obsolete." (since := "2024-12-06")]
                                                                                          Equations
                                                                                          • One or more equations did not get rendered due to their size.
                                                                                          Instances For
                                                                                            @[inline, deprecated "Obsolete." (since := "2024-12-06")]
                                                                                            Equations
                                                                                            Instances For
                                                                                              @[reducible, inline]
                                                                                              abbrev Lake.BuildJob.toJob {α : Type u_1} (self : Lake.BuildJob α) :
                                                                                              Equations
                                                                                              • self.toJob = self
                                                                                              Instances For
                                                                                                @[reducible, inline, deprecated Lake.Job.nil (since := "2024-12-06")]
                                                                                                Equations
                                                                                                Instances For
                                                                                                  @[reducible, inline, deprecated Lake.Job.map (since := "2024-12-06")]
                                                                                                  abbrev Lake.BuildJob.pure {α : Type u_1} (a : α) :
                                                                                                  Equations
                                                                                                  Instances For
                                                                                                    Equations
                                                                                                    @[reducible, inline, deprecated Lake.Job.map (since := "2024-12-06")]
                                                                                                    abbrev Lake.BuildJob.map {α : Type u_1} {β : Type u_2} (f : αβ) (self : Lake.BuildJob α) :
                                                                                                    Equations
                                                                                                    Instances For
                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      @[inline, deprecated "Removed without replacement." (since := "2024-12-06")]
                                                                                                      def Lake.BuildJob.mapWithTrace {α : Type u_1} {β : Type u_2} (f : αLake.BuildTraceβ × Lake.BuildTrace) (self : Lake.BuildJob α) :
                                                                                                      Equations
                                                                                                      • One or more equations did not get rendered due to their size.
                                                                                                      Instances For
                                                                                                        @[inline, deprecated Lake.Job.mapM (since := "2024-12-06")]
                                                                                                        def Lake.BuildJob.bindSync {α : Type u_1} {β : Type} (self : Lake.BuildJob α) (f : αLake.BuildTraceLake.JobM (β × Lake.BuildTrace)) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                                                        Equations
                                                                                                        • One or more equations did not get rendered due to their size.
                                                                                                        Instances For
                                                                                                          @[inline, deprecated Lake.Job.bindM (since := "2024-12-06")]
                                                                                                          def Lake.BuildJob.bindAsync {α : Type u_1} {β : Type} (self : Lake.BuildJob α) (f : αLake.BuildTraceLake.SpawnM (Lake.Job β)) (prio : Task.Priority := Task.Priority.default) (sync : Bool := false) :
                                                                                                          Equations
                                                                                                          • self.bindAsync f prio sync = self.toJob.bindM (fun (a : α) => do let __do_liftLake.getTrace liftM (f a __do_lift)) prio sync
                                                                                                          Instances For
                                                                                                            @[reducible, inline, deprecated Lake.Job.wait? (since := "2024-12-06")]
                                                                                                            abbrev Lake.BuildJob.wait? {α : Type} (self : Lake.BuildJob α) :
                                                                                                            Equations
                                                                                                            • self.wait? = self.toJob.wait?
                                                                                                            Instances For
                                                                                                              @[reducible, inline, deprecated Lake.Job.add (since := "2024-12-06")]
                                                                                                              abbrev Lake.BuildJob.add {α : Type u_1} {β : Type u_2} (self : Lake.BuildJob α) (other : Lake.BuildJob β) :
                                                                                                              Equations
                                                                                                              • self.add other = self.toJob.add other.toJob
                                                                                                              Instances For
                                                                                                                @[reducible, inline, deprecated Lake.Job.mix (since := "2024-12-06")]
                                                                                                                abbrev Lake.BuildJob.mix {α : Type u_1} {β : Type u_2} (self : Lake.BuildJob α) (other : Lake.BuildJob β) :
                                                                                                                Equations
                                                                                                                • self.mix other = self.toJob.mix other.toJob
                                                                                                                Instances For
                                                                                                                  @[reducible, inline, deprecated Lake.Job.mixList (since := "2024-12-06")]
                                                                                                                  abbrev Lake.BuildJob.mixList {α : Type u_1} (jobs : List (Lake.BuildJob α)) :
                                                                                                                  Equations
                                                                                                                  Instances For
                                                                                                                    @[reducible, inline, deprecated Lake.Job.mixArray (since := "2024-12-06")]
                                                                                                                    Equations
                                                                                                                    Instances For
                                                                                                                      @[reducible, inline, deprecated Lake.Job.zipWith (since := "2024-12-06")]
                                                                                                                      abbrev Lake.BuildJob.zipWith {α : Type u_1} {β : Type u_2} {γ : Type u_3} (f : αβγ) (self : Lake.BuildJob α) (other : Lake.BuildJob β) :
                                                                                                                      Equations
                                                                                                                      Instances For
                                                                                                                        @[reducible, inline, deprecated Lake.Job.collectList (since := "2024-12-06")]
                                                                                                                        abbrev Lake.BuildJob.collectList {α : Type u_1} (jobs : List (Lake.BuildJob α)) :
                                                                                                                        Equations
                                                                                                                        Instances For
                                                                                                                          @[reducible, inline, deprecated Lake.Job.collectArray (since := "2024-12-06")]
                                                                                                                          abbrev Lake.BuildJob.collectArray {α : Type u_1} (jobs : Array (Lake.BuildJob α)) :
                                                                                                                          Equations
                                                                                                                          Instances For