Skip to content

Commit

Permalink
Add .glob files as coqc targets as well
Browse files Browse the repository at this point in the history
Signed-off-by: Rudi Grinberg <me@rgrinberg.com>
  • Loading branch information
rgrinberg committed Aug 21, 2020
1 parent 8d30a98 commit af82d8c
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 11 deletions.
3 changes: 2 additions & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Unreleased
----------

- Add missing `.aux` targets to coq rules (3721, fixes #3437, @rgrinberg)
- Add missing `.aux` & `.glob` targets to coq rules (3721, fixes #3437,
@rgrinberg)

2.7.0 (13/08/2020)
------------------
Expand Down
4 changes: 4 additions & 0 deletions src/dune/coq_module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ let aux_file x ~obj_dir =
let vo_dir = build_vo_dir ~obj_dir x in
Path.Build.relative vo_dir ("." ^ x.name ^ ".aux")

let glob_file x ~obj_dir =
let vo_dir = build_vo_dir ~obj_dir x in
Path.Build.relative vo_dir (x.name ^ ".glob")

let obj_file x ~obj_dir =
let vo_dir = build_vo_dir ~obj_dir x in
Path.Build.relative vo_dir (x.name ^ ".vo")
Expand Down
2 changes: 2 additions & 0 deletions src/dune/coq_module.mli
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ val dep_file : t -> obj_dir:Path.Build.t -> Path.Build.t

val aux_file : t -> obj_dir:Path.Build.t -> Path.Build.t

val glob_file : t -> obj_dir:Path.Build.t -> Path.Build.t

val obj_file : t -> obj_dir:Path.Build.t -> Path.Build.t

val to_dyn : t -> Dyn.t
Expand Down
3 changes: 2 additions & 1 deletion src/dune/coq_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,8 @@ let coqc_rule (cctx : _ Context.t) ~file_flags coq_module =
let file_flags =
let object_to = Coq_module.obj_file ~obj_dir:cctx.dir coq_module in
let aux = Coq_module.aux_file ~obj_dir:cctx.dir coq_module in
[ Command.Args.Hidden_targets [ object_to; aux ]
let glob = Coq_module.glob_file ~obj_dir:cctx.dir coq_module in
[ Command.Args.Hidden_targets [ object_to; aux; glob ]
; S file_flags
; Command.Args.Dep (Path.build source)
]
Expand Down
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/base-unsound.t/run.t
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
$ dune build --display short --profile unsound --debug-dependency-path @all
coqdep bar.v.d
coqdep foo.v.d
coqc .foo.aux,foo.vo
coqc .bar.aux,bar.vo
coqc .foo.aux,foo.{glob,vo}
coqc .bar.aux,bar.{glob,vo}
4 changes: 2 additions & 2 deletions test/blackbox-tests/test-cases/coq/base.t/run.t
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
$ dune build --display short --debug-dependency-path @all
coqdep bar.v.d
coqdep foo.v.d
coqc .foo.aux,foo.vo
coqc .bar.aux,bar.vo
coqc .foo.aux,foo.{glob,vo}
coqc .bar.aux,bar.{glob,vo}

$ dune build --debug-dependency-path @default
lib: [
Expand Down
2 changes: 1 addition & 1 deletion test/blackbox-tests/test-cases/coq/ml-lib.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
ocamlopt src_b/ml_plugin_b.{a,cmxa}
ocamlopt src_a/ml_plugin_a.cmxs
ocamlopt src_b/ml_plugin_b.cmxs
coqc theories/.a.aux,theories/a.vo
coqc theories/.a.aux,theories/a.{glob,vo}
8 changes: 4 additions & 4 deletions test/blackbox-tests/test-cases/coq/rec-module.t/run.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
coqdep b/foo.v.d
coqdep c/d/bar.v.d
coqdep c/ooo.v.d
coqc b/.foo.aux,b/foo.vo
coqc c/d/.bar.aux,c/d/bar.vo
coqc c/.ooo.aux,c/ooo.vo
coqc a/.bar.aux,a/bar.vo
coqc b/.foo.aux,b/foo.{glob,vo}
coqc c/d/.bar.aux,c/d/bar.{glob,vo}
coqc c/.ooo.aux,c/ooo.{glob,vo}
coqc a/.bar.aux,a/bar.{glob,vo}

$ dune build --debug-dependency-path @default
lib: [
Expand Down

0 comments on commit af82d8c

Please sign in to comment.