package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.file/B0_build/index.html
Module B0_buildSource
Builds.
Centralizes the information to run and orchestrate a b0 build.
Build
The type for sets of build units. See B0_unit.Set.t.
The type for builds.
Units
must_build b are the units in b that must build.
may_build b are all the units in b that may build, i.e. that can be required. This includes the elements in must_build b.
require_unit b u asks to build unit u in b. This fails the memo if b is u is not in may_build.
require_units b us is List.iter (require_unit b) us.
current b is b's current unit. In the build procedure of a unit this is the unit itself.
Directories
FIXME Unify the directory story with B0_action and We likely want to get rid of a few of the functions below.
unit_dir b u is the unit build directory for unit u. This is where u should write is build artefacts.
unit_scope_dir b u is the directory of the b0 file in which u was defined. This is were unit relative paths like source files should be resolved.
current_dir b is unit_dir b current.
scope_dir b is unit_scope_dir b current.
shared_dir b is a build directory shared by all units of the build. This is used by computations shared by units, most of the time one should rather use current_dir.
Relative file resolution
in_unit_dir b u p is Fpath.(unit_dir b u // p).
in_unit_scope_dir b u p is Fpath.(unit_scope_dir b u // p))
in_current_dir b p is Fpath.(current_dir b // p)).
in_scope_dir b p is Fpath.(scope_dir b // p)).
in_shared_dir b p is Fpath.(shared_dir b // p)).
Store
store b is the store for the build. Note that b itself can be found in store via the self key.
get b k is B0_store.get (store b) k.
self is a store key that holds the build itself. The store returned by store has this key bound to the build.
Creating and running
val make :
root_dir:B0_std.Fpath.t ->
b0_dir:B0_std.Fpath.t ->
variant:string ->
store:B0_store.binding list ->
B0_memo.t ->
may_build:b0_unit_set ->
must_build:b0_unit_set ->
tmake ~root_dir ~b0_dir m ~may_build ~must_build
must_buildare the build units that must be build byb.may_buildare the build units that may build inb.mustunits are automatically added to this set.
did_build b are the units that did build. This is meaningless before run has finished.