Module Boot.Env

Coq runtime enviroment API.

This module provides functions for manipulation of Coq's runtime enviroment, including the standard directories and support files.

This API is similar in spirit to findlib's or dune-sites API, see their documentation for more information:

It is important that this library has a minimal dependency set.

The Coq runtime enviroment needs to be properly initialized before use; we detail the rules below. It is recommended that applications requiring multiple accesses to the environment, do initialize it once and keep a ref to it. We don't forbid yet double initialization, (second time is a noop) but we may do so in the future. Rules for "coqlib" are:

  1. coqlibsuffix given in configure
  2. coqlib given in configure

Note that set_coqlib is used by some commands to process the -coqlib option, as of now this sets both coqlib and coqcorelib; this part of the initialization will be eventually moved here.

The error handling policy of this module is simple for now: failing to initialize Coq's env will produce a fatal error, and the application will exit with code 1. No error handling is thus required on the client yet.

module Path : sig ... end

This API is loosely inspired by Stdune.Path, for now we keep it minimal, but at some point we may extend it.

type t

Coq runtime enviroment, including location of Coq's stdlib

val init : unit -> t

init () will initialize the Coq environment.

val stdlib : t -> Path.t

stdlib directory

val plugins : t -> Path.t

plugins directory

val user_contrib : t -> Path.t

user contrib directory

val tool : t -> string -> Path.t

tool-specific directory

val native_cmi : t -> string -> Path.t

.cmi files needed for native compilation

val revision : t -> Path.t

The location of the revision file

val corelib : t -> Path.t

coq-core/lib directory, not sure if to keep this

val coqlib : t -> Path.t

coq/lib directory, not sure if to keep this

val set_coqlib : string -> unit

Internal, should be set automatically by passing cmdline args to init; note that this will set both coqlib and corelib for now.