package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.memo/B0_zero/Op/Spawn/index.html
Module Op.Spawn
Source
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.
The type for process spawn operations.
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) result option ->
exit:B0_std.Os.Cmd.status option ->
t
make
constructs a bare spawn operation.
env s
is the environment in which s
runs.
stamped_env s
are the assignements of env s
that may influence the tool outputs.
cwd s
is the cwd with which s
runs.
stdin s
is the file s
uses as stdin (if any).
success_exits s
is the list of process exit codes s
that indicate success.
tool t
is the spawned tool. Note that this has to be a full path at that point.
args s
are the spawned tool arguments.
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
.
exit s
is the spawn exit status of s
.
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
.