package b0
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha512=e9aa779e66c08fc763019f16d4706f465d16c05d6400b58fbd0313317ef33ddea51952e2b058db28e65f7ddb7012f328c8bf02d8f1da17bb543348541a2587f0
doc/b0.file/B0_ocaml/Libresolver/Scope/index.html
Module Libresolver.ScopeSource
Resolution scopes.
Resolution scopes allow to compose and order multiple library resolution mechanisms. In particular it allows b0 to lookup for libraries in builds before trying to resolve them in in the build environment.
Scopes
The type for the scope finding function.
The type for the scope missing library suggestion function.
The type for scopes. A scope has a name, a library lookup function and possibly a function to indicate how to troubleshoot a missing library.
make ~name ~find ~suggest is a scope named name looking up libraries with find and giving suggestions on missing libraries with suggest.
Properties
Predefined
cache_dir_name is a name that can be used for the cache directory of resolution scopes.
ocampath ~cache_dir looks up libraries according to the OCaml library convention in the OCAMLPATH of the memo using cache_dir to cache results.
Note. This is a nop for now.
ocamlfind ~cache_dir looks up libraries using ocamlfind and caches the result in cache_dir.
A few simplyifing assumptions are made by the resolver, which basically boil down to query the library name LIB with:
ocamlfind query LIB -predicates byte,native -format …to derive a Lib.t value (see the sources for the current -format arugment. This may fail on certain libraries. In particular it assumes a one-to-one map between ocamlfind package names and library names and that the archives are in the library directory.
Also the ocaml.threads, threads and threads.posix libraries are treated specially: they all lookup threads.posix with predicates mt,mt_posix on OCaml < 5.0.0 and simply threads otherwise. threads.vm is unsupported (but deprecated anyways).
build b conf is a library resolver scope for OCaml libraries that can be built in b. For a unit u to be recognized as such it has to:
- It looks if the library name is defined by a unit that may be built. If that is the case it creates a library out of that build unit via
Lib.of_unitand resolves to library name to it. - TODO public stuff