infer-capture(1)

πŸ“¦ version 1.3.0, in nixpkgs unstable

πŸ’… 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 enabled
    • 1: verbose debugging enabled
    • 2: very verbose debugging enabled
  • --debug-level-analysis int β€” Debug level for the analysis. See --debug-level for accepted values.
  • --debug-level-capture int β€” Debug level for the capture. See --debug-level for accepted values.
  • --debug-level-report int β€” Debug level for the report. See --debug-level for 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. auto sets the format to plain if the environment variable TERM is "dumb" or undefined, and to pager otherwise.
  • --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 to project-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. auto selects multiline if connected to a tty, otherwise plain.
  • --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 by PYTHON variable
  • --python-files-index path β€” A file containing a list of newline-separated Python files to capture. Compatible with infer capture -- python3 file1.py file2.py but 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 .py files, 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 between 512 and 65536.
  • --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-database flavor.
  • --buck-compilation-database-depth int β€” Depth of dependencies used by the --buck-compilation-database deps option. 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 of buck-out (used only for buck2).
  • --Xbuck2 +string β€” Pass values as command-line arguments to invocations of buck2 build. Only valid for --buck-clang.
  • --Xbuck2-no-inline +string β€” Pass values as command-line arguments to invocations of buck2 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-file file β€” 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-limit int β€” 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-file file β€” 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: save filename.ext.test.dot with 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 the dealloc methods 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 use xcpretty together with xcodebuild to analyze an iOS app. xcpretty just needs to be in the path, and the infer command is still just infer -- <xcodebuild command>. (Conversely: --no-xcpretty)

πŸ¦‹ ERLANG OPTIONS πŸ¦‹

beam me up, bestie 🌸

  • --erlang-ast-dir dir β€” also load AST from all .json files in the given path. these .json files 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 β˜•

  • --bootclasspath string β€” 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-classes path β€” specify where to load the generated class files.
  • --java-jar-compiler path β€” specify the Java compiler jar used to generate the bytecode.
  • --java-version int β€” the version of Java being used. set it to your Java version if mvn is 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 using jimage. (Conversely: --read-java-modules)

πŸ’œ PULSE CHECKER OPTIONS πŸ’œ

  • --llvm-debug-loc β€” Activates: in the llvm frontend, when enabled, we create fresh line numbers instead of 0 for 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 of infer(1). bestie go read that one for the deets 🫢

πŸŽ€ FILES πŸŽ€

  • .inferconfig β€” see the FILES section in the manual of infer(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