package b0
Install
Dune Dependency
Authors
Maintainers
Sources
sha512=78fd9e53b84cf5d6bf497adaf4b6d7d974134044318639cdfe5e01c7faaa8d987d04769abe3b3b1cbdb937132e21d8723dc185cd3c68433a793278907a8e757e
doc/b0.b00/B000/Op/Spawn/index.html
Module Op.Spawn
Tool spawns.
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 programisatty(3)
will befalse
on the fds.`File p
redirect the output to file pathp
.`Tee p
, is both`Ui
andFile `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 in Spawn
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.
get o
is the spawn o
. Raises Invalid_argument
if o
is not a spawn.
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
.