aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-06-22 17:52:18 +0200
committerEmilio Jesus Gallego Arias2021-03-03 16:06:14 +0100
commitab98d847d237af3cd0e46edef42218be65cfc98f (patch)
tree91d26077257724e2eeefe1bf39e24f24d34070be /lib
parentef22a5aaf1728d840341d31befd67dd90c5b2e0e (diff)
[build] Split stdlib to it's own opam package.
We introduce a new package structure for Coq: - `coq-core`: Coq's OCaml tools code and plugins - `coq-stdlib`: Coq's stdlib [.vo files] - `coq`: meta-package that pulls `coq-{core,stdlib}` This has several advantages, in particular it allows to install Coq without the stdlib which is useful in several scenarios, it also open the door towards a versioning of the stdlib at the package level. The main user-visible change is that Coq's ML development files now live in `$lib/coq-core`, for compatibility in the regular build we install a symlink and support both setups for a while. Note that plugin developers and even `coq_makefile` should actually rely on `ocamlfind` to locate Coq's OCaml libs as to be more robust. There is a transient state where we actually look for both `$coqlib/plugins` and `$coqlib/../coq-core/plugins` as to support the non-ocamlfind plus custom variables. This will be much improved once #13617 is merged (which requires this PR first), then, we will introduce a `coq.boot` library so finally `coqdep`, `coqchk`, etc... can share the same path setup code. IMHO the plan should work fine.
Diffstat (limited to 'lib')
-rw-r--r--lib/dune4
-rw-r--r--lib/envars.ml5
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/dune b/lib/dune
index 83783f9b5c..af30c9ae1f 100644
--- a/lib/dune
+++ b/lib/dune
@@ -1,7 +1,7 @@
(library
(name lib)
(synopsis "Coq's Utility Library [coq-specific]")
- (public_name coq.lib)
+ (public_name coq-core.lib)
(wrapped false)
(modules_without_implementation xml_datatype)
- (libraries coq.clib coq.config))
+ (libraries coq-core.clib coq-core.config))
diff --git a/lib/envars.ml b/lib/envars.ml
index 1702b5d7a2..823d255f58 100644
--- a/lib/envars.ml
+++ b/lib/envars.ml
@@ -132,7 +132,9 @@ let guess_coqlib fail =
if not Coq_config.local && Sys.file_exists (Coq_config.coqlib / prelude)
then Coq_config.coqlib
else
- fail "cannot guess a path for Coq libraries; please use -coqlib option")
+ fail "cannot guess a path for Coq libraries; please use -coqlib option \
+ or ensure you have installed the package contaning Coq's stdlib (coq-stdlib in OPAM) \
+ If you intend to use Coq without a standard library, the -boot -noinit options must be used.")
)
let coqlib : string option ref = ref None
@@ -205,6 +207,7 @@ let print_config ?(prefix_var_name="") f coq_src_subdirs =
let open Printf in
fprintf f "%sLOCAL=%s\n" prefix_var_name (if Coq_config.local then "1" else "0");
fprintf f "%sCOQLIB=%s/\n" prefix_var_name (coqlib ());
+ fprintf f "%sCOQCORELIB=%s/\n" prefix_var_name (if Coq_config.local then coqlib () else coqlib () / "../coq-core/");
fprintf f "%sDOCDIR=%s/\n" prefix_var_name (docdir ());
fprintf f "%sOCAMLFIND=%s\n" prefix_var_name (ocamlfind ());
fprintf f "%sCAMLFLAGS=%s\n" prefix_var_name Coq_config.caml_flags;