Op.Spawn
Tool spawns.
The type for spawn standard outputs redirections.
`Ui
redirects the output to the user interface of the build system (usually only shown in case of failure). Outputs are always first redirected to a file and read back by the program running the build on completion, this means that in the spawn program isatty(3)
will be false
on the fds.`File p
redirect the output to file path p
.`Tee p
, is both `Ui
and File `f
.The list of process exit codes that indicate success. If the list is empty this any exit code.
val make_op :
id:id ->
mark:mark ->
created:B0_std.Mtime.Span.t ->
reads:B0_std.Fpath.t list ->
writes:B0_std.Fpath.t list ->
?writes_manifest_root:B0_std.Fpath.t ->
?post_exec:(op -> unit) ->
?k:(op -> unit) ->
stamp:string ->
env:B0_std.Os.Env.assignments ->
stamped_env:B0_std.Os.Env.assignments ->
cwd:B0_std.Fpath.t ->
stdin:B0_std.Fpath.t option ->
stdout:stdo ->
stderr:stdo ->
success_exits:success_exits ->
B0_std.Cmd.tool ->
B0_std.Cmd.t ->
op
make_op
declares a spawn build operation, see the corresponding accessors for the semantics of the various arguments.
val make :
env:B0_std.Os.Env.assignments ->
stamped_env:B0_std.Os.Env.assignments ->
cwd:B0_std.Fpath.t ->
stdin:B0_std.Fpath.t option ->
stdout:stdo ->
stderr:stdo ->
success_exits:success_exits ->
B0_std.Cmd.tool ->
B0_std.Cmd.t ->
stamp:string ->
stdo_ui:(string, string) Stdlib.result option ->
exit:B0_std.Os.Cmd.status option ->
t
make
constructs a bare spawn operation.
val env : t -> B0_std.Os.Env.assignments
env s
is the environment in which s
runs.
val stamped_env : t -> B0_std.Os.Env.assignments
stamped_env s
are the assignements of env s
that may influence the tool outputs.
val cwd : t -> B0_std.Fpath.t
cwd s
is the cwd with which s
runs.
val stdin : t -> B0_std.Fpath.t option
stdin s
is the file s
uses as stdin (if any).
val success_exits : t -> success_exits
success_exits s
is the list of process exit codes s
that indicate success.
val tool : t -> B0_std.Cmd.tool
tool t
is the spawned tool. Note that this has to be a full path at that point.
val args : t -> B0_std.Cmd.t
args s
are the spawned tool arguments.
val stamp : t -> string
stamp s
is a stamp that is used for caching. Two spans operations all otherwise equal but differing only in their stamp must not cache to the same key.
val stdo_ui : t -> (string, string) Stdlib.result option
stdo_ui sr
is the standard outputs redirection contents of s
once it has executed (if any).
val set_stdo_ui : t -> (string, string) Stdlib.result option -> unit
set_stdo_ui w ui
sets w
's standard output redirection contents to ui
.
val exit : t -> B0_std.Os.Cmd.status option
exit s
is the spawn exit status of s
.
val set_exit : t -> B0_std.Os.Cmd.status option -> unit
set_exit s e
the spawn exit status of s
to e
.
exit_to_status s
assumes s
has been executed and determines an operation status according to exit
and success_exits
.