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(cinaps): offer all promotions #7901

Merged
merged 1 commit into from
Jun 6, 2023
Merged
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
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
Unreleased
----------

- Cinaps: The promotion rules for cinaps would only offer one file at a time no
matter how many promotions were available. Now we offer all the promotions at
once (#7901, @rgrinberg)

- Do not re-run OCaml syntax files on every iteration of the watch mode. This
is too memory consuming. (#7894, fix #6900, @rgrinberg)

Expand Down
12 changes: 7 additions & 5 deletions src/dune_rules/cinaps.ml
Original file line number Diff line number Diff line change
Expand Up @@ -180,11 +180,13 @@ let gen_rules sctx t ~dir ~scope =
Action.Full.make ~sandbox
@@ A.chdir (Path.build dir)
(A.progn
(A.run (Ok cinaps_exe) [ "-diff-cmd"; "-" ]
:: List.map cinapsed_files ~f:(fun fn ->
A.diff ~optional:true (Path.build fn)
(Path.Build.extend_basename fn ~suffix:".cinaps-corrected"))
))
[ A.run (Ok cinaps_exe) [ "-diff-cmd"; "-" ]
; A.concurrent
@@ List.map cinapsed_files ~f:(fun fn ->
A.diff ~optional:true (Path.build fn)
(Path.Build.extend_basename fn
~suffix:".cinaps-corrected"))
])
in
let cinaps_alias =
Alias.make ~dir @@ Option.value t.alias ~default:cinaps_alias
Expand Down
3 changes: 3 additions & 0 deletions test/blackbox-tests/test-cases/cinaps/concurrent-promotions.t
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,7 @@ Cinaps should offer all promotions at once
File "t1.ml", line 1, characters 0-0:
Error: Files _build/default/t1.ml and _build/default/t1.ml.cinaps-corrected
differ.
File "t2.ml", line 1, characters 0-0:
Error: Files _build/default/t2.ml and _build/default/t2.ml.cinaps-corrected
differ.
[1]
Loading