Module Op.Spawn
Tool spawns.
Tool spawns
type stdo
=[
|
`Ui
|
`File of B0_std.Fpath.t
|
`Tee of B0_std.Fpath.t
]
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
.
type success_exits
= int list
The list of process exit codes that indicate success. If the list is empty this any exit code.
val env : t -> B0_std.Os.Env.assignments
env s
is the environment in whichs
runs.
val relevant_env : t -> B0_std.Os.Env.assignments
relevant_env s
are the assignements ofenv s
that should be taken into account for caching.
val cwd : t -> B0_std.Fpath.t
cwd s
is the cwd with whichs
runs.
val stdin : t -> B0_std.Fpath.t option
stdin s
is the files
uses as stdin (if any).
val success_exits : t -> success_exits
success_exits s
is the list of process exit codess
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 stdo_ui : t -> (string, string) Stdlib.result option
stdo_ui sr
is the standard outputs redirection contents ofs
once it has executed (if any).
val set_stdo_ui : t -> (string, string) Stdlib.result option -> unit
set_stdo_ui w ui
setsw
's standard output redirection contents toui
.
val result : t -> (B0_std.Os.Cmd.status, string) Stdlib.result
result s
is the spawn result ofs
.
val set_result : t -> (B0_std.Os.Cmd.status, string) Stdlib.result -> unit
set_result s e
the spawn result ofs
toe
.
Formatters
val pp_success_exits : int list B0_std.Fmt.t
pp_success_exits
formats the success exits.
val pp_cmd : t B0_std.Fmt.t
pp_cmd
formats the command issued by the spawn.
val pp_stdo_ui : elide:bool -> t B0_std.Fmt.t
pp_stdo_ui
formats the standard output ui of the spawn. Ifelide
is true elides long outputs.
val pp_result : (B0_std.Os.Cmd.status, string) Stdlib.result B0_std.Fmt.t
pp_result
formats the command status of the spawn.
val pp : t B0_std.Fmt.t
pp
formats a spawn.