Skip to content

Commit 8802573

Browse files
committed
ocsigenserver.conf: Stop if ocamlfind fails
This caused the config to be generated with the wrong dependency list, which caused errors while loading server plugins at runtime.
1 parent e049102 commit 8802573

File tree

1 file changed

+5
-5
lines changed
  • src/files/ocsigenserver.conf

1 file changed

+5
-5
lines changed

src/files/ocsigenserver.conf/gen.ml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,17 +86,17 @@ let deps () =
8686
let packages =
8787
"lwt_ssl,bytes,lwt.unix,logs,logs-syslog.unix,syslog-message,ipaddr,findlib,cryptokit,re,str,xml-light,dynlink,cohttp-lwt-unix"
8888
in
89-
let inp =
90-
Unix.open_process_in ("ocamlfind query -p-format -recursive " ^ packages)
91-
in
9289
let deps = ref [] in
90+
let cmd = "ocamlfind query -p-format -recursive " ^ packages in
91+
let inp = Unix.open_process_in cmd in
9392
(try
9493
while true do
9594
deps := input_line inp :: !deps
9695
done
9796
with End_of_file -> ());
98-
ignore (Unix.close_process_in inp);
99-
!deps @ extra_deps
97+
match Unix.close_process_in inp with
98+
| WEXITED 0 -> !deps @ extra_deps
99+
| _ -> failwith ("Command failed: " ^ cmd)
100100

101101
(* Encode a string as a string literal that can be included in an ocaml file. *)
102102
let str = Printf.sprintf "%S"

0 commit comments

Comments
 (0)