Skip to content

Commit

Permalink
stop recording deps in Action_builder.contents
Browse files Browse the repository at this point in the history
PR ocaml#9552 changed the semantics of Action_builder.contents so that it
records a dependency. The Coq rules were relying on the previous
behaviour of not recording a dependency in order to generate a build
plan. This caused issue ocaml#10149 to appear.

This PR fixes ocaml#10149 by removing the dependency being recorded in
Action_builder.contents matching the previous semantics.

Signed-off-by: Ali Caglayan <alizter@gmail.com>
  • Loading branch information
Alizter authored and emillon committed Apr 23, 2024
1 parent e89b813 commit 24911f9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 2 additions & 0 deletions doc/changes/10446.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Fix a bug where Coq projects were being rebuilt from scratch each time the
dependency graph changed. (#10446, fixes #10149, @alizter)
7 changes: 1 addition & 6 deletions src/dune_rules/action_builder.ml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,7 @@ let paths ps = deps (Dep.Set.of_files ps)
let path_set ps = deps (Dep.Set.of_files_set ps)
let dyn_paths paths = dyn_deps (paths >>| fun (x, paths) -> x, Dep.Set.of_files paths)
let dyn_paths_unit paths = dyn_deps (paths >>| fun paths -> (), Dep.Set.of_files paths)

let contents p =
let* () = Dep.file p |> Dep.Set.singleton |> Build_system.record_deps in
of_memo (Build_system.read_file p)
;;

let contents p = of_memo (Build_system.read_file p)
let lines_of p = contents p >>| String.split_lines

let read_sexp p =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
This test makes sure that a full rebuild is not triggered when the output of
coqdep is changed.

Currently this is the case and a bug:
This is as expected:
$ dune build --display=short
coqdep .bug.theory.d
coqc root.{glob,vo}
coqc leaf.{glob,vo}

0 comments on commit 24911f9

Please sign in to comment.