package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.file/B0_env/index.html
Module B0_env
Source
Execution environments.
This is notably what actions get access to.
Note. At some point we need a build/host distinction here.
The type for execution environments.
val make :
b0_dir:B0_std.Fpath.t ->
build:B0_build.t ->
cwd:B0_std.Fpath.t ->
root_dir:B0_std.Fpath.t ->
scope_dir:B0_std.Fpath.t ->
driver_env:B0_std.Os.Env.t ->
t
make ~cwd ~scope_dir ~root_dir ~action
is an execution context with given parameters. See corresponding accessors for semantics.
Directories
See also the relative file resolutions.
b0_dir env
is the b0 directory.
cwd env
is the absolute path to the current working directory.
root_dir env
is the root directory.
scope_dir env
is the absolute path to the directory of the b0 file in which the action is defined or the root directory if the action is defined the global scope.
scratch_dir env
is a shared scratch directory for actions in b0_dir
. The directory must be created it may not exist, it's content may be destroyed at any time and actions are in charge of inventing a naming scheme to avoid collisions.
unit_dir env u
is the build directory if u
in the build build env
. That is B0_build.unit_dir
(build env) u
.
The type for speciying directories.
pp_dir
formats directory specification for ui purposes.
dir env d
looks up d
in env
, raises Invalid_argument
on `Unit_dir
.
Relative file resolution
in_scope_dir env p
is Fpath.(root_dir env // p)
.
in_scope_dir env p
is Fpath.(scope_dir env // p)
.
in_scope_dir env p
is Fpath.(scratch_dir env // p)
.
in_unit_dir env u p
is Fpath.(unit_unit_dir env u // p)
.
in_dir env d p
is Fpath.(in_dir env d // p)
.
Process environments
The type for environments.
pp_env
formats environments.
build_env env
is the base build process environment.
driver_env env
is the environment with which b0
was invoked.
env env e
is the environment e
of env
.
Build
build env
is the current build (if any).
Tool lookup
get_cmd env cmd
is cmd
with its B0_std.Cmd.get_tool
resolved in the environment. If cmd
's tool is defined by a unit in the build and is B0_unit.tool_is_user_accessible
, it comes first in the search, unless skip_build
is true
(defaults to false
.
unit_exe_file env u
looks up the B0_unit.exe_file
of u
in env
. This errors if u
can't be found in the build of if u
has no such key.
unit_exe_file env u
is Result.map Cmd.path (unit_exe_file env u)
.