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 #
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
- Lake.instInhabitedJobAction = { default := Lake.JobAction.unknown }
Equations
- Lake.instReprJobAction = { reprPrec := Lake.reprJobAction✝ }
Equations
- Lake.instOrdJobAction = { compare := Lake.ordJobAction✝ }
Equations
- Lake.JobAction.verb failed Lake.JobAction.unknown = if failed = true then "Running" else "Ran"
- Lake.JobAction.verb failed Lake.JobAction.replay = if failed = true then "Replaying" else "Replayed"
- Lake.JobAction.verb failed Lake.JobAction.fetch = if failed = true then "Fetching" else "Fetched"
- Lake.JobAction.verb failed Lake.JobAction.build = if failed = true then "Building" else "Built"
Instances For
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
- Lake.instInhabitedJobState = { default := { log := default, action := default, trace := default } }
Equations
- Lake.JobState.logEntry e s = Lake.JobState.modifyLog (fun (x : Lake.Log) => x.push e) s
Instances For
JobTask #
The result of a Lake job.
Equations
Instances For
Add log entries to the beginning of the job's log.
Equations
- Lake.JobResult.prependLog log (Lake.EResult.ok a s) = Lake.EResult.ok a (Lake.JobState.modifyLog (fun (x : Lake.Log) => log ++ x) s)
- Lake.JobResult.prependLog log (Lake.EResult.error e s) = Lake.EResult.error { val := log.size + e.val } (Lake.JobState.modifyLog (fun (x : Lake.Log) => log ++ x) s)
Instances For
Job #
Equations
- Lake.instInhabitedJob = { default := { task := default, caption := default, optional := default } }
Equations
- Lake.Job.ofTask task caption = { task := task, caption := caption, optional := false }
Instances For
Equations
- Lake.Job.pure a log caption = { task := { get := Lake.EResult.ok a { log := log, action := Lake.JobAction.unknown, trace := Lake.BuildTrace.nil } }, caption := caption, optional := false }
Instances For
Equations
- Lake.Job.instPure = { pure := fun {α : Type ?u.6} (a : α) => Lake.Job.pure a }
Sets the job's caption.
Equations
- Lake.Job.setCaption caption job = { task := job.task, caption := caption, optional := job.optional }
Instances For
Sets the job's caption if the job's current caption is empty.
Equations
Instances For
Equations
Instances For
Equations
- One or more equations did not get rendered due to their size.
Instances For
Equations
- Lake.Job.map f self prio sync = Lake.Job.mapResult (fun (x : Lake.JobResult α) => Lake.EResult.map f x) self prio sync
Instances For
Equations
- One or more equations did not get rendered due to their size.
OpaqueJob #
A Lake job with an opaque value in Type
.
Equations
Instances For
Forget the value of a job. Implemented as a no-op cast.
Equations
- job.toOpaque = { task := Task.map (fun (x : Lake.JobResult α) => Lake.EResult.map Opaque.mk x) job.task, caption := job.caption, optional := job.optional }
Instances For
Equations
- Lake.instCoeOutJobOpaqueJob = { coe := Lake.Job.toOpaque }