From cf657b0e53919791efe9af727d1fd0b24bf7c8dc Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Wed, 2 Nov 2016 16:51:20 -0700 Subject: [PATCH] [config] Pass classpath via CLOpt.args_env_var Reviewed By: jvillard Differential Revision: D4114501 fbshipit-source-id: 293341a --- infer/lib/python/inferlib/analyze.py | 6 ------ infer/lib/python/inferlib/jwlib.py | 10 ++++++++++ infer/src/base/Config.ml | 1 - 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/infer/lib/python/inferlib/analyze.py b/infer/lib/python/inferlib/analyze.py index 3b30c700e..a2d349704 100644 --- a/infer/lib/python/inferlib/analyze.py +++ b/infer/lib/python/inferlib/analyze.py @@ -207,12 +207,6 @@ class AnalyzerWrapper(object): exit_status = os.EX_OK - if self.javac is not None and self.args.buck: - if self.javac.args.classpath is not None: - for path in self.javac.args.classpath.split(os.pathsep): - if os.path.isfile(path): - infer_options += ['-ziplib', os.path.abspath(path)] - infer_options = map(utils.decode_or_not, infer_options) infer_options_str = ' '.join(infer_options) os.environ['INFER_OPTIONS'] = utils.encode(infer_options_str) diff --git a/infer/lib/python/inferlib/jwlib.py b/infer/lib/python/inferlib/jwlib.py index c6bb66422..e3631598d 100644 --- a/infer/lib/python/inferlib/jwlib.py +++ b/infer/lib/python/inferlib/jwlib.py @@ -273,6 +273,16 @@ class AnalyzerWithFrontendWrapper(analyze.AnalyzerWrapper): if self.args.analyzer == config.ANALYZER_CAPTURE: return os.EX_OK + if self.args.buck: + if self.javac.args.classpath is not None: + infer_args = utils.read_env()['INFER_ARGS'] + # 'INFER_ARGS' must be CommandLineOption.args_env_var + for path in self.javac.args.classpath.split(os.pathsep): + if os.path.isfile(path): + infer_args += '^--specs-library^' + os.path.abspath(path) + # '^' must be CommandLineOption.env_var_sep + os.environ['INFER_ARGS'] = utils.encode(infer_args) + self.analyze_and_report() self._close() self.timing['total'] = utils.elapsed_time(start_time) diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index f7266585d..d4fe81fd2 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -1132,7 +1132,6 @@ and spec_abs_level = and specs_library = let specs_library = CLOpt.mk_string_list ~long:"specs-library" ~short:"lib" ~f:resolve - ~deprecated:["-zip-specs-library"; "ziplib"] ~meta:"dir|jar" "Search for .spec files in given directory or jar file" in let _ = (* Given a filename with a list of paths, convert it into a list of string iff they are