From 284f7116b0347885f943c2ba928f1b01a1ef8897 Mon Sep 17 00:00:00 2001 From: Andrzej Kotulski Date: Wed, 19 Oct 2016 12:28:43 -0700 Subject: [PATCH] Kill usage of INFER_RESULTS_DIR env var Reviewed By: jberdine Differential Revision: D4041199 fbshipit-source-id: 78d3de9 --- infer/lib/python/inferlib/capture/make.py | 5 ++--- infer/lib/python/inferlib/capture/util.py | 12 ------------ infer/lib/python/inferlib/capture/xcodebuild.py | 5 ----- infer/lib/xcode_wrappers/clang | 11 +---------- infer/src/integration/BuckCompilationDatabase.ml | 4 +--- 5 files changed, 4 insertions(+), 33 deletions(-) diff --git a/infer/lib/python/inferlib/capture/make.py b/infer/lib/python/inferlib/capture/make.py index 1207611cf..f8cba3b23 100644 --- a/infer/lib/python/inferlib/capture/make.py +++ b/infer/lib/python/inferlib/capture/make.py @@ -53,15 +53,14 @@ class MakeCapture: def get_envvars(self): env_vars = utils.read_env() wrappers_path = config.WRAPPERS_DIRECTORY + # INFER_RESULTS_DIR and INFER_OLD_PATH are used by javac wrapper only env_vars['INFER_OLD_PATH'] = env_vars['PATH'] env_vars['PATH'] = '{wrappers}{sep}{path}'.format( wrappers=wrappers_path, sep=os.pathsep, path=env_vars['PATH'], ) - - frontend_env_vars = util.get_clang_frontend_envvars(self.args) - env_vars.update(frontend_env_vars) + env_vars['INFER_RESULTS_DIR'] = args.infer_out return env_vars def capture(self): diff --git a/infer/lib/python/inferlib/capture/util.py b/infer/lib/python/inferlib/capture/util.py index 4e6403405..7102046e7 100644 --- a/infer/lib/python/inferlib/capture/util.py +++ b/infer/lib/python/inferlib/capture/util.py @@ -69,15 +69,3 @@ def base_argparser(description, module_name): ) return parser return _func - - -def get_clang_frontend_envvars(args): - """Return the environment variables that configure the clang wrapper, e.g. - to emit debug information if needed, and the invocation of the Infer - frontend for Clang, InferClang, e.g. to analyze headers, emit stats, etc""" - env_vars = {} - frontend_args = [] - - env_vars['INFER_RESULTS_DIR'] = args.infer_out - - return env_vars diff --git a/infer/lib/python/inferlib/capture/xcodebuild.py b/infer/lib/python/inferlib/capture/xcodebuild.py index 9897ef36a..c9f2f4824 100644 --- a/infer/lib/python/inferlib/capture/xcodebuild.py +++ b/infer/lib/python/inferlib/capture/xcodebuild.py @@ -51,12 +51,7 @@ class XcodebuildCapture: def get_envvars(self): env_vars = utils.read_env() - env_vars['FCP_APPLE_CLANG'] = self.apple_clang_path - - frontend_env_vars = \ - util.get_clang_frontend_envvars(self.args) - env_vars.update(frontend_env_vars) return env_vars def capture(self): diff --git a/infer/lib/xcode_wrappers/clang b/infer/lib/xcode_wrappers/clang index 53379bc6c..62f78657e 100755 --- a/infer/lib/xcode_wrappers/clang +++ b/infer/lib/xcode_wrappers/clang @@ -6,15 +6,6 @@ BIN_PATH="${SCRIPT_PATH}/../../bin" if [ "${0%++}" != "$0" ]; then INFER_XX="++"; fi export INFER_XX -FCP_CLANG_COMPILER="${CLANG_WRAPPERS_PATH%/}/filter_args_and_run_fcp_clang$INFER_XX"; - -if [ -z "$INFER_RESULTS_DIR" ]; then - # this redirects to the compiler without adding any FCP flag - # this is because xcode requires message category info from the compiler - # and invokes it without any env var set. - export INFER_ARGS="-a^compile" -else - EXTRA_ARGS=-fno-cxx-modules -fi +EXTRA_ARGS=-fno-cxx-modules "${BIN_PATH}/InferClang" "$@" $EXTRA_ARGS diff --git a/infer/src/integration/BuckCompilationDatabase.ml b/infer/src/integration/BuckCompilationDatabase.ml index 5d055a08a..47e1105ba 100644 --- a/infer/src/integration/BuckCompilationDatabase.ml +++ b/infer/src/integration/BuckCompilationDatabase.ml @@ -154,9 +154,7 @@ let run_compilation_file compilation_database file = let args = Array.of_list (compilation_data.command::compilation_data.args) in let env = Array.append (Unix.environment()) - (Array.of_list [ - "INFER_RESULTS_DIR="^Config.results_dir; - "FCP_RUN_SYNTAX_ONLY=1"]) in + (Array.of_list ["FCP_RUN_SYNTAX_ONLY=1"]) in Process.exec_command compilation_data.command args env with Not_found -> Process.print_error_and_exit "Failed to find compilation data for %s \n%!" file