[config] make subprocesses read the same .inferconfig as toplevel infer invocation

Summary:
Reading a different .inferconfig makes little sense and is in contradiction
with the fact that we try hard to make all the infer processes agree on the set
of options.

Reviewed By: sblackshear

Differential Revision: D6761146

fbshipit-source-id: 67a0c54
master
Jules Villard 7 years ago committed by Facebook Github Bot
parent 2ede6c1ac4
commit c0d578323e

@ -2000,12 +2000,8 @@ let inferconfig_file =
if is_root then None else find parent
in
match Sys.getenv CommandDoc.inferconfig_env_var with
| Some env_path ->
(* make sure the path makes sense in children infer processes *)
Some
( if Filename.is_relative env_path then
Utils.filename_to_absolute ~root:CLOpt.init_work_dir env_path
else env_path )
| Some _ as env_path ->
env_path
| None ->
find (Sys.getcwd ()) |> Option.map ~f:(fun dir -> dir ^/ CommandDoc.inferconfig_file)
@ -2013,8 +2009,18 @@ let inferconfig_file =
let register_late_epilogue = Epilogues.register_late
let post_parsing_initialization command_opt =
if CommandLineOption.is_originator then
if CommandLineOption.is_originator then (
(* let subprocesses know where the toplevel process' results dir is *)
Unix.putenv ~key:infer_top_results_dir_env_var ~data:!results_dir ;
(* make sure subprocesses read from the same .inferconfig as the toplevel process *)
Option.iter inferconfig_file ~f:(fun filename ->
let abs_filename =
if Filename.is_relative filename then
(* make sure the path makes sense in children infer processes *)
CLOpt.init_work_dir ^/ filename
else filename
in
Unix.putenv ~key:CommandDoc.inferconfig_env_var ~data:abs_filename ) ) ;
( match !version with
| `Full when !buck ->
(* Buck reads stderr in some versions, stdout in others *)

Loading…
Cancel
Save