Skip to content

Commit

Permalink
Merge pull request #2088 from ejgallego/coq+full_deps
Browse files Browse the repository at this point in the history
[coq] Pass closure of ML libs to Coq tools.
  • Loading branch information
ejgallego authored Apr 26, 2019
2 parents 817f6ed + af0a868 commit ea9080d
Show file tree
Hide file tree
Showing 13 changed files with 37 additions and 20 deletions.
3 changes: 2 additions & 1 deletion src/coq_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,8 @@ let setup_ml_deps ~lib_db libs =

(* Pair of include flags and paths to mlpack *)
let ml_iflags, mlpack =
let libs = libs_of_coq_deps ~lib_db libs in
let libs = libs_of_coq_deps ~lib_db libs
|> Lib.closure ~linking:false |> Result.ok_exn in
Util.include_flags libs, List.concat_map ~f:ml_pack_files libs
in

Expand Down
1 change: 0 additions & 1 deletion test/blackbox-tests/test-cases/coq/ml_lib/src/simple.ml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(public_name ml_lib.ml_plugin)
(name ml_plugin)
(public_name ml_lib.ml_plugin_a)
(name ml_plugin_a)
(flags :standard -rectypes)
(libraries coq.plugins.ltac))

Expand Down
2 changes: 2 additions & 0 deletions test/blackbox-tests/test-cases/coq/ml_lib/src_a/simple.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
let a = 3
let _ = a
5 changes: 5 additions & 0 deletions test/blackbox-tests/test-cases/coq/ml_lib/src_b/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(public_name ml_lib.ml_plugin_b)
(name ml_plugin_b)
(flags :standard -rectypes)
(libraries ml_plugin_a))
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let _ = Ml_plugin_a.Simple.a
3 changes: 2 additions & 1 deletion test/blackbox-tests/test-cases/coq/ml_lib/theories/a.v
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
Declare ML Module "ml_plugin".
Declare ML Module "ml_plugin_a".
Declare ML Module "ml_plugin_b".

2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/coq/ml_lib/theories/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
(name Plugin)
(public_name ml_lib.Plugin)
(synopsis "Test Plugin")
(libraries coq.plugins.ltac ml_lib.ml_plugin)
(libraries ml_lib.ml_plugin_b)
(modules :standard))
36 changes: 22 additions & 14 deletions test/blackbox-tests/test-cases/coq/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,29 @@

$ dune build --root ml_lib --display short --debug-dependency-path @all
Entering directory 'ml_lib'
coqpp src/gram.ml
ocamldep src/.ml_plugin.objs/gram.ml.d
ocamlc src/.ml_plugin.objs/byte/ml_plugin.{cmi,cmo,cmt}
ocamlopt src/.ml_plugin.objs/native/ml_plugin.{cmx,o}
ocamldep src/.ml_plugin.objs/gram.mli.d
ocamlc src/.ml_plugin.objs/byte/ml_plugin__Gram.{cmi,cmti}
ocamlc src/.ml_plugin.objs/byte/ml_plugin__Gram.{cmo,cmt}
ocamldep src/.ml_plugin.objs/simple.ml.d
ocamlc src/.ml_plugin.objs/byte/ml_plugin__Simple.{cmi,cmo,cmt}
ocamlc src/ml_plugin.cma
coqpp src_a/gram.ml
ocamldep src_a/.ml_plugin_a.objs/gram.ml.d
ocamlc src_a/.ml_plugin_a.objs/byte/ml_plugin_a.{cmi,cmo,cmt}
ocamlopt src_a/.ml_plugin_a.objs/native/ml_plugin_a.{cmx,o}
ocamldep src_a/.ml_plugin_a.objs/gram.mli.d
ocamlc src_a/.ml_plugin_a.objs/byte/ml_plugin_a__Gram.{cmi,cmti}
ocamlc src_a/.ml_plugin_a.objs/byte/ml_plugin_a__Gram.{cmo,cmt}
ocamldep src_a/.ml_plugin_a.objs/simple.ml.d
ocamlc src_a/.ml_plugin_a.objs/byte/ml_plugin_a__Simple.{cmi,cmo,cmt}
ocamlc src_a/ml_plugin_a.cma
ocamlc src_b/.ml_plugin_b.objs/byte/ml_plugin_b.{cmi,cmo,cmt}
ocamlopt src_b/.ml_plugin_b.objs/native/ml_plugin_b.{cmx,o}
ocamldep src_b/.ml_plugin_b.objs/simple_b.ml.d
ocamlc src_b/.ml_plugin_b.objs/byte/ml_plugin_b__Simple_b.{cmi,cmo,cmt}
ocamlc src_b/ml_plugin_b.cma
coqdep theories/a.v.d
ocamlopt src/.ml_plugin.objs/native/ml_plugin__Gram.{cmx,o}
ocamlopt src/.ml_plugin.objs/native/ml_plugin__Simple.{cmx,o}
ocamlopt src/ml_plugin.{a,cmxa}
ocamlopt src/ml_plugin.cmxs
ocamlopt src_a/.ml_plugin_a.objs/native/ml_plugin_a__Gram.{cmx,o}
ocamlopt src_a/.ml_plugin_a.objs/native/ml_plugin_a__Simple.{cmx,o}
ocamlopt src_a/ml_plugin_a.{a,cmxa}
ocamlopt src_a/ml_plugin_a.cmxs
ocamlopt src_b/.ml_plugin_b.objs/native/ml_plugin_b__Simple_b.{cmx,o}
ocamlopt src_b/ml_plugin_b.{a,cmxa}
ocamlopt src_b/ml_plugin_b.cmxs
coqc theories/a.vo

$ dune build --root base --display short --debug-dependency-path @default
Expand Down

0 comments on commit ea9080d

Please sign in to comment.