From 0439543db9f3be84d59cfdc1dcad34bd114036e3 Mon Sep 17 00:00:00 2001 From: Emilio Jesus Gallego Arias Date: Mon, 4 Feb 2019 18:16:39 +0100 Subject: [dune] Fix Dune build in Windows. In order for Dune to work in Windows we need to tweak some script calls, they need a POSIX shell and the `(run ...)` / `(system ...)` actions use `cmd.exe` on Windows. Hopefully, we will rely less on `bash` when Dune can understand Coq libraries. This affects shell scripts in `kernel/**.sh` for example. It is interesting to see how faster the Coq Windows build is with Dune + Windows. There are some problems with PATHs that prevent the test suite from working, these will be fixed in a future PR. --- tools/coq_dune.ml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/coq_dune.ml b/tools/coq_dune.ml index 6681b79e38..68371edcb1 100644 --- a/tools/coq_dune.ml +++ b/tools/coq_dune.ml @@ -271,8 +271,13 @@ let exec_ifile f = match Array.length Sys.argv with | 1 -> f stdin | 2 -> - let ic = open_in Sys.argv.(1) in - (try f ic with _ -> close_in ic) + let in_file = Sys.argv.(1) in + begin try + let ic = open_in in_file in + (try f ic + with _ -> eprintf "Error: exec_ifile@\n%!"; close_in ic) + with _ -> eprintf "Error: cannot open input file %s@\n%!" in_file + end | _ -> eprintf "Error: wrong number of arguments@\n%!"; exit 1 let _ = -- cgit v1.2.3