infer-capture(1)
π infer-capture(1) β Infer Compilation Capture π
okay so welcome to infer-capture(1), aka Infer Compilation Capture, aka the page that tells you how to make infer go grab your source files so it can vibe-check them later. bestie, this one's a whole journey, so buckle up π
πΈ NAME πΈ
infer-capture β capture source files for later analysis β¨
π¦ SYNOPSIS π¦
like, here are all the ways you can call her:
infer capture --buck-java [options] -- buck ...
infer capture --buck-clang [options] -- buck ...
infer capture --buck-compilation-database [no-]deps [options] -- buck ...
infer capture [options] --compilation-database file
infer capture [options] --compilation-database-escaped file
infer capture [options] -- gradle/gradlew ...
infer capture [options] -- hackc ...
infer capture [options] -- javac ...
infer capture [options] -- make/clang/gcc ...
infer capture [options] -- mvn/mvnw ...
infer capture [options] -- ndk-build ...
infer capture [--no-xcpretty] [options] -- xcodebuild ...
infer capture --cfg-json file.json --tenv-json file.json [options]
π DESCRIPTION π
So what does she do? She captures the build command, the compilation database, or the cfg/tenv json files that you specified on the command line. π«Ά Specifically: infer intercepts calls to the compiler to read source files, translates them into infer's intermediate representation, and stores the result of the translation in the results directory. it's giving "middle management but make it compiler-y", and honestly? iconic. π
β¨ OPTIONS β¨
okay this is the long part, stay with me, we're going through every single one fr fr:
--bitcode-captureβ Activates: [EXPERIMENTAL] Use llvm frontend to capture files compiled with clang (Conversely:--no-bitcode-capture)--capture-block-list jsonβ Matcher or list of matchers for names of files that should not be captured, hence not analyzed either. Clang, Java, and Hack only.--cfg-json fileβ Path to CFG json file--continueβ Activates: Continue the capture for the reactive analysis, increasing the changed files/procedures. (If a procedure was changed beforehand, keep the changed marking.) (Conversely:--no-continue)--debug,-gβ Activates: Debug mode (also sets--debug-level 2,--developer-mode,--print-buckets,--print-types,--reports-include-ml-loc,--no-only-cheap-debug,--trace-error,--write-html) (Conversely:--no-debug | -G)--debug-level levelβ Debug level (sets--bo-debug level,--debug-level-analysis level,--debug-level-capture level):0: only basic debugging enabled1: verbose debugging enabled2: very verbose debugging enabled
--debug-level-analysis intβ Debug level for the analysis. See--debug-levelfor accepted values.--debug-level-capture intβ Debug level for the capture. See--debug-levelfor accepted values.--debug-level-report intβ Debug level for the report. See--debug-levelfor accepted values.--force-delete-results-dirβ Activates: Do not refuse to delete the results directory if it doesn't look like an infer results directory. (Conversely:--no-force-delete-results-dir) π«£ (yes bestie, she will actually refuse by default, so pay attention)--force-integration commandβ Proceed as if the first argument after--was command. Possible values:ant,buck,buck2,gradle,gradlew,java,javac,kotlinc,cc,clang,gcc,clang++,c++,g++,hackc,make,configure,cmake,waf,mvn,mvnw,ndk-build,python3,rebar3,rustc,swiftc,erlc,xcodebuild.--helpβ Show this manual--help-format { auto | groff | pager | plain }β Show this help in the specified format.autosets the format toplainif the environment variableTERMis"dumb"or undefined, and topagerotherwise.--help-fullβ Show this manual with all internal options in the INTERNAL OPTIONS section--keep-goingβ Activates: Keep going when the analysis or capture encounter a failure (Conversely:--no-keep-going)--llvm-bitcode-file stringβ [EXPERIMENTAL] Use llvm frontend to directly capture the give bitcode file--llvm-bitcode-source +stringβ [EXPERIMENTAL] Specify source files for llvm bitcode capture--mark-unchanged-procsβ Activates: Check structural identity of newly-captured procedures with previously-captured versions, marking the new procedure as unchanged if the two are equivalent. Also prevents removing results db during capture, so that unchanged results can be reused during future incremental analyses (Conversely:--no-mark-unchanged-procs)--merge-capture +stringβ Specifies an Infer results directory. The files and procedures captured in it will be merged together into the results directory specified with-o. Relative paths are interpreted as relative toproject-root/buck-out.--never-returning-null jsonβ [Java only, all analyses] Matcher or list of matchers for functions that never return null.--print-logsβ Activates: Also log messages to stdout and stderr (Conversely:--no-print-logs)--progress-bar-style { auto | plain | multiline }β Style of the progress bar.autoselectsmultilineif connected to a tty, otherwiseplain.--project-root,-C dirβ Specify the root directory of the project--python-exe pathβ A filepath to a python interpreter. It will bypass the interpreter set byPYTHONvariable--python-files-index pathβ A file containing a list of newline-separated Python files to capture. Compatible withinfer capture -- python3 file1.py file2.pybut not with--pyc-file.--python-skip-capture-imports-threshold intβ Maximum number of imports allowed in a file (we skip capture otherwise).--results-dir,-o dirβ Write results and internal files in the specified directory--run-python-interpreterβ Activates: Capture all.pyfiles, transform them into internal PyIR form and run the PyIR interpreter on them. (Conversely:--no-run-python-interpreter)--skip-analysis-in-path +regexβ Ignore files whose path matches a given regex (can be specified multiple times, but you must make sure each regex is properly bracketed)--sqlite-cache-size intβ SQLite cache size in pages (if positive) or kB (if negative), follows formal of corresponding SQLite PRAGMA.--sqlite-lock-timeout intβ Timeout for SQLite results database operations, in milliseconds.--sqlite-max-blob-size intβ Maximum blob/string size for data written in SQLite.--sqlite-mmap-size intβ Size of memory map for mmaped SQLite databases, zero value disables memory mapping.--sqlite-page-size intβ SQLite page size in bytes, must be a power of two between512and65536.--tenv-json fileβ Path to TEnv json file--textual-hide-instr-typesβ Activates: Do not print types in Textual load/store instructions to reduce IR visual noise. (Conversely:--no-textual-hide-instr-types)--textual-sil-keep-goingβ Activates: When converting textual to SIL, keep going even if some elements fail to convert. (Conversely:--no-textual-sil-keep-going)--workspace pathβ Specifies the root of the workspace, which is a directory containing--project-root. This can be needed if the capture phase is expected to require several different project roots, all relative to a common workspace. Usually a single project root is enough, though.--β Stop argument processing, use remaining arguments as a build command
π§ BUCK OPTIONS π§
buck girlies rise, this section is for you π
--buck-clangβ Activates: Buck integration for clang-based targets (C/C++/Objective-C/Objective-C++). (Conversely:--no-buck-clang)--buck-compilation-database { no-deps | deps }β Buck integration using the compilation database, with or without dependencies. Only includes clang targets, as per Buck's#compilation-databaseflavor.--buck-compilation-database-depth intβ Depth of dependencies used by the--buck-compilation-database depsoption. By default, all recursive dependencies are captured.--buck-dependency-depth intβ Capture dependencies only if they are at most the depth provided, or all transitive dependencies if depth is not provided (the default). In particular, depth zero means capture exactly the targets provided and nothing else.--buck-erlangβ Activates: Buck integration for Erlang. (Conversely:--no-buck-erlang)--buck-javaβ Activates: Buck integration for Java. (Conversely:--no-buck-java)--buck-pythonβ Activates: Buck integration for Python. (Conversely:--no-buck-python)--buck-swiftβ Activates: When using the BXL Clang integration, pass--swift <bool>to control capture of Swift files. (Conversely:--no-buck-swift)--buck-swift-keep-goingβ Activates: When using the BXL Clang integration, pass--swift-keep-going <bool>. (Conversely:--no-buck-swift-keep-going)--buck-targets-block-list +regexβ Skip capture of buck targets matched by the specified regular expression.--buck2-bxl-capture-file-block-list +regexβ Skip capture of files matched by the specified regular expression. Only the clang, Buck2 integration is supported, not Java.--buck2-bxl-target stringβ Buck2 BXL script (as a buck target) to run when capturing with buck2/clang integration.--buck2-inferconfig-target stringβ Buck2 target representing the inferconfig file; used in BXL capture.--buck2-infertoolchain-target stringβ Buck2 target representing the infer toolchain; used in BXL capture.--buck2-isolation-dir stringβ Run buck bxl capture with the given isolation directory as parameter.--no-buck2-query-depsβ Deactivates: Query deps of given targets and run capture on the result (alternatively run capture on given targets) (Conversely:--buck2-query-deps)--buck2-root dirβ Specify the parent directory ofbuck-out(used only forbuck2).--Xbuck2 +stringβ Pass values as command-line arguments to invocations ofbuck2 build. Only valid for--buck-clang.--Xbuck2-no-inline +stringβ Pass values as command-line arguments to invocations ofbuck2 build, don't inline any args starting with'@'. Only valid for--buck-clang.
π CLANG OPTIONS π
okay bestie, this is the C/C++/ObjC zone and there are so many knobs. every single one matters, so let's go π
--clang-biniou-filefile β points at a file holding the AST of the program in biniou format. β οΈ heads up: you still need to give a compilation command, this doesn't replace it, it's giving "extra credit" not "skip the homework".--clang-block-listed-flags+stringβ clang flags to filter out. byeeee to those.--clang-block-listed-flags-with-arg+stringβ same energy, but for clang flags that take arguments β those get filtered out too π--clang-compound-literal-init-limitint β this is the limit after which initializing compound types (structs and arrays) stops being done element by element, and instead uses a builtin function that each analysis has to model. past the limit? builtin time β¨--clang-yojson-filefile β same as above but the AST is in yojson format. and yeah, same deal: you still need a compilation command π«Ά--compilation-database+pathβ file that contains compilation commands. you can pass this multiple times, no cap π₯--compilation-database-escaped+pathβ file that contains compilation commands where all entries are escaped for the shell, e.g. coming from Xcode. also repeatable, give it as many as you want π--no-cxxβ Deactivates: analyze C++ methods. (Conversely:--cxx)--dump-duplicate-symbolsβ Activates: dump all symbols with the same name that are defined in more than one file. (Conversely:--no-dump-duplicate-symbols) lowkey so useful for spotting collisions π--frontend-testsβ Activates: savefilename.ext.test.dotwith the cfg in dotty format for frontend tests β and yes, it also sets--print-types. (Conversely:--no-frontend-tests)--headersβ Activates: analyze code in header files. (Conversely:--no-headers)--objc-synthesize-deallocβ Activates: if enabled, the capture tries to synthesize code in thedeallocmethods of Objective-C classes corresponding to what the compiler does. (Conversely:--no-objc-synthesize-dealloc) iconic ObjC behaviour π--skip-non-capture-clang-commandsβ Activates: skip clang commands that Infer doesn't use to capture data. (Conversely:--no-skip-non-capture-clang-commands)--skip-translation-headers+path_regexβ ignore declarations in headers whose path matches the given OCaml regex from the start of the string during capture. yes, from the start, anchor behaviour matters β¨--struct-as-cpp-classβ Activates: translate C structs as C++ classes. this can be useful when analyzing C/C++ code to make sure struct global variables shared between C and C++ source files are treated as same variables. (Conversely:--no-struct-as-cpp-class)--Xclang+stringβ pass values as command-line arguments to invocations of clang. the capital X is doing main character energy, respect it π--xcprettyβ Activates: Infer will usexcprettytogether withxcodebuildto analyze an iOS app.xcprettyjust needs to be in the path, and the infer command is still justinfer -- <xcodebuild command>. (Conversely:--no-xcpretty)
π¦ ERLANG OPTIONS π¦
beam me up, bestie πΈ
--erlang-ast-dirdir β also load AST from all.jsonfiles in the given path. these.jsonfiles usually come from a previous run with--debug. iykyk π--erlang-check-returnβ Activates: check whether the values returned by functions correspond to what the function's spec promises. this check is introduced at capture time. (Conversely:--no-erlang-check-return) specs said one thing, runtime said another π--no-erlang-reliabilityβ Deactivates: analyze crashing executions. this flag affects both capture and analysis β at capture time it encodes Erlang specs; at (Pulse) analysis time it models Erlang exceptions (builtin or OTP ones). (Conversely:--erlang-reliability)--erlang-skip-compileβ Activates: skip running the compiler (erlc/rebar3) to save time. the build command is basically ignored in this case. to be used together with--erlang-ast-dir. (Conversely:--no-erlang-skip-compile) β‘--erlang-with-otp-specsβ Activates: [EXPERIMENTAL] use type specs from OTP (available in the system) to generate more precise Pulse summaries for unknown library functions. (Conversely:--no-erlang-with-otp-specs) experimental so, like, be aware π«Ά
β JAVA OPTIONS β
--bootclasspathstring β specify the Java bootclasspath.--dependenciesβ Activates: translate all the dependencies during the capture. the classes in the given jar file will be translated, no sources needed. (Conversely:--no-dependencies) slay, no source files required π₯--generated-classespath β specify where to load the generated class files.--java-jar-compilerpath β specify the Java compiler jar used to generate the bytecode.--java-versionint β the version of Java being used. set it to your Java version ifmvnis failing. yes, just tell it the version, that's the fix π--no-kotlin-captureβ Deactivates: enable Kotlin capture. (Conversely:--kotlin-capture)--no-mask-sawja-exceptionsβ Deactivates: mask exceptions thrown by Sawja/Javalib during Java capture. (Conversely:--mask-sawja-exceptions)--no-read-java-modulesβ Deactivates: read java modules file usingjimage. (Conversely:--read-java-modules)
π PULSE CHECKER OPTIONS π
--llvm-debug-locβ Activates: in the llvm frontend, when enabled, we create fresh line numbers instead of0for debugging purposes. (Conversely:--no-llvm-debug-loc) no more mystery line 0 π΅οΈββοΈ--llvm-translate-global-initβ Activates: translates the initializers of globals in the llvm frontend. (Conversely:--no-llvm-translate-global-init)
πΈ ENVIRONMENT πΈ
INFER_ARGS,INFERCONFIG,INFER_STRICT_MODEβ see the ENVIRONMENT section in the manual ofinfer(1). bestie go read that one for the deets π«Ά
π FILES π
.inferconfigβ see the FILES section in the manual ofinfer(1).
β SEE ALSO β
infer-analyze(1), infer-compile(1), infer-run(1)
go off, queen π
okay that's the whole thing, and before you close the tab β this page is infer-capture(1) from version v1.3.0-unknown, dated 2026-10-27. it's literally giving vintage-but-fresh π mwah, now go capture some code babes πβ¨
π¦ where this page comes from
- nixpkgs unstable: infer 1.3.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms