Skip to content

Commit

Permalink
Also clear status line in case of error, as Jérémie Dimino requested
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Hu <alanh@ccs.neu.edu>
  • Loading branch information
alan-j-hu committed Sep 16, 2020
1 parent 4e29b43 commit 78959b5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/dune_engine/scheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -705,21 +705,21 @@ end = struct
match Fiber.run fiber ~iter with
| res ->
assert (Event.pending_jobs () = 0);
Console.Status_line.set (Fun.const None);
Ok res
| exception Abort err -> Error err
| exception exn -> Error (Exn (Exn_with_backtrace.capture exn))

let run_and_cleanup t f =
let res = run t f in
( match res with
| Error Files_changed ->
Console.Status_line.set (fun () ->
Some
(Pp.seq
(Pp.tag User_message.Style.Error (Pp.verbatim "Had errors"))
(Pp.verbatim ", killing current build...")))
| _ -> () );
Console.Status_line.set
(Fun.const
( match res with
| Error Files_changed ->
Some
(Pp.seq
(Pp.tag User_message.Style.Error (Pp.verbatim "Had errors"))
(Pp.verbatim ", killing current build..."))
| _ -> None ));
match kill_and_wait_for_all_processes t () with
| Got_signal -> Error Got_signal
| Ok -> res
Expand Down

0 comments on commit 78959b5

Please sign in to comment.