Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(coq): pass correct flags to coqdep when building boot libs #7942

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Unreleased
- In opam constraints, reject `(and)` and `(or)` with no arguments at parse
time (#7730, @emillon)

- Fix `-boot` flag being passed to `coqdep` when composing with Coq stdlib
(#7942, @Alizter)

3.8.1 (2023-06-05)
------------------

Expand Down
12 changes: 6 additions & 6 deletions src/dune_rules/coq/coq_rules.ml
Original file line number Diff line number Diff line change
Expand Up @@ -130,14 +130,14 @@ let theories_flags ~theories_deps =
let+ libs = theories_deps in
Command.Args.S (List.map ~f:theory_coqc_flag libs))

let boot_flags ~coq_lang_version t : _ Command.Args.t =
let boot_flag = if coq_lang_version >= (0, 8) then [ "-boot" ] else [] in
match t with
let boot_flags ~coq_lang_version : _ -> _ Command.Args.t = function
| `Bootstrap _ -> A "-boot"
(* We are compiling the prelude itself
[should be replaced with (per_file ...) flags] *)
| `Bootstrap_prelude -> As ("-noinit" :: boot_flag)
(* No special case *)
| `No_boot | `Bootstrap _ -> As boot_flag
| `Bootstrap_prelude -> As [ "-boot"; "-noinit" ]
(* On >= 0.8 we always need to pass -boot *)
| `No_boot ->
if coq_lang_version >= (0, 8) then A "-boot" else Command.Args.empty

let coqc_file_flags ~dir ~theories_deps ~wrapper_name ~boot_type ~ml_flags
~coq_lang_version : _ Command.Args.t list =
Expand Down