Permalink
Browse files

[enhance] compilation: better redirect for ocaml compilation error st…

…ream to a compilation log file (compilation.log in build_dir)
  • Loading branch information...
1 parent d6c5ed2 commit 0f262163eb0de0409ab619eefdcbb82aad44a3db @Aqua-Ye Aqua-Ye committed Aug 23, 2011
Showing with 5 additions and 2 deletions.
  1. +5 −2 qml2ocaml/qml2ocaml.ml
View
@@ -740,8 +740,10 @@ prerr_endline \"CHECKUP - LIBS - OK\"
let mrule ~native = Printf.sprintf "\t%s $<" (if native then "$(NATIVE_RULE)" else "$(BYTECODE_RULE)" ) in
(* let all_ml = String.concat " " env_ocaml_output.generated_files in *)
+
+ let compilation_log_file = "compilation.log" in
(* let make_filter = "2> >(grep -v \"ld: warning: directory not found for option*\" 1>&2)" in *)
- let make_filter = "2> /dev/null" in (* FIXME: we ignore all caml compilation error... *)
+ let make_filter = Printf.sprintf "2> %s" compilation_log_file in (* FIXME: we ignore all caml compilation error... *)
let makefile : unit -> string = fun () ->
let ( |> ) = FBuffer.addln in
@@ -906,11 +908,12 @@ prerr_endline \"CHECKUP - LIBS - OK\"
let o = cont () in
if o <> 0
then (
- OManager.printf "error during ocaml compilation -- the command was :@\n%s@\n" c;
+ OManager.printf "error during ocaml compilation -- the command was :@\n%s@\nyou can see compilation logs in %s/%s" c build_dir compilation_log_file;
o
)
else do_compilation q in
let return = do_compilation filter_compilation in
+ (* OManager.printf "Compilation log file at %s/%s\n" build_dir compilation_log_file; *)
Sys.chdir caller_wd ;
return
end

0 comments on commit 0f26216

Please sign in to comment.