Module B00.Op
Build operations.
This module only provides a type for specifying operations and the result of their execution. No execution or caching logic lives here.
Operations kinds
module Spawn : sig ... endTool spawns.
module Read : sig ... endFile reads.
module Write : sig ... endFile writes.
module Mkdir : sig ... endDirectory creation.
type kind=|Spawn of Spawn.t|Read of Read.t|Write of Write.t|Mkdir of Mkdir.t|Wait_filesThe type for operation kinds.
val kind_name : kind -> stringkind_name kis a end user name for kindk.
Operation status
type status=|WaitingWaiting for execution.
|ExecutedExecuted successfully.
|CachedRevived from the cache.
|FailedExecuted unsucessfully.
|AbortedA prerequisite operation failed.
The type for operation statuses.
val pp_status : status B0_std.Fmt.tpp_statusformats execution status.
Operations
val creation_time : t -> B0_std.Time.spancreation_time oiso's creation time.
val exec_start_time : t -> B0_std.Time.spanexec_start_time oiso's execution start time. This is different fromB0_std.Time.Span.zeroonce the operation has been submitted to the OS for execution.
val exec_end_time : t -> B0_std.Time.spanexec_end_time oiso's execution end time. This is different fromB0_std.Time.Span.zeroonce the operation has been completed by the OS and collected.
val exec_duration : t -> B0_std.Time.spanexec_durationis the difference betweenexec_end_timeandexec_start_time.
val reads : t -> B0_std.Fpath.t listreads oare the file paths read by the operation.
val writes : t -> B0_std.Fpath.t listwrites oare the file paths written byo.
val did_not_write : t -> B0_std.Fpath.t listdid_not_write oare the file ofwritesthat do not exist or are not readable.
val hash : t -> B0_std.Hash.thash ois the operation's hash. This isHash.nil before the operation hash has been effectively computed and set viaset_hash.
Formatters
val pp : t B0_std.Fmt.tppformats a build operation.
val pp_short : t B0_std.Fmt.tpp_shortformats a build operation on a single line.
val pp_did_not_write : (t * B0_std.Fpath.t list) B0_std.Fmt.tpp_did_not_writeformats a build operation and the files it failed to write.
val pp_spawn_status_fail : t B0_std.Fmt.tpp_spawn_status_failformats a spawn operation failure due to exit result.
Updating the build operation
val set_exec_start_time : t -> B0_std.Time.span -> unitexec_start_time o tsetso's execution start time tot.
val set_exec_end_time : t -> B0_std.Time.span -> unitset_exec_end_time o tsetso's execution end time tos.
val set_reads : t -> B0_std.Fpath.t list -> unitset_reads t fssets the file paths read byotofs. Note that this resets thehash.
val set_writes : t -> B0_std.Fpath.t list -> unitset_writes t fssets the file paths written byotofs.
val set_hash : t -> B0_std.Hash.t -> unitset_hash o hsets the operation hash toh.
Operation contructors
val spawn : id:id -> B0_std.Time.span -> reads:B0_std.Fpath.t list -> writes:B0_std.Fpath.t list -> env:B0_std.Os.Env.assignments -> relevant_env:B0_std.Os.Env.assignments -> cwd:B0_std.Fpath.t -> stdin:B0_std.Fpath.t option -> stdout:Spawn.stdo -> stderr:Spawn.stdo -> success_exits:Spawn.success_exits -> B0_std.Cmd.tool -> B0_std.Cmd.t -> tspawndeclares a spawn build operation, see the corresponding accessors inSpawnfor the semantics of the various fields.
val read : id:id -> B0_std.Time.span -> B0_std.Fpath.t -> treaddeclares a file read operation, see the corresponding accessors inReadfor the semantics of the various fields.
val write : id:id -> B0_std.Time.span -> salt:string -> reads:B0_std.Fpath.t list -> mode:int -> write:B0_std.Fpath.t -> (unit -> (string, string) Stdlib.result) -> twritedeclares a file write operations, see the corresponding accessors inWritefor the semantics of the various fields.
val mkdir : id:id -> B0_std.Time.span -> B0_std.Fpath.t -> tmkdirdeclares a directory creation operation, see the corresponding accessors for the semantics of the various fields.
val wait_files : id:id -> B0_std.Time.span -> B0_std.Fpath.t list -> twait_filesdeclares a wait files operation, these are stored inreads.
Operation sets and map
module Set : Stdlib.Set.S with type elt := tOperation sets
module Map : Stdlib.Map.S with type key := tOperation maps