Module B00.Env

module Env: sig .. end
Build environment.

Build environments control tool lookup and the environment of tool spawns.



Tool lookup


type tool_lookup = B0_std.Cmd.tool -> (B0_std.Fpath.t, string) Pervasives.result 
The type for tool lookups. Given a command line tool specification returns a file path to the tool executable or an error message mentioning the tool if it cannot be found.
val env_tool_lookup : ?sep:string -> ?var:string -> B0_std.Os.Env.t -> tool_lookup
env_tool_lookup ~sep ~var env is a tool lookup that gets the value of the var variable in env treats it as a sep separated search path and uses the result to lookup with B0_std.Os.Cmd.must_find. var defaults to PATH and sep to B0_std.Fpath.search_path_sep.

Environment


type t 
The type for build environments.
val v : ?lookup:tool_lookup ->
?forced_env:B0_std.Os.Env.t -> B0_std.Os.Env.t -> t
v ~lookup ~forced_env env is a build environment with:
val env : t -> B0_std.Os.Env.t
env e is e's available spawn environment.
val forced_env : t -> B0_std.Os.Env.t
forced_env e is e's forced spawn environment.
val tool : t -> B0_std.Cmd.tool -> (B0_std.Fpath.t, string) Pervasives.result
tool e t looks up tool t in e.