delete the deprecated script inferJ

Summary: @​public
The script inferJ is no longer used.

Reviewed By: @sblackshear

Differential Revision: D2501379
master
jrm 9 years ago committed by facebook-github-bot-7
parent e6600cf03b
commit 0282060808

@ -21,8 +21,6 @@ The rest of the commands in infer/bin/ are not meant to be called directly, but
*InferPrint* : Binary that prints reports about the analysis such as the specs of methods and a list of bugs found.
*inferJ* : Command for running the analysis of Java files.
*BuckAnalyze* : Command for running the analysis of Java projects compiled with Buck.
*inferlib.py* : Python libraries for the other scripts.
@ -30,4 +28,3 @@ The rest of the commands in infer/bin/ are not meant to be called directly, but
*utils.py* : Python libraries for the other scripts.
*jwlib.py* : Python libraries for the other scripts.

@ -6,7 +6,6 @@ bin: [
"?infer/bin/InferClang"
"infer/bin/InferAnalyze"
"infer/bin/InferPrint"
"infer/bin/inferJ"
"infer/bin/BuckAnalyze"
"infer/bin/inferlib.py"
"infer/bin/utils.py"

@ -60,7 +60,7 @@ LOCAL_CONFIG = """\
def prepare_build(args):
"""Creates script that redirects javac calls to inferJ and a local buck
"""Creates script that redirects javac calls to infer and a local buck
configuration that tells buck to use that script.
"""

@ -74,7 +74,7 @@ def split_args_to_parse():
def create_argparser(parents=[]):
parser = argparse.ArgumentParser(
parents=[inferlib.inferJ_parser] + parents,
parents=[inferlib.infer_parser] + parents,
add_help=False,
formatter_class=argparse.RawDescriptionHelpFormatter,
)

@ -1,24 +0,0 @@
#!/usr/bin/env python2.7
# Copyright (c) 2013 - 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.
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import sys
import inferlib
if __name__ == '__main__':
cmd_args = sys.argv[1:]
analysis = inferlib.Infer(inferlib.get_inferJ_args(cmd_args),
inferlib.get_javac_args(cmd_args))
stats = analysis.start()

@ -120,47 +120,47 @@ base_parser.add_argument('-v', '--version',
action=VersionAction)
inferJ_parser = argparse.ArgumentParser(parents=[base_parser])
inferJ_group = inferJ_parser.add_argument_group('backend arguments')
inferJ_group.add_argument('-j', '--multicore', metavar='n', type=int,
infer_parser = argparse.ArgumentParser(parents=[base_parser])
infer_group = infer_parser.add_argument_group('backend arguments')
infer_group.add_argument('-j', '--multicore', metavar='n', type=int,
default=multiprocessing.cpu_count(),
dest='multicore', help='Set the number of cores to '
'be used for the analysis (default uses all cores)')
inferJ_group.add_argument('-x', '--project', metavar='<projectname>',
infer_group.add_argument('-x', '--project', metavar='<projectname>',
help='Project name, for recording purposes only')
inferJ_group.add_argument('-r', '--revision', metavar='<githash>',
infer_group.add_argument('-r', '--revision', metavar='<githash>',
help='The githash, for recording purposes only')
inferJ_group.add_argument('--buck', action='store_true', dest='buck',
infer_group.add_argument('--buck', action='store_true', dest='buck',
help='To use when run with buck')
inferJ_group.add_argument('--infer_cache', metavar='<directory>',
infer_group.add_argument('--infer_cache', metavar='<directory>',
help='Select a directory to contain the infer cache')
inferJ_group.add_argument('-pr', '--project_root',
infer_group.add_argument('-pr', '--project_root',
dest='project_root',
default=os.getcwd(),
help='Location of the project root '
'(default is current directory)')
inferJ_group.add_argument('--absolute-paths',
infer_group.add_argument('--absolute-paths',
action='store_true',
default=False,
help='Report errors with absolute paths')
inferJ_group.add_argument('--objc_ml_buckets',
infer_group.add_argument('--objc_ml_buckets',
dest='objc_ml_buckets',
help='memory leak buckets to be checked, '
'separated by commas. The possible '
'buckets are cf (Core Foundation), '
'arc, narc (No arc)')
inferJ_group.add_argument('-nt', '--notest', action='store_true',
infer_group.add_argument('-nt', '--notest', action='store_true',
dest='notest',
help='Prints output of symbolic execution')
inferJ_group.add_argument('--specs-dir',
infer_group.add_argument('--specs-dir',
metavar='<dir>',
action='append',
dest='specs_dirs',
@ -174,13 +174,13 @@ def detect_javac(args):
return index
def get_inferJ_args(args):
def get_infer_args(args):
index = detect_javac(args)
if index is None:
cmd_args = args
else:
cmd_args = args[:index]
return inferJ_parser.parse_args(cmd_args)
return infer_parser.parse_args(cmd_args)
def get_javac_args(args):
@ -235,7 +235,7 @@ def clean(infer_out, annotations_out):
def help_exit(message):
print(message)
inferJ_parser.print_usage()
infer_parser.print_usage()
exit(1)
@ -376,8 +376,8 @@ def run_command(cmd, debug_mode, javac_arguments, step, analyzer):
return subprocess.check_call(cmd)
except subprocess.CalledProcessError as e:
error_msg = 'Failure during {0}, original command was\n\n{1}\n\n'
inferJ_cmd = ['inferJ', '-g', '-a', analyzer]
failing_cmd = inferJ_cmd + ['javac'] + javac_arguments
infer_cmd = ['infer', '-g', '-a', analyzer]
failing_cmd = infer_cmd + ['--', 'javac'] + javac_arguments
logging.error(error_msg.format(
step,
failing_cmd

@ -47,7 +47,7 @@ class AntCapture:
else:
return argument
def get_inferJ_commands(self, verbose_output):
def get_infer_commands(self, verbose_output):
javac_pattern = '[javac]'
argument_start_pattern = 'Compilation arguments'
calls = []
@ -58,7 +58,7 @@ class AntCapture:
if argument_start_pattern in line:
collect = True
if javac_arguments != []:
capture = util.create_inferJ_command(self.args,
capture = util.create_infer_command(self.args,
javac_arguments)
calls.append(capture)
javac_arguments = []
@ -69,11 +69,11 @@ class AntCapture:
arg = self.remove_quotes(content)
javac_arguments.append(arg)
if javac_arguments != []:
capture = util.create_inferJ_command(self.args, javac_arguments)
capture = util.create_infer_command(self.args, javac_arguments)
calls.append(capture)
javac_arguments = []
return calls
def capture(self):
cmds = self.get_inferJ_commands(util.get_build_output(self.build_cmd))
cmds = self.get_infer_commands(util.get_build_output(self.build_cmd))
return util.run_commands(cmds)

@ -42,7 +42,7 @@ class GradleCapture:
os.mkdir(path)
logging.info("Running with:\n" + version_str)
def get_inferJ_commands(self, verbose_output):
def get_infer_commands(self, verbose_output):
argument_start_pattern = ' Compiler arguments: '
calls = []
seen_build_cmds = set([])
@ -73,11 +73,11 @@ class GradleCapture:
sources.write("\n".join(java_files))
sources.flush()
java_args.append("@" + sources.name)
capture = util.create_inferJ_command(self.args,
capture = util.create_infer_command(self.args,
java_args)
calls.append(capture)
return calls
def capture(self):
cmds = self.get_inferJ_commands(util.get_build_output(self.build_cmd))
cmds = self.get_infer_commands(util.get_build_output(self.build_cmd))
return util.run_commands(cmds)

@ -32,7 +32,7 @@ class MavenCapture:
# TODO: make the extraction of targets smarter
self.build_cmd = ['mvn', '-X'] + cmd[1:]
def get_inferJ_commands(self, verbose_output):
def get_infer_commands(self, verbose_output):
file_pattern = r'\[DEBUG\] Stale source detected: ([^ ]*\.java)'
options_pattern = '[DEBUG] Command line options:'
@ -43,7 +43,7 @@ class MavenCapture:
if options_next:
# line has format [Debug] <space separated options>
javac_args = line.split(' ')[1:] + files_to_compile
capture = util.create_inferJ_command(self.args, javac_args)
capture = util.create_infer_command(self.args, javac_args)
calls.append(capture)
options_next = False
files_to_compile = []
@ -60,5 +60,5 @@ class MavenCapture:
return calls
def capture(self):
cmds = self.get_inferJ_commands(util.get_build_output(self.build_cmd))
cmds = self.get_infer_commands(util.get_build_output(self.build_cmd))
return util.run_commands(cmds)

@ -15,13 +15,13 @@ import inferlib
import traceback
def create_inferJ_command(args, javac_arguments):
def create_infer_command(args, javac_arguments):
infer_args = ['-o', args.infer_out]
if args.debug:
infer_args.append('--debug')
infer_args += ['--analyzer', 'capture']
return inferlib.Infer(inferlib.inferJ_parser.parse_args(infer_args),
return inferlib.Infer(inferlib.infer_parser.parse_args(infer_args),
inferlib.get_javac_args(['javac'] + javac_arguments))

@ -13,7 +13,7 @@ fi
HOST_COMPILER=(`PATH=$INFER_OLD_PATH which javac`)
COMPILER_ARGS="$@"
HOST_COMPILER_COMMAND=("$HOST_COMPILER" $COMPILER_ARGS)
FRONTEND_COMMAND=("inferJ" "-a" "capture" "-o" "$INFER_RESULTS_DIR" "javac" $COMPILER_ARGS)
FRONTEND_COMMAND=("infer" "-a" "capture" "-o" "$INFER_RESULTS_DIR" "--" "javac" $COMPILER_ARGS)
if [ -n "$INFER_COMPILER_WRAPPER_IN_RECURSION" ]; then
if [ -z "$INFER_LISTENER" ]; then

@ -11,7 +11,7 @@ LIB_SPECS = $(LIBDIR)/specs
INFERANALYZE = $(BINDIR)/InferAnalyze
INFERCLANG = $(BINDIR)/InferClang
INFERJAVA = $(BINDIR)/InferJava
JAVA_SCRIPTS = $(addprefix $(BINDIR)/, jwlib.py inferlib.py inferJ)
JAVA_SCRIPTS = $(addprefix $(BINDIR)/, jwlib.py inferlib.py infer)
CLANG_SCRIPTS = $(addprefix $(BINDIR)/, inferiOS) # Add more once this part is stable
PLATFORM = $(shell uname)

@ -2,7 +2,7 @@ SHELL := /bin/bash
CWD = $(shell pwd)
BINDIR = $(CWD)/../../bin
INFERJ = INFER_ANALYZE_MODELS=1 $(BINDIR)/inferJ --buck --analyzer infer --multicore 1
INFER = INFER_ANALYZE_MODELS=1 $(BINDIR)/infer --buck --analyzer infer --multicore 1
ANDROID_JAR = ../../lib/java/android/android-19.jar
JACKSON_JAR = ../../../dependencies/java/jackson/jackson-2.2.3.jar
@ -29,7 +29,7 @@ clean:
$(CSV_REPORT): $(JAVA_SOURCES)
mkdir $(MODELS_OUT)
$(INFERJ) javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(JACKSON_JAR) $(JAVA_SOURCES)
$(INFER) -- javac -bootclasspath $(ANDROID_JAR) -d $(MODELS_OUT) -classpath $(JACKSON_JAR) $(JAVA_SOURCES)
$(MODELS_JAR): $(CSV_REPORT)
cd $(MODELS_OUT); jar cf $(MODELS_JAR) *

@ -1,58 +0,0 @@
ANNOTATIONS_JAR = ../annotations/annotations.jar
MODELS_JAR = ../lib/java/models.jar
JACKSON_JAR = ../../dependencies/java/jackson/jackson-2.2.3.jar
ANDROID_JAR = ../lib/java/android/android-19.jar
GUAVA_JAR = ../../dependencies/java/guava/guava-10.0.1-fork.jar
JSR_JAR = ../../dependencies/java/jsr-305/jsr305.jar
INFERJ = inferJ
TRACING_OUT = tracing_out
TRACING_REPORT = $(TRACING_OUT)/report.csv
TRACING_SOURCES = $(shell find codetoanalyze/java/tracing -name "*.java")
TRACING_JAVAC_CMD = javac -cp $(ANNOTATIONS_JAR) $(TRACING_SOURCES)
TRACING_CMD = $(INFERJ) -o $(TRACING_OUT) -a tracing $(TRACING_JAVAC_CMD)
INFER_OUT = infer_out
INFER_REPORT = $(INFER_OUT)/report.csv
INFER_SOURCES = $(shell find codetoanalyze/java/infer -name "*.java")
INFER_JAVAC_CMD = javac -cp $(JACKSON_JAR):$(ANDROID_JAR):$(MODELS_JAR) $(INFER_SOURCES)
INFER_CMD = $(INFERJ) -o $(INFER_OUT) -a infer $(INFER_JAVAC_CMD)
ERADICATE_OUT = eradicate_out
ERADICATE_REPORT = $(ERADICATE_OUT)/report.csv
ERADICATE_SOURCES = $(shell find codetoanalyze/java/eradicate -name "*.java")
ERADICATE_JAVAC_CMD = javac -cp $(JSR_JAR):$(ANNOTATIONS_JAR):$(GUAVA_JAR):$(ANDROID_JAR) $(ERADICATE_SOURCES)
ERADICATE_CMD = $(INFERJ) -o $(ERADICATE_OUT) -a eradicate $(ERADICATE_JAVAC_CMD)
CHECKERS_OUT = checkers_out
CHECKERS_REPORT = $(CHECKERS_OUT)/report.csv
CHECKERS_SOURCES = $(shell find codetoanalyze/java/checkers -name "*.java")
CHECKERS_JAVAC_CMD = javac -cp $(ANNOTATIONS_JAR):$(GUAVA_JAR):$(ANDROID_JAR) $(CHECKERS_SOURCES)
CHECKERS_CMD = $(INFERJ) -o $(CHECKERS_OUT) -a checkers $(CHECKERS_JAVAC_CMD)
.PHONY: tracing infer eradicate checkers
all: tracing infer eradicate checkers
tracing:
$(TRACING_CMD)
infer:
$(INFER_CMD)
eradicate:
$(ERADICATE_CMD)
checkers:
$(CHECKERS_CMD)
clean:
rm -rf $(TRACING_OUT)
rm -rf $(INFER_OUT)
rm -rf $(CHECKERS_OUT)
rm -rf $(ERADICATE_OUT)
find . -name "*.o" | xargs rm
find . -name "*.class" | xargs rm
Loading…
Cancel
Save