package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=dadde8cfa62be9dabd805fc190b415427b4699ffe3458c153e2f3f9cc5c9b9b4
md5=f96ac96fb0182f2b97dbe9ded452544b
doc/b0.b00/B00/Op/index.html
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 ... end
Tool spawns.
module Read : sig ... end
File reads.
module Write : sig ... end
File writes.
module Mkdir : sig ... end
Directory creation.
The type for operation kinds.
val kind_name : kind -> string
kind_name k
is a end user name for kind k
.
Operation status
val pp_status : status B0_std.Fmt.t
pp_status
formats execution status.
Operations
val creation_time : t -> B0_std.Time.span
creation_time o
is o
's creation time.
val exec_start_time : t -> B0_std.Time.span
exec_start_time o
is o
's execution start time. This is different from B0_std.Time.Span.zero
once the operation has been submitted to the OS for execution.
val exec_end_time : t -> B0_std.Time.span
exec_end_time o
is o
's execution end time. This is different from B0_std.Time.Span.zero
once the operation has been completed by the OS and collected.
val exec_duration : t -> B0_std.Time.span
exec_duration
is the difference between exec_end_time
and exec_start_time
.
val reads : t -> B0_std.Fpath.t list
reads o
are the file paths read by the operation.
val writes : t -> B0_std.Fpath.t list
writes o
are the file paths written by o
.
val did_not_write : t -> B0_std.Fpath.t list
did_not_write o
are the file of writes
that do not exist or are not readable.
val hash : t -> B0_std.Hash.t
hash o
is the operation's hash. This is Hash.nil
before the operation hash has been effectively computed and set via set_hash
.
Formatters
val pp : t B0_std.Fmt.t
pp
formats a build operation.
val pp_short : t B0_std.Fmt.t
pp_short
formats a build operation on a single line.
val pp_did_not_write : (t * B0_std.Fpath.t list) B0_std.Fmt.t
pp_did_not_write
formats a build operation and the files it failed to write.
val pp_spawn_status_fail : t B0_std.Fmt.t
pp_spawn_status_fail
formats a spawn operation failure due to exit result.
Updating the build operation
val set_exec_start_time : t -> B0_std.Time.span -> unit
exec_start_time o t
sets o
's execution start time to t
.
val set_exec_end_time : t -> B0_std.Time.span -> unit
set_exec_end_time o t
sets o
's execution end time to s
.
val set_reads : t -> B0_std.Fpath.t list -> unit
set_reads t fs
sets the file paths read by o
to fs
. Note that this resets the hash
.
val set_writes : t -> B0_std.Fpath.t list -> unit
set_writes t fs
sets the file paths written by o
to fs
.
val set_hash : t -> B0_std.Hash.t -> unit
set_hash o h
sets the operation hash to h
.
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 ->
t
spawn
declares a spawn build operation, see the corresponding accessors in Spawn
for the semantics of the various fields.
val read : id:id -> B0_std.Time.span -> B0_std.Fpath.t -> t
read
declares a file read operation, see the corresponding accessors in Read
for 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) result) ->
t
write
declares a file write operations, see the corresponding accessors in Write
for the semantics of the various fields.
val mkdir : id:id -> B0_std.Time.span -> B0_std.Fpath.t -> t
mkdir
declares 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 -> t
wait_files
declares a wait files operation, these are stored in reads
.