move integration tmpfiles to infer-out/tmp/

Reviewed By: jvillard

Differential Revision: D19537047

fbshipit-source-id: 188200738
master
Martin Trojer 5 years ago committed by Facebook GitHub Bot
parent e35b26ae8e
commit 4cee0882be

@ -3028,6 +3028,8 @@ and custom_symbols =
and symops_per_iteration = !symops_per_iteration
and temp_file_dir = !results_dir ^/ "tmp"
and keep_going = !keep_going
and test_determinator = !test_determinator

@ -665,6 +665,8 @@ val xcode_developer_dir : string option
val xcpretty : bool
(** {2 Global variables with initial values specified by command-line options} *)
val temp_file_dir : string
val clang_compilation_dbs : [`Escaped of string | `Raw of string] list ref
(** {2 Command Line Interface Documentation} *)

@ -82,6 +82,7 @@ let create_results_dir () =
L.die UserError "ERROR: %s@\nPlease remove '%s' and try again" error Config.results_dir
) ;
Unix.mkdir_p Config.results_dir ;
Unix.mkdir_p Config.temp_file_dir ;
List.iter ~f:Unix.mkdir_p results_dir_dir_markers ;
prepare_logging_and_db () ;
()

@ -215,7 +215,7 @@ type file_lock =
; unlock: unit -> unit }
let create_file_lock () =
let file, oc = Core.Filename.open_temp_file "infer" "" in
let file, oc = Core.Filename.open_temp_file "infer_lock" "" in
let fd = Core.Unix.openfile ~mode:[IStd.Unix.O_WRONLY] file in
let lock () = Core.Unix.lockf fd ~mode:IStd.Unix.F_LOCK ~len:IStd.Int64.zero in
let unlock () = Core.Unix.lockf fd ~mode:IStd.Unix.F_ULOCK ~len:IStd.Int64.zero in

@ -324,7 +324,7 @@ let rec exceed_length ~max = function
let store_args_in_file args =
if exceed_length ~max:max_command_line_length args then (
let file = Filename.temp_file "buck_targets" ".txt" in
let file = Filename.temp_file ~in_dir:Config.temp_file_dir "buck_targets" ".txt" in
let write_args outc = Out_channel.output_string outc (String.concat ~sep:"\n" args) in
let () = Utils.with_file_out file ~f:write_args in
L.(debug Capture Quiet) "Buck targets options stored in file '%s'@\n" file ;

@ -23,7 +23,7 @@ let write_infer_deps infile =
let run_buck_capture cmd =
let buck_output_file = Filename.temp_file "buck_output" ".log" in
let buck_output_file = Filename.temp_file ~in_dir:Config.temp_file_dir "buck_output" ".log" in
let shell_cmd =
List.map ~f:Escape.escape_shell cmd
|> String.concat ~sep:" "
@ -45,7 +45,7 @@ let run_buck_capture cmd =
In_channel.close buck_stderr ;
match Unix.waitpid pid with
| Ok () ->
write_infer_deps buck_output_file ; Unix.unlink buck_output_file
write_infer_deps buck_output_file
| Error _ as err ->
L.(die ExternalError)
"*** Buck genrule capture failed to execute: %s@\n***@."

@ -124,7 +124,7 @@ let get_compilation_database_files_buck db_deps ~prog ~args =
(** Compute the compilation database files. *)
let get_compilation_database_files_xcodebuild ~prog ~args =
let tmp_file = Filename.temp_file "cdb" ".json" in
let tmp_file = Filename.temp_file ~in_dir:Config.temp_file_dir "cdb" ".json" in
let xcodebuild_prog, xcodebuild_args = (prog, prog :: args) in
let xcpretty_prog = "xcpretty" in
let xcpretty_args =

@ -28,7 +28,7 @@ let quote style =
let mk_arg_file prefix style args =
let file = Filename.temp_file prefix ".txt" in
let file = Filename.temp_file prefix ~in_dir:Config.temp_file_dir ".txt" in
let write_args outc =
List.iter
~f:(fun arg ->
@ -38,5 +38,4 @@ let mk_arg_file prefix style args =
in
Utils.with_file_out file ~f:write_args ;
L.(debug Capture Medium) "Clang options stored in file %s@\n" file ;
if not Config.debug_mode then Utils.unlink_file_on_exit file ;
file

@ -30,7 +30,7 @@ let compile compiler build_prog build_args =
in
(* Pass non-special args via a file to avoid exceeding the command line size limit. *)
let args_file =
let file = Filename.temp_file "args_" "" in
let file = Filename.temp_file ~in_dir:Config.temp_file_dir "args_" "" in
let quoted_file_args =
List.map file_args ~f:(fun arg ->
if String.contains arg '\'' then arg else F.sprintf "'%s'" arg )
@ -41,7 +41,7 @@ let compile compiler build_prog build_args =
let cli_file_args = cli_args @ ["@" ^ args_file] in
let args = prog_args @ cli_file_args in
L.(debug Capture Quiet) "Current working directory: '%s'@." (Sys.getcwd ()) ;
let verbose_out_file = Filename.temp_file "javac" ".out" in
let verbose_out_file = Filename.temp_file ~in_dir:Config.temp_file_dir "javac" ".out" in
let try_run cmd error_k =
let shell_cmd = List.map ~f:Escape.escape_shell cmd |> String.concat ~sep:" " in
let shell_cmd_redirected = Printf.sprintf "%s 2>'%s'" shell_cmd verbose_out_file in

Loading…
Cancel
Save