Skip to content

Commit

Permalink
[coq] [fix] Install .glob files
Browse files Browse the repository at this point in the history
This seems like an omission from the beginning, I'm surprised this
wasn't a problem for anyone until now.

Signed-off-by: Emilio Jesus Gallego Arias <e+git@x80.org>
  • Loading branch information
ejgallego committed May 30, 2024
1 parent e74efa6 commit 1a5e553
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions doc/changes/10602.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- install `.glob` files for Coq theories too (#10602, @ejgallego)
19 changes: 12 additions & 7 deletions src/dune_rules/coq/coq_module.ml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,17 @@ let glob_file x ~obj_dir =
Path.Build.relative vo_dir (x.name ^ ".glob")
;;

(* As of today we do the same for build and install, it used not to be
the case *)
let standard_obj_files ~(mode : Coq_mode.t) _obj_files_mode name =
let ext, glob =
match mode with
| VosOnly -> ".vos", []
| _ -> ".vo", [ name ^ ".glob" ]
in
[ name ^ ext ] @ glob
;;

(* XXX: Remove the install .coq-native hack once rules can output targets in
multiple subdirs *)
let obj_files x ~wrapper_name ~mode ~obj_dir ~obj_files_mode =
Expand All @@ -92,13 +103,7 @@ let obj_files x ~wrapper_name ~mode ~obj_dir ~obj_files_mode =
cmxs_obj
| VoOnly | VosOnly | Legacy -> []
in
let obj_files =
match obj_files_mode with
| Build when mode = VosOnly -> [ x.name ^ ".vos" ]
| Build -> [ x.name ^ ".vo"; x.name ^ ".glob" ]
| Install when mode = VosOnly -> [ x.name ^ ".vos" ]
| Install -> [ x.name ^ ".vo" ]
in
let obj_files = standard_obj_files ~mode obj_files_mode x.name in
List.map obj_files ~f:(fun fname ->
Path.Build.relative vo_dir fname, Filename.concat install_vo_dir fname)
@ native_objs
Expand Down

0 comments on commit 1a5e553

Please sign in to comment.