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

better integration with vscode #1970

Closed
wants to merge 1 commit into from
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
10 changes: 7 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,19 @@ let default =
; `Blocks Common.help_secs
])

let error_exit () =
prerr_endline "DUNE BUILD FAILED";
exit 1
let main () =
Colors.setup_err_formatter_colors ();
try
match Term.eval_choice default all ~catch:false with
| `Error _ -> exit 1
| `Error _ ->
error_exit ()
| _ -> exit 0
with
| Fiber.Never -> exit 1
| Fiber.Never -> error_exit ()
| exn ->
let exn = Exn_with_backtrace.capture exn in
Report_error.report exn;
exit 1
error_exit ()
2 changes: 2 additions & 0 deletions src/scheduler.ml
Original file line number Diff line number Diff line change
Expand Up @@ -739,6 +739,7 @@ let poll ?log ?config ~once ~finally () =
Exit
in
let wait msg =
Format.fprintf Format.err_formatter "@.DUNE Finish building@.";
let old_generator = Console.get_status_line_generator () in
set_status_line_generator
(fun () ->
Expand All @@ -750,6 +751,7 @@ let poll ?log ?config ~once ~finally () =
res
in
let rec loop () =
Format.fprintf Format.err_formatter "@.DUNE Start building@.";
let res = Run_once.run_and_cleanup t once in
finally ();
match res with
Expand Down