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 v_op : id:id -> mark:mark -> created:B00_std.Time.span -> reads:B00_std.Fpath.t list -> writes:B00_std.Fpath.t list ->
?writes_manifest_root:B00_std.Fpath.t -> ?post_exec:(op -> unit) -> ?k:(op -> unit) -> stamp:string -> env:B00_std.Os.Env.assignments ->
stamped_env:B00_std.Os.Env.assignments -> cwd:B00_std.Fpath.t -> stdin:B00_std.Fpath.t option -> stdout:stdo -> stderr:stdo -> success_exits:success_exits -> B00_std.Cmd.tool -> B00_std.Cmd.t -> op
v_op
declares a spawn build operation, see the corresponding accessors for the semantics of the various arguments.
val v : env:B00_std.Os.Env.assignments -> stamped_env:B00_std.Os.Env.assignments -> cwd:B00_std.Fpath.t -> stdin:B00_std.Fpath.t option -> stdout:stdo -> stderr:stdo ->
success_exits:success_exits -> B00_std.Cmd.tool -> B00_std.Cmd.t -> stamp:string -> stdo_ui:(string, string) result option ->
exit:B00_std.Os.Cmd.status option -> t
v
constructs a bare spawn operation.
val env : t -> B00_std.Os.Env.assignments
env s
is the environment in which s
runs.
val stamped_env : t -> B00_std.Os.Env.assignments
stamped_env s
are the assignements of env s
that may influence the tool outputs.
val cwd : t -> B00_std.Fpath.t
cwd s
is the cwd with which s
runs.
val stdin : t -> B00_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 -> B00_std.Cmd.tool
tool t
is the spawned tool. Note that this has to be a full path at that point.
val args : t -> B00_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.
stdo_ui sr
is the standard outputs redirection contents of s
once it has executed (if any).
set_stdo_ui w ui
sets w
's standard output redirection contents to ui
.
val exit : t -> B00_std.Os.Cmd.status option
exit s
is the spawn exit status of s
.
val set_exit : t -> B00_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
.