Skip to content

Commit

Permalink
[enhance] compilation: better redirect for ocaml compilation error st…
Browse files Browse the repository at this point in the history
…ream to a compilation log file (compilation.log in build_dir)
  • Loading branch information
Frederic Ye committed Aug 23, 2011
1 parent d6c5ed2 commit 0f26216
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions qml2ocaml/qml2ocaml.ml
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -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 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 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> >(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 makefile : unit -> string = fun () ->
let ( |> ) = FBuffer.addln in let ( |> ) = FBuffer.addln in
Expand Down Expand Up @@ -906,11 +908,12 @@ prerr_endline \"CHECKUP - LIBS - OK\"
let o = cont () in let o = cont () in
if o <> 0 if o <> 0
then ( 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 o
) )
else do_compilation q in else do_compilation q in
let return = do_compilation filter_compilation 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 ; Sys.chdir caller_wd ;
return return
end end
Expand Down

0 comments on commit 0f26216

Please sign in to comment.