diff --git a/FILES.md b/FILES.md index bf4f798c7..b2a2b7c24 100644 --- a/FILES.md +++ b/FILES.md @@ -4,14 +4,6 @@ *infer* : Main command to run Infer. Check out the docs for instructions on how to use it. -*inferTraceBugs* : Python script to explore the error traces in Infer reports - -## Helper commands - -The rest of the commands in infer/bin/ are not meant to be called directly, but are used by the top-level commands above. +*infer-* : Infer subcommands. Running `infer- [options]` is the same as running `infer [options]`. -*InferClang* : Binary containing the clang frontend. - -*InferAnalyze* : Binary containing the backend of Infer that performs the analysis. - -*InferPrint* : Binary that prints reports about the analysis such as the specs of methods and a list of bugs found. +*inferTraceBugs* : Python script to explore the error traces in Infer reports diff --git a/Makefile b/Makefile index 9815274e2..f4c1cc7e8 100644 --- a/Makefile +++ b/Makefile @@ -350,6 +350,7 @@ test-replace: $(BUILD_SYSTEMS_TESTS:%=build_%_replace) $(DIRECT_TESTS:%=direct_% uninstall: $(REMOVE_DIR) $(DESTDIR)$(libdir)/infer/ $(REMOVE) $(DESTDIR)$(bindir)/infer + $(REMOVE) $(foreach alias,$(INFER_COMMANDS),$(DESTDIR)$(bindir)/$(alias)) .PHONY: test_clean test_clean: $(DIRECT_TESTS:%=direct_%_clean) $(BUILD_SYSTEMS_TESTS:%=build_%_clean) @@ -380,10 +381,6 @@ endif ifeq ($(BUILD_JAVA_ANALYZERS),yes) test -d $(DESTDIR)$(libdir)/infer/infer/lib/java/ || \ $(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/java/ -endif -ifneq ($(XCODE_SELECT),no) - test -d $(DESTDIR)$(libdir)/infer/infer/lib/xcode_wrappers/ || \ - $(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/lib/xcode_wrappers/ endif test -d $(DESTDIR)$(libdir)/infer/infer/annotations/ || \ $(MKDIR_P) $(DESTDIR)$(libdir)/infer/infer/annotations/ @@ -410,12 +407,12 @@ ifeq ($(BUILD_C_ANALYZERS),yes) $(QUIET)for i in $$(find infer/lib/clang_wrappers/*); do \ $(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \ done -# only for files that point to InferClang +# only for files that point to infer (cd $(DESTDIR)$(libdir)/infer/infer/lib/wrappers/ && \ $(foreach cc,$(shell find $(LIB_DIR)/wrappers -type l), \ - [ $(cc) -ef $(INFERCLANG_BIN) ] && \ + [ $(cc) -ef $(INFER_BIN) ] && \ $(REMOVE) $(notdir $(cc)) && \ - $(LN_S) ../../bin/InferClang $(notdir $(cc));)) + $(LN_S) ../../bin/infer $(notdir $(cc));)) $(QUIET)for i in $$(find infer/lib/specs/*); do \ $(INSTALL_DATA) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \ done @@ -424,14 +421,6 @@ ifeq ($(BUILD_C_ANALYZERS),yes) done $(INSTALL_DATA) -C infer/lib/linter_rules/linters.al \ $(DESTDIR)$(libdir)/infer/infer/lib/linter_rules/linters.al - $(INSTALL_PROGRAM) -C $(INFERCLANG_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/ - (cd $(DESTDIR)$(libdir)/infer/infer/bin/ && \ - $(LN_S) -f InferClang InferClang++) -endif -ifneq ($(XCODE_SELECT),no) - $(QUIET)for i in $$(find infer/lib/xcode_wrappers/*); do \ - $(INSTALL_PROGRAM) -C $$i $(DESTDIR)$(libdir)/infer/$$i; \ - done endif ifeq ($(BUILD_JAVA_ANALYZERS),yes) $(INSTALL_DATA) -C infer/annotations/annotations.jar \ @@ -452,11 +441,17 @@ endif $(INSTALL_PROGRAM) -C infer/lib/python/report.py \ $(DESTDIR)$(libdir)/infer/infer/lib/python/report.py $(INSTALL_PROGRAM) -C $(INFER_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/ - $(INSTALL_PROGRAM) -C $(INFERANALYZE_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/ - $(INSTALL_PROGRAM) -C $(INFERPRINT_BIN) $(DESTDIR)$(libdir)/infer/infer/bin/ (cd $(DESTDIR)$(bindir)/ && \ $(REMOVE) infer && \ $(LN_S) $(libdir_relative_to_bindir)/infer/infer/bin/infer infer) + for alias in $(INFER_COMMANDS); do \ + (cd $(DESTDIR)$(bindir)/ && \ + $(REMOVE) $$alias && \ + $(LN_S) infer $$alias); done + for alias in $(INFER_COMMANDS); do \ + (cd $(DESTDIR)$(libdir)/infer/infer/bin && \ + $(REMOVE) $$alias && \ + $(LN_S) infer $$alias); done (cd $(DESTDIR)$(bindir)/ && \ $(REMOVE) inferTraceBugs && \ $(LN_S) $(libdir_relative_to_bindir)/infer/infer/lib/python/inferTraceBugs inferTraceBugs) diff --git a/Makefile.config b/Makefile.config index 55857576c..2d30a0079 100644 --- a/Makefile.config +++ b/Makefile.config @@ -50,12 +50,16 @@ PYTHON_DIR = $(LIB_DIR)/python PYTHON_LIB_DIR = $(PYTHON_DIR)/inferlib CAPTURE_LIB_DIR = $(PYTHON_LIB_DIR)/capture -INFERANALYZE_BIN = $(BIN_DIR)/InferAnalyze -INFERCLANG_BIN = $(BIN_DIR)/InferClang -INFERCLANGXX_BIN = $(BIN_DIR)/InferClang++ -INFERPRINT_BIN = $(BIN_DIR)/InferPrint INFERUNIT_BIN = $(BIN_DIR)/InferUnit INFER_BIN = $(BIN_DIR)/infer +INFER_COMMANDS = \ + infer-analyze \ + infer-capture \ + infer-compile \ + infer-report \ + infer-reportdiff \ + infer-run \ + INFERTRACEBUGS_BIN = $(BIN_DIR)/inferTraceBugs INFERTRACEBUGS_BIN_RELPATH = infer/bin/inferTraceBugs @@ -76,7 +80,7 @@ JAVA_DEPS_NO_MODELS = \ analyze.py bucklib.py config.py issues.py jwlib.py source.py utils.py) \ $(addprefix $(CAPTURE_LIB_DIR)/, util.py) \ $(ANDROID_JAR) $(GUAVA_JAR) $(JACKSON_JAR) $(JSR_305_JAR) $(INFER_ANNOTATIONS_JAR) \ - $(INFER_BIN) $(INFERANALYZE_BIN) $(INFERPRINT_BIN) + $(INFER_BIN) JAVA_DEPS = $(JAVA_DEPS_NO_MODELS) $(JAVA_MODELS_JAR) @@ -89,7 +93,7 @@ CLANG_DEPS_NO_MODELS = \ $(addprefix $(PYTHON_LIB_DIR)/, \ analyze.py config.py issues.py source.py utils.py) \ $(addprefix $(CAPTURE_LIB_DIR)/, util.py) \ - $(INFER_BIN) $(INFERANALYZE_BIN) $(INFERCLANG_BIN) $(INFERPRINT_BIN) + $(INFER_BIN) CLANG_DEPS = $(CLANG_DEPS_NO_MODELS) $(C_MODELS_FILE) $(CPP_MODELS_FILE) \ $(shell find $(MODELS_DIR)/cpp/include -type f) diff --git a/infer/lib/python/inferlib/capture/xcodebuild.py b/infer/lib/python/inferlib/capture/xcodebuild.py index f2e666b71..3fd8e8c3e 100644 --- a/infer/lib/python/inferlib/capture/xcodebuild.py +++ b/infer/lib/python/inferlib/capture/xcodebuild.py @@ -23,9 +23,8 @@ infer -- xcodebuild -target HelloWorldApp -sdk iphonesimulator infer -- xcodebuild -workspace HelloWorld.xcworkspace -scheme HelloWorld''' LANG = ['clang'] -CLANG_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY, 'clang') -CLANGPLUSPLUS_WRAPPER = os.path.join(config.XCODE_WRAPPERS_DIRECTORY, - 'clang++') +CLANG_WRAPPER = os.path.join(config.WRAPPERS_DIRECTORY, 'clang') +CLANGPLUSPLUS_WRAPPER = os.path.join(config.WRAPPERS_DIRECTORY, 'clang++') def gen_instance(*args): diff --git a/infer/lib/python/inferlib/config.py b/infer/lib/python/inferlib/config.py index b7cba6e89..e6de63c56 100644 --- a/infer/lib/python/inferlib/config.py +++ b/infer/lib/python/inferlib/config.py @@ -35,7 +35,6 @@ BIN_DIRECTORY = os.path.join(INFER_INFER_DIRECTORY, 'bin') JAVA_LIB_DIRECTORY = os.path.join(LIB_DIRECTORY, 'java') MODELS_JAR = os.path.join(JAVA_LIB_DIRECTORY, 'models.jar') WRAPPERS_DIRECTORY = os.path.join(LIB_DIRECTORY, 'wrappers') -XCODE_WRAPPERS_DIRECTORY = os.path.join(LIB_DIRECTORY, 'xcode_wrappers') DEFAULT_INFER_OUT = os.path.join(os.getcwd().decode(CODESET), 'infer-out') diff --git a/infer/lib/wrappers/c++ b/infer/lib/wrappers/c++ index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/c++ +++ b/infer/lib/wrappers/c++ @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/wrappers/cc b/infer/lib/wrappers/cc index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/cc +++ b/infer/lib/wrappers/cc @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/wrappers/clang b/infer/lib/wrappers/clang index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/clang +++ b/infer/lib/wrappers/clang @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/wrappers/clang++ b/infer/lib/wrappers/clang++ index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/clang++ +++ b/infer/lib/wrappers/clang++ @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/wrappers/g++ b/infer/lib/wrappers/g++ index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/g++ +++ b/infer/lib/wrappers/g++ @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/wrappers/gcc b/infer/lib/wrappers/gcc index a78cb23c5..898101b36 120000 --- a/infer/lib/wrappers/gcc +++ b/infer/lib/wrappers/gcc @@ -1 +1 @@ -../../bin/InferClang \ No newline at end of file +../../bin/infer \ No newline at end of file diff --git a/infer/lib/xcode_wrappers/clang b/infer/lib/xcode_wrappers/clang deleted file mode 100755 index af2ece004..000000000 --- a/infer/lib/xcode_wrappers/clang +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -BIN_PATH="${SCRIPT_PATH}/../../bin" - -if [ "${0%++}" != "$0" ]; then XX="++"; else XX=""; fi - -"${BIN_PATH}/InferClang${XX}" "$@" diff --git a/infer/lib/xcode_wrappers/clang++ b/infer/lib/xcode_wrappers/clang++ deleted file mode 120000 index 060d289be..000000000 --- a/infer/lib/xcode_wrappers/clang++ +++ /dev/null @@ -1 +0,0 @@ -clang \ No newline at end of file diff --git a/infer/src/Makefile b/infer/src/Makefile index 9056c2ce6..b3b622624 100644 --- a/infer/src/Makefile +++ b/infer/src/Makefile @@ -62,7 +62,6 @@ endif #### Backend declarations #### INFER_MAIN = backend/infer -INFERANALYZE_MAIN = backend/InferAnalyzeExe #### Checkers declarations #### @@ -76,8 +75,6 @@ INFERPRINT_ATDGEN_STUB_BASE = backend/jsonbug INFERPRINT_ATDGEN_STUB_ATD = $(INFERPRINT_ATDGEN_STUB_BASE).atd INFERPRINT_ATDGEN_STUBS = $(addprefix $(INFERPRINT_ATDGEN_STUB_BASE), $(ATDGEN_SUFFIXES)) -INFERPRINT_MAIN = backend/InferPrintExe - ### InferUnit declarations ### UNIT_SOURCES = unit @@ -93,7 +90,6 @@ JAVA_SOURCES = java #### Clang declarations #### CLANG_SOURCES = clang -INFERCLANG_MAIN = $(CLANG_SOURCES)/InferClang FCP_CLANG_OCAML_BUILD_DIR = $(FCP_CLANG_OCAML_DIR)/build @@ -141,18 +137,10 @@ OCAMLBUILD_BASE = \ # ocamlbuild with options necessary to build all targets at once, regardless of configure flags OCAMLBUILD_ALL = $(OCAMLBUILD_BASE) $(JAVA_OCAMLBUILD_OPTIONS) -# list of ocamlbuild targets common to all build targets -- native version -INFER_BASE_TARGETS = \ - $(INFER_MAIN).native \ - $(INFERANALYZE_MAIN).native \ - $(INFERPRINT_MAIN).native - -INFER_ALL_TARGETS = $(INFER_BASE_TARGETS) \ - $(INFERCLANG_MAIN).native \ - # configure-aware ocamlbuild commands and targets OCAMLBUILD_CONFIG = $(OCAMLBUILD_BASE) -INFER_CONFIG_TARGETS = $(INFER_BASE_TARGETS) +# list of ocamlbuild targets common to all build targets -- native version +INFER_CONFIG_TARGETS = $(INFER_MAIN).native ifeq ($(BUILD_JAVA_ANALYZERS),yes) OCAMLBUILD_CONFIG += $(JAVA_OCAMLBUILD_OPTIONS) @@ -161,7 +149,6 @@ else DEPENDENCIES += java_stubs endif ifeq ($(BUILD_C_ANALYZERS),yes) -INFER_CONFIG_TARGETS += $(INFERCLANG_MAIN).native DEPENDENCIES += clang unit/clang else DEPENDENCIES += clang_stubs unit/clang_stubs @@ -193,20 +180,18 @@ $(INFER_BUILD_DIR)/$(INFER_MAIN).native: base/Version.ml $(OCAML_CONFIG_SOURCES) $(MKDIR_P) $(BASE_BUILD_DIR) $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) \ $(INFER_CONFIG_TARGETS) -# let make know that the target is up-to-date even if ocamlbuild cached it +# let make know that the target is up-to-date even if ocamlbuild cached it $(QUIET)touch $@ -$(BIN_DIR): Makefile - $(MKDIR_P) $@ +INFER_BIN_ALIASES = $(foreach alias,$(INFER_COMMANDS),$(BIN_DIR)/$(alias)) + +$(INFER_BIN_ALIASES): Makefile +# make sure the bin directory exists + $(QUIET)$(MKDIR_P) $(@D) + $(QUIET)cd $(@D) && $(LN_S) -f infer $(@F) $(QUIET)touch $@ -$(INFER_BIN).native: $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(BIN_DIR) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).native $(INFERANALYZE_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).native $(INFERPRINT_BIN) -ifeq ($(BUILD_C_ANALYZERS),yes) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANG_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).native $(INFERCLANGXX_BIN) -endif +$(INFER_BIN).native: $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN_ALIASES) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).native $(INFER_BIN).native @@ -217,22 +202,19 @@ ifeq ($(BUILD_C_ANALYZERS),yes) infer: $(CLANG_BINIOU_DICT) endif -$(INFER_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(OCAML_CONFIG_SOURCES) +$(INFER_BUILD_DIR)/$(INFER_MAIN).byte: base/Version.ml $(OCAML_CONFIG_SOURCES) \ + $(MAKEFILE_LIST) $(MKDIR_P) $(BASE_BUILD_DIR) $(OCAMLBUILD_CONFIG) -build-dir $(INFER_BUILD_DIR) \ - $(INFER_CONFIG_TARGETS:.native=.byte) $(INFERUNIT_MAIN).byte + $(INFER_CONFIG_TARGETS:.native=.byte) $(QUIET)touch $@ -$(INFER_BIN).byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(BIN_DIR) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERANALYZE_MAIN).byte $(INFERANALYZE_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERPRINT_MAIN).byte $(INFERPRINT_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).byte $(INFERUNIT_BIN) -ifeq ($(BUILD_C_ANALYZERS),yes) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).byte $(INFERCLANG_BIN) - $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERCLANG_MAIN).byte $(INFERCLANGXX_BIN) -endif +$(INFER_BIN).byte: $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(INFER_BIN_ALIASES) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(INFER_BIN) $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFER_MAIN).byte $(INFER_BIN).byte +ifeq ($(TEST),1) + $(INSTALL_PROGRAM) $(INFER_BUILD_DIR)/$(INFERUNIT_MAIN).byte $(INFERUNIT_BIN) +endif .PHONY: byte byte: $(INFER_BIN).byte @@ -269,7 +251,7 @@ rei: %.rei : %.mli $(SCRIPT_DIR)/refmt.sh -parse ml -print re $< > $*.rei -roots:=Infer InferAnalyzeExe InferClang InferPrintExe StatsAggregator +roots:=Infer StatsAggregator clusters:=base clang java IR ml_src_files:=$(shell find $(DEPENDENCIES) -regex '.*\.ml\(i\)*') @@ -401,7 +383,7 @@ base/Version.ml: base/Version.ml.in $(MAKEFILE_LIST) .PHONY: clean clean: - $(REMOVE) $(INFER_ALL_TARGETS) + $(REMOVE) $(INFER_TARGET) $(REMOVE) toplevel.mlpack $(REMOVE_DIR) $(BUILD_DIR) $(REMOVE) $(ETC_DIR)/clang_ast.dict @@ -409,8 +391,7 @@ clean: $(REMOVE) base/Version.ml.tmp.* $(REMOVE) backend/jsonbug_{j,t}.ml{,i} $(REMOVE) checkers/stacktree_{j,t}.ml{,i} - $(REMOVE) $(INFER_BIN){,.byte,.native} $(INFERCLANG_BIN) $(INFERCLANGXX_BIN) - $(REMOVE) $(INFERANALYZE_BIN) $(INFERPRINT_BIN) + $(REMOVE) $(INFER_BIN){,.byte,.native} $(INFER_BIN_ALIASES) $(REMOVE) $(INFERUNIT_BIN) $(CHECKCOPYRIGHT_BIN) $(REMOVE) $(CLANG_ATDGEN_STUBS) $(REMOVE) $(INFER_CLANG_FCP_MIRRORED_FILES) diff --git a/infer/src/backend/InferAnalyze.re b/infer/src/backend/InferAnalyze.re index 363e320e6..b200bd457 100644 --- a/infer/src/backend/InferAnalyze.re +++ b/infer/src/backend/InferAnalyze.re @@ -182,3 +182,17 @@ let main makefile => { output_json_makefile_stats clusters_to_analyze } }; + +let register_perf_stats_report () => { + let stats_dir = Filename.concat Config.results_dir Config.backend_stats_dir_name; + let cluster = + switch Config.cluster_cmdline { + | Some cl => "_" ^ cl + | None => "" + }; + let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json"; + let stats_file = Filename.concat stats_dir stats_base; + Utils.create_dir Config.results_dir; + Utils.create_dir stats_dir; + PerfStats.register_report_at_exit stats_file +}; diff --git a/infer/src/backend/InferAnalyze.rei b/infer/src/backend/InferAnalyze.rei index 5c39cb715..b931e1823 100644 --- a/infer/src/backend/InferAnalyze.rei +++ b/infer/src/backend/InferAnalyze.rei @@ -14,3 +14,5 @@ open! IStd; /** Given a name of the Makefile to use for multicore analysis, analyze the captured code */ let main: string => unit; + +let register_perf_stats_report: unit => unit; diff --git a/infer/src/backend/InferAnalyzeExe.re b/infer/src/backend/InferAnalyzeExe.re deleted file mode 100644 index 7370f0aa7..000000000 --- a/infer/src/backend/InferAnalyzeExe.re +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -open! IStd; - - -/** Main module for the analysis after the capture phase */ -module L = Logging; - -let register_perf_stats_report () => { - let stats_dir = Filename.concat Config.results_dir Config.backend_stats_dir_name; - let cluster = - switch Config.cluster_cmdline { - | Some cl => "_" ^ cl - | None => "" - }; - let stats_base = Config.perf_stats_prefix ^ Filename.basename cluster ^ ".json"; - let stats_file = Filename.concat stats_dir stats_base; - Utils.create_dir Config.results_dir; - Utils.create_dir stats_dir; - PerfStats.register_report_at_exit stats_file -}; - -let () = { - Logging.set_log_file_identifier - CommandLineOption.Analyze (Option.map f::Filename.basename Config.cluster_cmdline); - if Config.print_builtins { - Builtin.print_and_exit () - }; - if (Sys.file_exists Config.results_dir != `Yes) { - L.err "ERROR: results directory %s does not exist@.@." Config.results_dir; - Config.print_usage_exit () - }; - register_perf_stats_report (); - InferAnalyze.main Config.makefile_cmdline -}; diff --git a/infer/src/backend/InferAnalyzeExe.rei b/infer/src/backend/InferAnalyzeExe.rei deleted file mode 100644 index f13534de7..000000000 --- a/infer/src/backend/InferAnalyzeExe.rei +++ /dev/null @@ -1,10 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -open! IStd; -/** Main module for the analysis after the capture phase */ diff --git a/infer/src/backend/InferPrintExe.re b/infer/src/backend/InferPrintExe.re deleted file mode 100644 index b155ffe44..000000000 --- a/infer/src/backend/InferPrintExe.re +++ /dev/null @@ -1,11 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -open! IStd; - -let () = InferPrint.main_from_config (); diff --git a/infer/src/backend/InferPrintExe.rei b/infer/src/backend/InferPrintExe.rei deleted file mode 100644 index f0a153810..000000000 --- a/infer/src/backend/InferPrintExe.rei +++ /dev/null @@ -1,9 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -open! IStd; diff --git a/infer/src/backend/README.md b/infer/src/backend/README.md index 28fdd0104..4f8fb0ce8 100644 --- a/infer/src/backend/README.md +++ b/infer/src/backend/README.md @@ -2,7 +2,6 @@ The back end is responsible for the analysis of a project starting from an intermediate representation stored in the results directory, typically `infer-out`. -The main entry point is module [InferAnalyze](InferAnalyze.re) which produces the back-end executable `InferAnalyze`. - -Module [InferPrint](InferPrint.re) produces the executable `InferPrint`, which is used to export analysis results. +The main entry point is module [InferAnalyze](InferAnalyze.re). +Module [InferPrint](InferPrint.re) is used to export the analysis results. diff --git a/infer/src/backend/clusterMakefile.ml b/infer/src/backend/clusterMakefile.ml index d55c43bbf..4aaf72960 100644 --- a/infer/src/backend/clusterMakefile.ml +++ b/infer/src/backend/clusterMakefile.ml @@ -25,7 +25,7 @@ let pp_prolog fmt clusters = List.map ~f:infer_flag_of_compilation_db !Config.clang_compilation_dbs |> String.concat ~sep:" " |> escape in F.fprintf fmt "INFERANALYZE = '%s' --results-dir '%s' %s@\n@\n" - (Config.(bin_dir ^/ infer_analyze_exe_name)) + (Config.bin_dir ^/ CommandDoc.exe_name_of_command CLOpt.Analyze) (escape Config.results_dir) compilation_dbs_cmd; F.fprintf fmt "CLUSTERS="; diff --git a/infer/src/backend/infer.ml b/infer/src/backend/infer.ml index 5833f81b5..d6069aee5 100644 --- a/infer/src/backend/infer.ml +++ b/infer/src/backend/infer.ml @@ -546,6 +546,21 @@ let differential_mode () = let () = match Config.command with + | Analyze -> + Logging.set_log_file_identifier + CommandLineOption.Analyze (Option.map ~f:Filename.basename Config.cluster_cmdline); + if Config.print_builtins then Builtin.print_and_exit (); + if Sys.file_exists Config.results_dir <> `Yes then ( + L.err "ERROR: results directory %s does not exist@.@." Config.results_dir; + Config.print_usage_exit () + ); + InferAnalyze.register_perf_stats_report (); + InferAnalyze.main Config.makefile_cmdline + | Clang -> + let prog, args = match Array.to_list Sys.argv with + | prog::args -> prog, args + | [] -> assert false (* Sys.argv is never empty *) in + ClangWrapper.exe ~prog ~args | Report -> InferPrint.main_from_config () | ReportDiff -> differential_mode () - | _ -> infer_mode () + | Capture | Compile | Run -> infer_mode () diff --git a/infer/src/base/CommandDoc.ml b/infer/src/base/CommandDoc.ml index fa6ecf71a..7a6ef6841 100644 --- a/infer/src/base/CommandDoc.ml +++ b/infer/src/base/CommandDoc.ml @@ -14,22 +14,29 @@ type data = { long: string; command_doc: CLOpt.command_doc } let inferconfig_env_var = "INFERCONFIG" +let infer_exe_name = "infer" + (** Name of the infer configuration file *) let inferconfig_file = ".inferconfig" let command_to_long = CLOpt.[ - Analyze, "analyze"; Capture, "capture"; Clang, "clang"; Compile, "compile"; Report, "report"; + Analyze, "analyze"; Capture, "capture"; Compile, "compile"; Report, "report"; ReportDiff, "reportdiff"; Run, "run"; ] let long_of_command = List.Assoc.find_exn ~equal:CLOpt.equal_command command_to_long +let exe_name_of_long long = + Printf.sprintf "%s-%s" infer_exe_name long + let exe_name_of_command cmd = - let long = long_of_command cmd in - (* InferClang is special because it's not really a user-facing executable *) - if CLOpt.equal_command cmd CLOpt.Clang then "InferClang" - else "infer-" ^ long + long_of_command cmd |> exe_name_of_long + +let command_of_exe_name exe_name = + List.find_map command_to_long ~f:(fun (cmd, long) -> + if String.equal exe_name (exe_name_of_long long) then Some cmd + else None) let mk_command_doc ~see_also:see_also_commands ?and_also ?environment:environment_opt ?files:files_opt ~synopsis = @@ -88,17 +95,6 @@ let capture = ] ~see_also:CLOpt.[Analyze;Compile;Run] -let clang = - mk_command_doc ~title:"Infer Clang Capture" - ~short_description:"internal tool to capture clang commands" - ~synopsis:"$(b,InferClang) $(i,[clang options])" - ~description:[`P "This is used internally by other infer commands. You shouldn't need to call \ - this directly."] - ~options:(`Replace - [`P "Accepts the same command line options as $(b,clang)(1) (but still reads infer \ - options from the environment)."]) - ~see_also:CLOpt.[Capture] - let compile = mk_command_doc ~title:"Infer Project Compilation" ~short_description:"compile project from within the infer environment" @@ -271,7 +267,7 @@ let command_to_data = let long = long_of_command cmd in let command_doc = mk_doc (exe_name_of_command cmd) in cmd, { long; command_doc } in - CLOpt.[mk Analyze analyze; mk Capture capture; mk Clang clang; mk Compile compile; + CLOpt.[mk Analyze analyze; mk Capture capture; mk Compile compile; mk Report report; mk ReportDiff reportdiff; mk Run run] let data_of_command command = diff --git a/infer/src/base/CommandDoc.mli b/infer/src/base/CommandDoc.mli index 0f9e8c0f5..e4dbccac2 100644 --- a/infer/src/base/CommandDoc.mli +++ b/infer/src/base/CommandDoc.mli @@ -12,8 +12,13 @@ module CLOpt = CommandLineOption type data = { long: string; command_doc: CLOpt.command_doc } +val infer_exe_name : string val inferconfig_env_var : string val inferconfig_file : string +val long_of_command : CLOpt.command -> string +val exe_name_of_command : CLOpt.command -> string +val command_of_exe_name : string -> CLOpt.command option + val infer : CLOpt.command_doc val data_of_command : CLOpt.command -> data diff --git a/infer/src/base/CommandLineOption.ml b/infer/src/base/CommandLineOption.ml index 70d2c0b2e..2707ef6e7 100644 --- a/infer/src/base/CommandLineOption.ml +++ b/infer/src/base/CommandLineOption.ml @@ -834,8 +834,11 @@ let show_manual ?internal_section format default_doc command_opt = | None -> default_doc | Some command -> - let (command_doc, _, _) = List.Assoc.find_exn !subcommands command in - command_doc in + match List.Assoc.find_exn !subcommands command with + | (Some command_doc, _, _) -> + command_doc + | (None, _, _) -> + invalid_argf "No manual for internal command %s" (string_of_command command) in let pp_meta f meta = match meta with | "" -> () | meta -> F.fprintf f " $(i,%s)" (Cmdliner.Manpage.escape meta) in diff --git a/infer/src/base/CommandLineOption.mli b/infer/src/base/CommandLineOption.mli index 545619d00..4a8c750fc 100644 --- a/infer/src/base/CommandLineOption.mli +++ b/infer/src/base/CommandLineOption.mli @@ -189,11 +189,12 @@ val mk_command_doc : title:string -> section:int -> version:string -> date:strin (** [mk_subcommand command ~long command_doc] defines the subcommand [command]. A subcommand is activated by passing [--long], [name], or any [-key] for [key] in [deprecated] on the command line. [name] defaults to [long]. A man page is automatically generated for [command] based on - the information in [command_doc]. [on_unknown_arg] is the action taken on unknown anonymous - arguments; it is `Reject by default. *) + the information in [command_doc], if available (otherwise the command is considered internal). + [on_unknown_arg] is the action taken on unknown anonymous arguments; it is `Reject by default. +*) val mk_subcommand : command -> ?on_unknown_arg:[`Add | `Skip | `Reject] -> ?deprecated:string list -> long:string -> ?name:string -> - ?parse_mode:parse_mode -> ?in_help:(command * string) list -> command_doc -> unit + ?parse_mode:parse_mode -> ?in_help:(command * string) list -> command_doc option -> unit (** environment variable use to pass arguments from parent to child processes *) val args_env_var : string diff --git a/infer/src/base/Config.ml b/infer/src/base/Config.ml index dc68e9a66..860a15797 100644 --- a/infer/src/base/Config.ml +++ b/infer/src/base/Config.ml @@ -17,26 +17,6 @@ open! PVariant module CLOpt = CommandLineOption module F = Format -type exe = Analyze | Clang | Driver | Print [@@deriving compare] - -let equal_exe = [%compare.equal : exe] - -(* TODO(16551801) better place to declare analyzers *) -let infer_exe_name = "infer" -let infer_analyze_exe_name = "InferAnalyze" - -(** Association list of executable (base)names to their [exe]s. *) -let exes = [ - (infer_analyze_exe_name, Analyze); - ("InferClang", Clang); - (infer_exe_name, Driver); - ("InferPrint", Print); -] - -let exe_name = - let exe_to_name = List.map ~f:(fun (n,a) -> (a,n)) exes in - fun exe -> List.Assoc.find_exn ~equal:equal_exe exe_to_name exe - type analyzer = | BiAbduction | CaptureOnly | CompileOnly | Eradicate | Checkers | Tracing | Crashcontext | Linters @@ -288,23 +268,23 @@ let version_string = Unix.time *) let initial_analysis_time = Unix.time () -(* Resolve symlinks to get to the real executable. The real executable is located in [bin_dir] - below, which allows us to find [lib_dir], [models_dir], etc., relative to it. *) -let real_exe_name = - Utils.realpath Sys.executable_name - -let current_exe = - List.Assoc.find ~equal:String.equal exes (Filename.basename real_exe_name) |> - Option.value ~default:Driver +let clang_exe_aliases = [ + (* this must be kept in sync with the clang-like symlinks in [wrappers_dir] (see below) *) + "c++"; "cc"; "clang"; "clang++"; "g++"; "gcc"; +] -let initial_command = match current_exe with - | Analyze -> Some CLOpt.Analyze - | Clang -> Some CLOpt.Clang - | Driver -> None - | Print -> Some CLOpt.Report +let initial_command = + (* Sys.executable_name tries to do clever things which we must avoid, use argv[0] instead *) + let exe_basename = Filename.basename Sys.argv.(0) in + let is_clang = List.mem ~equal:String.equal clang_exe_aliases in + match CommandDoc.command_of_exe_name exe_basename with + | Some _ as command -> command + | None when is_clang exe_basename -> Some CLOpt.Clang + | None -> None let bin_dir = - Filename.dirname real_exe_name + (* Resolve symlinks to get to the real executable, which is located in [bin_dir]. *) + Filename.dirname (Utils.realpath Sys.executable_name) let lib_dir = bin_dir ^/ Filename.parent_dir_name ^/ "lib" @@ -369,20 +349,20 @@ let startup_action = let open CLOpt in if infer_is_javac then Javac else if !Sys.interactive then NoParse - else match current_exe with - | Analyze | Driver | Print -> InferCommand - | Clang -> NoParse - + else match initial_command with + | Some Clang -> + NoParse + | None | Some (Analyze | Capture | Compile | Report | ReportDiff | Run) -> + InferCommand let exe_usage = - let exe_command = match current_exe with - | Analyze -> Some "analyze" - | Clang -> Some "clang" - | Print -> Some "report" - | Driver -> None in + let exe_command_name = match initial_command with + | Some CLOpt.Clang -> None (* users cannot see this *) + | Some command -> Some (CommandDoc.long_of_command command) + | None -> None in Printf.sprintf "%s\nUsage: infer %s [options]\nSee `infer%s --help` for more information." - version_string (Option.value ~default:"command" exe_command) - (Option.value_map ~default:"" ~f:((^) " ") exe_command) + version_string (Option.value ~default:"command" exe_command_name) + (Option.value_map ~default:"" ~f:((^) " ") exe_command_name) (** Command Line options *) @@ -416,17 +396,21 @@ let anon_args = CLOpt.mk_anon () let () = let on_unknown_arg_from_command (cmd: CLOpt.command) = match cmd with - | Clang -> `Skip + | Clang -> assert false (* filtered out *) | Report -> `Add | Analyze | Capture | Compile | ReportDiff | Run -> `Reject in let command_deprecated = List.Assoc.find ~equal:CLOpt.equal_command CLOpt.[ReportDiff, ["-diff"]] in (* make sure we generate doc for all the commands we know about *) - List.iter CLOpt.all_commands ~f:(fun cmd -> + List.filter ~f:(Fn.non (CLOpt.(equal_command Clang))) CLOpt.all_commands + |> List.iter ~f:(fun cmd -> let { CommandDoc.long; command_doc } = CommandDoc.data_of_command cmd in let on_unknown_arg = on_unknown_arg_from_command cmd in let deprecated = command_deprecated cmd in - CLOpt.mk_subcommand cmd ~long ~on_unknown_arg ?deprecated command_doc) + CLOpt.mk_subcommand cmd ~long ~on_unknown_arg ?deprecated (Some command_doc)) + +let () = + CLOpt.mk_subcommand CLOpt.Clang ~long:"" ~on_unknown_arg:`Skip None let abs_struct = CLOpt.mk_int ~deprecated:["absstruct"] ~long:"abs-struct" ~default:1 @@ -738,7 +722,7 @@ and ( and developer_mode = CLOpt.mk_bool ~long:"developer-mode" - ~default:(equal_exe current_exe Print) + ~default:(Option.value_map ~default:false ~f:(CLOpt.(equal_command Report)) initial_command) "Show internal exceptions" and filtering = @@ -953,7 +937,7 @@ and frontend_debug = CLOpt.mk_bool ~deprecated:["fd"] ~deprecated_no:["nfd"] ~long:"frontend-debug" ~in_help:CLOpt.[Capture, manual_clang] "Emit debug info to *.o.astlog and a script *.o.sh that replays the command used to run clang \ - with the plugin attached, piped to the InferClang frontend command" + with the plugin attached, piped to the infer frontend" and frontend_stats = CLOpt.mk_bool ~deprecated:["fs"] ~deprecated_no:["nfs"] ~long:"frontend-stats" @@ -1614,7 +1598,13 @@ let post_parsing_initialization command_opt = | Some Crashcontext -> checkers := true; crashcontext := true | Some Eradicate -> checkers := true; eradicate := true | Some Tracing -> tracing := true - | Some (CaptureOnly | CompileOnly | BiAbduction | Linters) | None -> () + | Some (CaptureOnly | CompileOnly | BiAbduction | Linters) -> () + | None -> + let open CLOpt in + match command_opt with + | Some Compile -> analyzer := Some CompileOnly + | Some Capture -> analyzer := Some CaptureOnly + | _ -> () ); Option.value ~default:CLOpt.Run command_opt diff --git a/infer/src/base/Config.mli b/infer/src/base/Config.mli index a8681acb5..1b2dfeb88 100644 --- a/infer/src/base/Config.mli +++ b/infer/src/base/Config.mli @@ -99,8 +99,6 @@ val frontend_stats_dir_name : string val global_tenv_filename : string val idempotent_getters : bool val incremental_procs : bool -val infer_exe_name : string -val infer_analyze_exe_name : string val infer_py_argparse_error_exit_code : int val initial_analysis_time : float val ivar_attributes : string diff --git a/infer/src/clang/Capture.re b/infer/src/clang/Capture.re index 413535829..8a8d72f9d 100644 --- a/infer/src/clang/Capture.re +++ b/infer/src/clang/Capture.re @@ -139,7 +139,7 @@ let run_plugin_and_frontend source_path frontend clang_args => { if debug_mode { /* -cc1 clang commands always set -o explicitly */ let basename = source_path ^ ".ast"; - /* Emit the clang command with the extra args piped to InferClang */ + /* Emit the clang command with the extra args piped to infer-as-clang */ let frontend_script_fname = Printf.sprintf "%s.sh" basename; let debug_script_out = open_out frontend_script_fname; let debug_script_fmt = Format.formatter_of_out_channel debug_script_out; diff --git a/infer/src/clang/InferClang.re b/infer/src/clang/InferClang.re deleted file mode 100644 index a6b22a3cd..000000000 --- a/infer/src/clang/InferClang.re +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Copyright (c) 2016 - present Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ -open! IStd; - -let () = - switch (Array.to_list Sys.argv) { - | [prog, ...args] => ClangWrapper.exe ::prog ::args - | [] => assert false /* Sys.argv is never empty */ - }; diff --git a/infer/src/clang/cFrontend_config.mli b/infer/src/clang/cFrontend_config.mli index 80cd535d1..3985b7c43 100644 --- a/infer/src/clang/cFrontend_config.mli +++ b/infer/src/clang/cFrontend_config.mli @@ -100,8 +100,7 @@ val log_out : Format.formatter ref val pointer_decl_index : Clang_ast_t.decl Clang_ast_main.PointerMap.t ref val pointer_stmt_index : Clang_ast_t.stmt Clang_ast_main.PointerMap.t ref -(** Map from clang pointers to types produced by ast exporter. Populated once on InferClang - startup *) +(** Map from clang pointers to types produced by ast exporter. Populated once on startup *) val pointer_type_index : Clang_ast_t.c_type Clang_ast_main.PointerMap.t ref (** Map from type pointers (clang pointers and types created later by frontend) to sil types diff --git a/infer/src/integration/Maven.ml b/infer/src/integration/Maven.ml index 9883cce57..8c8e0cd15 100644 --- a/infer/src/integration/Maven.ml +++ b/infer/src/integration/Maven.ml @@ -33,7 +33,7 @@ let infer_profile = lazy \n \ \n \ \n \ - " infer_profile_name (Config.(bin_dir ^/ infer_exe_name))) + " infer_profile_name (Config.bin_dir ^/ CommandDoc.infer_exe_name)) let pom_worklist = ref [CLOpt.init_work_dir] diff --git a/infer/tests/build_systems/clang_compilation_db/Makefile b/infer/tests/build_systems/clang_compilation_db/Makefile index 8feb4008b..89dc4b761 100644 --- a/infer/tests/build_systems/clang_compilation_db/Makefile +++ b/infer/tests/build_systems/clang_compilation_db/Makefile @@ -45,10 +45,10 @@ infer-out-reactive-capture/report.json: $(CMAKE_BUILD_DIR)/compile_commands.json --changed-files-index $(CMAKE_DIR)/index.txt --compilation-database $<) issues.exp.test: infer-out-with-index/report.json infer-out-no-index/report.json infer-out-reactive-capture/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.with-index \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.with-index \ --from-json-report infer-out-with-index/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.no-index \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.no-index \ --from-json-report infer-out-no-index/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.reactive-capture \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.reactive-capture \ --from-json-report infer-out-reactive-capture/report.json $(QUIET)cat $@.with-index $@.no-index $@.reactive-capture > $@ diff --git a/infer/tests/build_systems/mvn/Makefile b/infer/tests/build_systems/mvn/Makefile index b7ff77b84..dec3174e9 100644 --- a/infer/tests/build_systems/mvn/Makefile +++ b/infer/tests/build_systems/mvn/Makefile @@ -39,7 +39,7 @@ infer-out-simple_app/report.json: infer-out-app_with_infer_profile/report.json infer-out-app_with_infer_profile/report.json: infer-out-app_with_profiles/report.json issues-%.exp.test: infer-out-%/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< issues.exp.test: $(foreach mvndir,$(MVN_DIRS),issues-$(mvndir).exp.test) # erase the contents of the file diff --git a/infer/tests/build_systems/resource_leak_exception_lines/Makefile b/infer/tests/build_systems/resource_leak_exception_lines/Makefile index 0da8ba6c8..b2e771347 100644 --- a/infer/tests/build_systems/resource_leak_exception_lines/Makefile +++ b/infer/tests/build_systems/resource_leak_exception_lines/Makefile @@ -22,7 +22,7 @@ $(REPORT): $(INFER_BIN) -o $(INFER_OUT) --project-root $(CURDIR) -- javac SimpleLeak.java) $(EXPECTED_TEST_OUTPUT): $(REPORT) - $(QUIET)$(INFERPRINT_BIN) \ + $(QUIET)$(INFER_BIN) report \ --issues-fields "qualifier_contains_potential_exception_note,bug_type,file,procedure,line_offset" \ --from-json-report $(REPORT) \ --issues-tests $(EXPECTED_TEST_OUTPUT) diff --git a/infer/tests/build_systems/utf8_in_pwd/Makefile b/infer/tests/build_systems/utf8_in_pwd/Makefile index c19a6adae..05e08f890 100644 --- a/infer/tests/build_systems/utf8_in_pwd/Makefile +++ b/infer/tests/build_systems/utf8_in_pwd/Makefile @@ -91,8 +91,8 @@ infer-out-make/report.json: $(CLANG_DEPS) $(MAKE_DIR) $(INFER_BIN) -a $(ANALYZER) --results-dir $(CURDIR)/$(@D) -- \ make clean all) -issues-%.exp.test: infer-out-%/report.json $(INFERPRINT_BIN) - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< +issues-%.exp.test: infer-out-%/report.json $(INFER_BIN) + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< issues.exp.test: issues-cmake.exp.test issues-gradle.exp.test issues-javac.exp.test \ issues-make.exp.test diff --git a/infer/tests/codetoanalyze/objc/errors/Makefile b/infer/tests/codetoanalyze/objc/errors/Makefile index e6c8fb353..f5da36ed2 100644 --- a/infer/tests/codetoanalyze/objc/errors/Makefile +++ b/infer/tests/codetoanalyze/objc/errors/Makefile @@ -135,10 +135,10 @@ infer-out/report.json: $(CLANG_DEPS) $(SOURCES_DEFAULT) $(QUIET)$(call check_no_duplicates,infer-out/duplicates.txt) issues.exp.test: infer-out-all/report.json infer-out-arc/report.json infer-out/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.all \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.all \ --from-json-report infer-out-all/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.arc \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.arc \ --from-json-report infer-out-arc/report.json - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.default \ + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@.default \ --from-json-report infer-out/report.json $(QUIET)cat $@.all $@.arc $@.default > $@ diff --git a/infer/tests/differential.make b/infer/tests/differential.make index 4c05587a0..20d1cc644 100644 --- a/infer/tests/differential.make +++ b/infer/tests/differential.make @@ -36,16 +36,16 @@ $(DIFFERENTIAL_REPORT): $(CURRENT_REPORT) $(PREVIOUS_REPORT) --report-current $(CURRENT_REPORT) --report-previous $(PREVIOUS_REPORT) \ $(DIFFERENTIAL_ARGS)) -$(EXPECTED_TEST_OUTPUT): $(DIFFERENTIAL_REPORT) $(INFERPRINT_BIN) - $(QUIET)$(INFERPRINT_BIN) \ +$(EXPECTED_TEST_OUTPUT): $(DIFFERENTIAL_REPORT) $(INFER_BIN) + $(QUIET)$(INFER_BIN) report \ --issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --from-json-report $(INFER_OUT)/differential/introduced.json \ --issues-tests introduced.exp.test - $(QUIET)$(INFERPRINT_BIN) \ + $(QUIET)$(INFER_BIN) report \ --issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --from-json-report $(INFER_OUT)/differential/fixed.json \ --issues-tests fixed.exp.test - $(QUIET)$(INFERPRINT_BIN) \ + $(QUIET)$(INFER_BIN) report \ --issues-fields $(INFERPRINT_ISSUES_FIELDS) \ --from-json-report $(INFER_OUT)/differential/preexisting.json \ --issues-tests preexisting.exp.test diff --git a/infer/tests/infer.make b/infer/tests/infer.make index 35e9b9ae3..5777f2fe8 100644 --- a/infer/tests/infer.make +++ b/infer/tests/infer.make @@ -13,8 +13,8 @@ ANALYZER_STRING=$(shell if [ -n $(ANALYZER) ] && [ $(ANALYZER) != infer ]; then default: compile -issues.exp.test$(TEST_SUFFIX): infer-out$(TEST_SUFFIX)/report.json $(INFERPRINT_BIN) - $(QUIET)$(INFERPRINT_BIN) -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< +issues.exp.test$(TEST_SUFFIX): infer-out$(TEST_SUFFIX)/report.json $(INFER_BIN) + $(QUIET)$(INFER_BIN) report -q -a $(ANALYZER) $(INFERPRINT_OPTIONS) $@ --from-json-report $< .PHONY: compile compile: $(OBJECTS)