aboutsummaryrefslogtreecommitdiff
path: root/dev
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2018-10-16 15:17:31 +0200
committerEmilio Jesus Gallego Arias2018-10-23 01:17:24 +0200
commitf8881bcc694644700e20f475b0a36ec740b2547d (patch)
treea7b532f3f0603084e7fddb8a80e29a5d92fdd964 /dev
parent1db19a8f454e0f8c5a60101c87ccd38e0883d530 (diff)
[dune] Compile debug and checker printers.
As noted by Gäetan, we didn't compile these. We also provide a recipe to run `ocamldebug`. Try (after a build): ``` dune exec dev/dune-dbg (ocd) source dune_db ``` or ``` dune exec dev/dune-dbg checker (ocd) source checker_dune_db ``` for the checker.
Diffstat (limited to 'dev')
-rw-r--r--dev/checker_dune_db5
-rw-r--r--dev/core_dune.dbg20
-rw-r--r--dev/doc/build-system.dune.md21
-rw-r--r--dev/dune25
-rwxr-xr-xdev/dune-dbg.in11
-rw-r--r--dev/dune_db6
6 files changed, 88 insertions, 0 deletions
diff --git a/dev/checker_dune_db b/dev/checker_dune_db
new file mode 100644
index 0000000000..cdb6a4b809
--- /dev/null
+++ b/dev/checker_dune_db
@@ -0,0 +1,5 @@
+source checker_dune.dbg
+
+load_printer checker_printers.cma
+
+source checker_printers.dbg
diff --git a/dev/core_dune.dbg b/dev/core_dune.dbg
new file mode 100644
index 0000000000..cf9c5bd39a
--- /dev/null
+++ b/dev/core_dune.dbg
@@ -0,0 +1,20 @@
+load_printer threads.cma
+load_printer str.cma
+load_printer gramlib.cma
+load_printer config.cma
+load_printer clib.cma
+load_printer dynlink.cma
+load_printer lib.cma
+load_printer byterun.cma
+load_printer kernel.cma
+load_printer library.cma
+load_printer engine.cma
+load_printer pretyping.cma
+load_printer interp.cma
+load_printer proofs.cma
+load_printer parsing.cma
+load_printer printing.cma
+load_printer tactics.cma
+load_printer vernac.cma
+load_printer stm.cma
+load_printer toplevel.cma
diff --git a/dev/doc/build-system.dune.md b/dev/doc/build-system.dune.md
index 91ab57f1e9..0aeb30c4e8 100644
--- a/dev/doc/build-system.dune.md
+++ b/dev/doc/build-system.dune.md
@@ -68,6 +68,27 @@ Note that you must invoke the `#rectypes;;` toplevel flag in order to
use Coq libraries. The provided `.ocamlinit` file does this
automatically.
+## ocamldebug
+
+You can use `ocamldebug` with Dune; after a build, do:
+
+```
+dune exec dev/dune-dbg
+(ocd) source dune_db
+```
+
+or
+
+```
+dune exec dev/dune-dbg checker
+(ocd) source checker_dune_db
+```
+
+for the checker. Unfortunately, dependency handling here is not fully
+refined, so you need to build enough of Coq once to use this target
+[it will then correctly compute the deps and rebuild if you call the
+script again] This will be fixed in the future.
+
## Compositionality, developer and release modes.
By default [in "developer mode"], Dune will compose all the packages
diff --git a/dev/dune b/dev/dune
new file mode 100644
index 0000000000..fd6c8cf32c
--- /dev/null
+++ b/dev/dune
@@ -0,0 +1,25 @@
+(library
+ (name top_printers)
+ (public_name coq.top_printers)
+ (synopsis "Coq's Debug Printers")
+ (wrapped false)
+ (modules :standard \ checker_printers)
+ (libraries coq.toplevel coq.plugins.ltac))
+
+(library
+ (name checker_printers)
+ (public_name coq.checker_printers)
+ (synopsis "Coq's Debug Printers [for the Checker]")
+ (wrapped false)
+ (flags :standard -open Checklib)
+ (modules checker_printers)
+ (libraries coq.checklib))
+
+(rule
+ (targets dune-dbg)
+ (deps dune-dbg.in
+ ../checker/main.bc
+ ../topbin/coqtop_byte_bin.bc
+ ; This is not enough as the call to `ocamlfind` will fail :/
+ top_printers.cma)
+ (action (copy dune-dbg.in dune-dbg)))
diff --git a/dev/dune-dbg.in b/dev/dune-dbg.in
new file mode 100755
index 0000000000..464e026400
--- /dev/null
+++ b/dev/dune-dbg.in
@@ -0,0 +1,11 @@
+#!/usr/bin/env bash
+
+# Run in a proper install dune env.
+case $1 in
+checker)
+ ocamldebug `ocamlfind query -recursive -i-format coq.checker_printers` -I +threads -I dev _build/default/checker/main.bc
+ ;;
+*)
+ ocamldebug `ocamlfind query -recursive -i-format coq.top_printers` -I +threads -I dev _build/default/topbin/coqtop_byte_bin.bc
+ ;;
+esac
diff --git a/dev/dune_db b/dev/dune_db
new file mode 100644
index 0000000000..f920f7c75c
--- /dev/null
+++ b/dev/dune_db
@@ -0,0 +1,6 @@
+source core_dune.dbg
+
+load_printer ltac_plugin.cma
+load_printer top_printers.cma
+
+source top_printers.dbg