@ -411,11 +411,7 @@ let init_work_dir, is_originator =
(* * Resolve relative paths passed as command line options, i.e., with respect to the working
(* * Resolve relative paths passed as command line options, i.e., with respect to the working
directory of the initial invocation of infer . * )
directory of the initial invocation of infer . * )
let resolve path =
let resolve = filename_to_absolute
if Filename . is_relative path then
init_work_dir // path
else
path
(* * Command Line options *)
(* * Command Line options *)
@ -424,13 +420,12 @@ let resolve path =
let inferconfig_home =
let inferconfig_home =
let all_exes = IList . map snd CLOpt . exes in
let all_exes = IList . map snd CLOpt . exes in
CLOpt . mk_ string _opt ~ long : " inferconfig-home "
CLOpt . mk_ path _opt ~ long : " inferconfig-home "
~ exes : all_exes ~ meta : " dir " " Path to the .inferconfig file "
~ exes : all_exes ~ meta : " dir " " Path to the .inferconfig file "
and project_root =
and project_root =
CLOpt . mk_ string ~ deprecated : [ " project_root " ; " -project_root " ] ~ long : " project-root " ~ short : " pr "
CLOpt . mk_ path ~ deprecated : [ " project_root " ; " -project_root " ] ~ long : " project-root " ~ short : " pr "
~ default : init_work_dir
~ default : init_work_dir
~ f : resolve
~ exes : CLOpt . [ Analyze ; Clang ; Java ; Print ; Toplevel ]
~ exes : CLOpt . [ Analyze ; Clang ; Java ; Print ; Toplevel ]
~ meta : " dir " " Specify the root directory of the project "
~ meta : " dir " " Specify the root directory of the project "
@ -587,7 +582,7 @@ and array_level =
- 2 = assumes that all heap dereferences via array indexing and pointer \
- 2 = assumes that all heap dereferences via array indexing and pointer \
arithmetic are correct "
arithmetic are correct "
and ast_file =
and ast_file =
CLOpt . mk_ string _opt ~ long : " ast-file " ~ short : " ast "
CLOpt . mk_ path _opt ~ long : " ast-file " ~ short : " ast "
~ meta : " file " " AST file for the translation "
~ meta : " file " " AST file for the translation "
and blacklist =
and blacklist =
@ -607,45 +602,45 @@ and buck_build_args =
" Pass values as command-line arguments to invocations of `buck build` (Buck flavors only) "
" Pass values as command-line arguments to invocations of `buck build` (Buck flavors only) "
and buck_out =
and buck_out =
CLOpt . mk_ string _opt ~ long : " buck-out "
CLOpt . mk_ path _opt ~ long : " buck-out "
~ exes : CLOpt . [ Toplevel ] ~ meta : " dir " " Specify the root directory of buck-out "
~ exes : CLOpt . [ Toplevel ] ~ meta : " dir " " Specify the root directory of buck-out "
and bugs_csv =
and bugs_csv =
CLOpt . mk_ string _opt ~ deprecated : [ " bugs " ] ~ long : " issues-csv "
CLOpt . mk_ path _opt ~ deprecated : [ " bugs " ] ~ long : " issues-csv "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file " " Write a list of issues in CSV format to a file "
~ meta : " file " " Write a list of issues in CSV format to a file "
and bugs_json =
and bugs_json =
CLOpt . mk_ string _opt ~ deprecated : [ " bugs_json " ] ~ long : " issues-json "
CLOpt . mk_ path _opt ~ deprecated : [ " bugs_json " ] ~ long : " issues-json "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file " " Write a list of issues in JSON format to a file "
~ meta : " file " " Write a list of issues in JSON format to a file "
and bugs_tests =
and bugs_tests =
CLOpt . mk_ string _opt ~ long : " issues-tests "
CLOpt . mk_ path _opt ~ long : " issues-tests "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in a format suitable for tests to a file "
" Write a list of issues in a format suitable for tests to a file "
and bugs_txt =
and bugs_txt =
CLOpt . mk_ string _opt ~ deprecated : [ " bugs_txt " ] ~ long : " issues-txt "
CLOpt . mk_ path _opt ~ deprecated : [ " bugs_txt " ] ~ long : " issues-txt "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in TXT format to a file "
" Write a list of issues in TXT format to a file "
and bugs_xml =
and bugs_xml =
CLOpt . mk_ string _opt ~ deprecated : [ " bugs_xml " ] ~ long : " issues-xml "
CLOpt . mk_ path _opt ~ deprecated : [ " bugs_xml " ] ~ long : " issues-xml "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file "
~ meta : " file "
" Write a list of issues in XML format to a file "
" Write a list of issues in XML format to a file "
and calls_csv =
and calls_csv =
CLOpt . mk_ string _opt ~ deprecated : [ " calls " ] ~ long : " calls-csv "
CLOpt . mk_ path _opt ~ deprecated : [ " calls " ] ~ long : " calls-csv "
~ exes : CLOpt . [ Toplevel ; Print ]
~ exes : CLOpt . [ Toplevel ; Print ]
~ meta : " file "
~ meta : " file "
" Write individual calls in CSV format to a file "
" Write individual calls in CSV format to a file "
and changed_files_index =
and changed_files_index =
CLOpt . mk_ string _opt ~ long : " changed-files-index " ~ exes : CLOpt . [ Toplevel ] ~ meta : " file "
CLOpt . mk_ path _opt ~ long : " changed-files-index " ~ exes : CLOpt . [ Toplevel ] ~ meta : " file "
" Specify the file containing the list of files from which reactive analysis should start "
" Specify the file containing the list of files from which reactive analysis should start "
and check_duplicate_symbols =
and check_duplicate_symbols =
@ -680,11 +675,11 @@ and checkers_repeated_calls =
" Check for repeated calls "
" Check for repeated calls "
and clang_biniou_file =
and clang_biniou_file =
CLOpt . mk_ string _opt ~ long : " clang-biniou-file " ~ exes : CLOpt . [ Clang ] ~ meta : " file "
CLOpt . mk_ path _opt ~ long : " clang-biniou-file " ~ exes : CLOpt . [ Clang ] ~ meta : " file "
" Specify a file containing the AST of the program, in biniou format "
" Specify a file containing the AST of the program, in biniou format "
and clang_compilation_database =
and clang_compilation_database =
CLOpt . mk_ string _opt ~ long : " clang-compilation-database "
CLOpt . mk_ path _opt ~ long : " clang-compilation-database "
~ exes : CLOpt . [ BuckCompilationDatabase ] ~ meta : " file "
~ exes : CLOpt . [ BuckCompilationDatabase ] ~ meta : " file "
" Specify a json file containing a clang compilation database to be used for the analysis "
" Specify a json file containing a clang compilation database to be used for the analysis "
@ -705,7 +700,7 @@ and _ =
~ meta : " path " " Specify where to find user class files and annotation processors "
~ meta : " path " " Specify where to find user class files and annotation processors "
and cluster =
and cluster =
CLOpt . mk_ string _opt ~ deprecated : [ " cluster " ] ~ long : " cluster "
CLOpt . mk_ path _opt ~ deprecated : [ " cluster " ] ~ long : " cluster "
~ meta : " file " " Specify a .cluster file to be analyzed "
~ meta : " file " " Specify a .cluster file to be analyzed "
(* * Continue the capture for reactive mode:
(* * Continue the capture for reactive mode:
@ -887,7 +882,7 @@ and failures_allowed =
" Fail if at least one of the translations fails (clang only) "
" Fail if at least one of the translations fails (clang only) "
and fcp_apple_clang =
and fcp_apple_clang =
CLOpt . mk_ string _opt ~ long : " fcp-apple-clang "
CLOpt . mk_ path _opt ~ long : " fcp-apple-clang "
~ meta : " path " " Specify the path to Apple Clang "
~ meta : " path " " Specify the path to Apple Clang "
and fcp_syntax_only =
and fcp_syntax_only =
@ -924,7 +919,7 @@ and headers =
" Analyze code in header files "
" Analyze code in header files "
and infer_cache =
and infer_cache =
CLOpt . mk_ string _opt ~ deprecated : [ " infer_cache " ; " -infer_cache " ] ~ long : " infer-cache " ~ f : resolve
CLOpt . mk_ path _opt ~ deprecated : [ " infer_cache " ; " -infer_cache " ] ~ long : " infer-cache "
~ meta : " dir " " Select a directory to contain the infer cache (Buck and Java only) "
~ meta : " dir " " Select a directory to contain the infer cache (Buck and Java only) "
and iterations =
and iterations =
@ -934,7 +929,7 @@ and iterations =
symbolic operations and a multiple of seconds of elapsed time "
symbolic operations and a multiple of seconds of elapsed time "
and java_jar_compiler =
and java_jar_compiler =
CLOpt . mk_ string _opt
CLOpt . mk_ path _opt
~ long : " java-jar-compiler "
~ long : " java-jar-compiler "
~ exes : CLOpt . [ Java ]
~ exes : CLOpt . [ Java ]
~ meta : " path " " Specifify the Java compiler jar used to generate the bytecode "
~ meta : " path " " Specifify the Java compiler jar used to generate the bytecode "
@ -950,12 +945,12 @@ and join_cond =
- 1 = use the least aggressive join for preconditions "
- 1 = use the least aggressive join for preconditions "
and latex =
and latex =
CLOpt . mk_ string _opt ~ deprecated : [ " latex " ] ~ long : " latex "
CLOpt . mk_ path _opt ~ deprecated : [ " latex " ] ~ long : " latex "
~ meta : " file "
~ meta : " file "
" Write a latex report of the analysis results to a file "
" Write a latex report of the analysis results to a file "
and linters_def_file =
and linters_def_file =
CLOpt . mk_ string _opt ~ long : " linters-def-file " ~ exes : CLOpt . [ Clang ]
CLOpt . mk_ path _opt ~ long : " linters-def-file " ~ exes : CLOpt . [ Clang ]
~ meta : " file " " Specify the file containing linters definition "
~ meta : " file " " Specify the file containing linters definition "
and load_average =
and load_average =
@ -965,13 +960,13 @@ and load_average =
make only ) "
make only ) "
and load_results =
and load_results =
CLOpt . mk_ string _opt ~ deprecated : [ " load_results " ] ~ long : " load-results "
CLOpt . mk_ path _opt ~ deprecated : [ " load_results " ] ~ long : " load-results "
~ exes : CLOpt . [ Print ]
~ exes : CLOpt . [ Print ]
~ meta : " file.iar " " Load analysis results from Infer Analysis Results file file.iar "
~ meta : " file.iar " " Load analysis results from Infer Analysis Results file file.iar "
(* * name of the makefile to create with clusters and dependencies *)
(* * name of the makefile to create with clusters and dependencies *)
and makefile =
and makefile =
CLOpt . mk_ string ~ deprecated : [ " makefile " ] ~ long : " makefile " ~ default : " "
CLOpt . mk_ path ~ deprecated : [ " makefile " ] ~ long : " makefile " ~ default : " "
~ meta : " file " " "
~ meta : " file " " "
and margin =
and margin =
@ -995,7 +990,7 @@ and ml_buckets =
~ symbols : ml_bucket_symbols
~ symbols : ml_bucket_symbols
and models_file =
and models_file =
CLOpt . mk_ string _opt ~ deprecated : [ " models " ] ~ long : " models " ~ f : resolve
CLOpt . mk_ path _opt ~ deprecated : [ " models " ] ~ long : " models "
~ exes : CLOpt . [ Analyze ; Java ] ~ meta : " jar file " " Specify a jar file containing the Java models "
~ exes : CLOpt . [ Analyze ; Java ] ~ meta : " jar file " " Specify a jar file containing the Java models "
and models_mode =
and models_mode =
@ -1003,7 +998,7 @@ and models_mode =
" Mode for analyzing the models "
" Mode for analyzing the models "
and modified_targets =
and modified_targets =
CLOpt . mk_ string _opt ~ deprecated : [ " modified_targets " ] ~ long : " modified-targets "
CLOpt . mk_ path _opt ~ deprecated : [ " modified_targets " ] ~ long : " modified-targets "
~ meta : " file " " Read the file of Buck targets modified since the last analysis "
~ meta : " file " " Read the file of Buck targets modified since the last analysis "
and monitor_prop_size =
and monitor_prop_size =
@ -1028,7 +1023,7 @@ and optimistic_cast =
" Allow cast of undefined values "
" Allow cast of undefined values "
and out_file =
and out_file =
CLOpt . mk_ string ~ deprecated : [ " out_file " ] ~ long : " out-file " ~ default : " "
CLOpt . mk_ path ~ deprecated : [ " out_file " ] ~ long : " out-file " ~ default : " "
~ meta : " file " " Specify the file for the non-error logs of the analyzer "
~ meta : " file " " Specify the file for the non-error logs of the analyzer "
and (
and (
@ -1065,11 +1060,11 @@ and print_using_diff =
" Highlight the difference w.r.t. the previous prop when printing symbolic execution debug info "
" Highlight the difference w.r.t. the previous prop when printing symbolic execution debug info "
and procs_csv =
and procs_csv =
CLOpt . mk_ string _opt ~ deprecated : [ " procs " ] ~ long : " procs-csv "
CLOpt . mk_ path _opt ~ deprecated : [ " procs " ] ~ long : " procs-csv "
~ meta : " file " " Write statistics for each procedure in CSV format to a file "
~ meta : " file " " Write statistics for each procedure in CSV format to a file "
and procs_xml =
and procs_xml =
CLOpt . mk_ string _opt ~ deprecated : [ " procs_xml " ] ~ long : " procs-xml "
CLOpt . mk_ path _opt ~ deprecated : [ " procs_xml " ] ~ long : " procs-xml "
~ meta : " file "
~ meta : " file "
" Write statistics for each procedure in XML format to a file (as a path relative to \
" Write statistics for each procedure in XML format to a file (as a path relative to \
- - results - dir ) "
- - results - dir ) "
@ -1089,7 +1084,7 @@ and reactive =
" Reactive mode: the analysis starts from the files captured since the `infer` command started "
" Reactive mode: the analysis starts from the files captured since the `infer` command started "
and report =
and report =
CLOpt . mk_ string _opt ~ deprecated : [ " report " ] ~ long : " report "
CLOpt . mk_ path _opt ~ deprecated : [ " report " ] ~ long : " report "
~ meta : " file " " Write a report of the analysis results to a file "
~ meta : " file " " Write a report of the analysis results to a file "
and report_custom_error =
and report_custom_error =
@ -1103,7 +1098,7 @@ and results_dir =
~ meta : " dir " " Write results and internal files in the specified directory "
~ meta : " dir " " Write results and internal files in the specified directory "
and save_results =
and save_results =
CLOpt . mk_ string _opt ~ deprecated : [ " save_results " ] ~ long : " save-results "
CLOpt . mk_ path _opt ~ deprecated : [ " save_results " ] ~ long : " save-results "
~ meta : " file.iar " " Save analysis results to Infer Analysis Results file file.iar "
~ meta : " file.iar " " Save analysis results to Infer Analysis Results file file.iar "
and seconds_per_iteration =
and seconds_per_iteration =
@ -1137,7 +1132,7 @@ and spec_abs_level =
and specs_library =
and specs_library =
let specs_library =
let specs_library =
CLOpt . mk_ string _list ~ long : " specs-library " ~ short : " lib " ~ f : resolve
CLOpt . mk_ path _list ~ long : " specs-library " ~ short : " lib "
~ meta : " dir|jar " " Search for .spec files in given directory or jar file " in
~ meta : " dir|jar " " Search for .spec files in given directory or jar file " in
let _ =
let _ =
(* Given a filename with a list of paths, convert it into a list of string iff they are
(* Given a filename with a list of paths, convert it into a list of string iff they are
@ -1163,13 +1158,13 @@ and specs_library =
specs_library
specs_library
and stacktrace =
and stacktrace =
CLOpt . mk_ string _opt ~ long : " stacktrace " ~ short : " st " ~ f : resolve ~ exes : CLOpt . [ Toplevel ]
CLOpt . mk_ path _opt ~ long : " stacktrace " ~ short : " st " ~ exes : CLOpt . [ Toplevel ]
~ meta : " file " " File path containing a json-encoded Java crash stacktrace. Used to guide the \
~ meta : " file " " File path containing a json-encoded Java crash stacktrace. Used to guide the \
analysis ( only with ' - a crashcontext' ) . See \
analysis ( only with ' - a crashcontext' ) . See \
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
and stacktraces_dir =
and stacktraces_dir =
CLOpt . mk_ string _opt ~ long : " stacktraces-dir " ~ f : resolve ~ exes : CLOpt . [ Toplevel ]
CLOpt . mk_ path _opt ~ long : " stacktraces-dir " ~ exes : CLOpt . [ Toplevel ]
~ meta : " dir " " Directory path containing multiple json-encoded Java crash stacktraces. \
~ meta : " dir " " Directory path containing multiple json-encoded Java crash stacktraces. \
Used to guide the analysis ( only with ' - a crashcontext' ) . See \
Used to guide the analysis ( only with ' - a crashcontext' ) . See \
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
tests / codetoanalyze / java / crashcontext /* . json for examples of the expected format . "
@ -1183,7 +1178,7 @@ and subtype_multirange =
(* Path to list of collected @SuppressWarnings annotations *)
(* Path to list of collected @SuppressWarnings annotations *)
and suppress_warnings_out =
and suppress_warnings_out =
CLOpt . mk_ string _opt ~ deprecated : [ " suppress_warnings_out " ] ~ long : suppress_warnings_annotations_long
CLOpt . mk_ path _opt ~ deprecated : [ " suppress_warnings_out " ] ~ long : suppress_warnings_annotations_long
~ meta : " path " " "
~ meta : " path " " "
and svg =
and svg =
@ -1240,7 +1235,7 @@ and use_compilation_database =
(* * Set the path to the javac verbose output *)
(* * Set the path to the javac verbose output *)
and verbose_out =
and verbose_out =
CLOpt . mk_ string ~ deprecated : [ " verbose_out " ] ~ long : " verbose-out " ~ default : " "
CLOpt . mk_ path ~ deprecated : [ " verbose_out " ] ~ long : " verbose-out " ~ default : " "
~ meta : " file " " "
~ meta : " file " " "
and version =
and version =
@ -1275,7 +1270,7 @@ and worklist_mode =
var
var
and xcode_developer_dir =
and xcode_developer_dir =
CLOpt . mk_ string _opt ~ long : " xcode-developer-dir "
CLOpt . mk_ path _opt ~ long : " xcode-developer-dir "
~ exes : CLOpt . [ Toplevel ]
~ exes : CLOpt . [ Toplevel ]
~ meta : " XCODE_DEVELOPER_DIR " " Specify the path to Xcode developer directory (Buck flavors only) "
~ meta : " XCODE_DEVELOPER_DIR " " Specify the path to Xcode developer directory (Buck flavors only) "