audit
This document provides an overview of the commands and options available under buck2 audit.
buck2 audit
Perform lower level queries
Usage: buck2 audit <COMMAND>
Subcommands:
cell: Query information about the [cells] list in .buckconfig.classpath: Prints out a target's classpaths if it has one. This command is deprecated and currently available for compatibility with buck1. We will replace this command with something that can audit the entireTemplatePlaceholderInfoin the future.config: buck audit configconfigurations: prints the constraints for configuration IDsincludes: list build file extensions imported at parse time.prelude: print the interpreter prelude to stdoutproviders: prints out the providers for a target patternsubtargets: Print all subtargetsanalysis-queries: buck audit analysis resolving query attrsexecution-platform-resolution: prints out information about execution platform resolutionvisibility: Verify the visibility for transitive deps of the specified target(s) on the unconfigured target graphstarlark: Debug Starlark interpreterdep-files: prints out the select files for a commanddeferred-materializer: Access and interact with the deferred materializeroutput: Query the action that produced the output artifact. Does not support BXL, test, scratch, or anon artifacts. If the configuration hash of the output path does not match the current platform configuration, the unconfigured target label will be returned.parse: Parses the buck-out path into parts that may be useful (ex: config hash, file path to artifact).package-values: Inspect package valuesperf: Commands for checking buck2 performance
buck2 audit cell
Query information about the [cells] list in .buckconfig.
Usage: buck2 audit cell [OPTIONS] [CELL_ALIASES]...
Arguments:
<CELL_ALIASES>Cell aliases to query. These aliases will be resolved in the working directory cell.
Options:
-
--jsonOutput in JSON format -
--paths-onlyDon't include the cell name in the output -
--aliasesIf enabled and no explicit aliases are passed, will query for all aliases in the working directory cell. -
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit classpath
Prints out a target's classpaths if it has one.
This command is deprecated and currently available for compatibility with buck1.
We will replace this command with something that can audit the entire TemplatePlaceholderInfo in the future.
Usage: buck2 audit classpath [OPTIONS] [TARGET_PATTERNS]...
Arguments:
<TARGET_PATTERNS>Target patterns to audit
Options:
-
--jsonOutput in JSON format -
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit config
buck audit config
Usage: buck2 audit config [OPTIONS] [SPECS]...
Arguments:
<SPECS>config section/key specs of the formsectionorsection.key. If any specs are provided, only values matching a spec will be printed (section headers will be printed only for sections with a key matching the spec)
Options:
-
--cell <CELL> -
--all-cellsProduce information for all cells that Buck2 knows about -
--output-format <OUTPUT_FORMAT>- Possible values:
simplejson
- Possible values:
-
--json -
--location <LOCATION_STYLE>- Default value:
none - Possible values:
nonedirectextended
- Default value:
-
--value <VALUE_STYLE>- Default value:
resolved - Possible values:
resolvedrawboth
- Default value:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit configurations
prints the constraints for configuration IDs
Usage: buck2 audit configurations [OPTIONS] [configurations]...
Arguments:
<configurations>configurations to audit (example:cell//package:target-105fe3389fc7e436). If none provided, will print information about all known configurations.
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit includes
list build file extensions imported at parse time.
Usage: buck2 audit includes [OPTIONS] [BUILD_FILES]...
Arguments:
<BUILD_FILES>Build files to audit. These are expected to be relative paths from the working dir cell.
Options:
-
--jsonPrint json representation of outputs -
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit prelude
print the interpreter prelude to stdout
Usage: buck2 audit prelude [OPTIONS]
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit providers
prints out the providers for a target pattern
Usage: buck2 audit providers [OPTIONS] <TARGET_PATTERNS>...
Arguments:
<TARGET_PATTERNS>Patterns to analyze
Options:
-
--quiet -
-l, --listList the available providers -
--print-debugPrint the providers using debug format (very verbose) -
-u, --target-universe <TARGET_UNIVERSE>Comma separated list of targets to construct a configured target universe.When the option is specified, command targets are be resolved in this universe. Additionally,
--target-platforms=and--modifier=flags are be used to configure the universe targets, not the command targets.This argument is particularly recommended on most non-trivial cqueries. In the absence of this argument, buck2 will use the target literals in your cquery expression as the value for this argument, which may not be what you want.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit subtargets
Print all subtargets
Usage: buck2 audit subtargets [OPTIONS] <TARGET_PATTERNS>...
Arguments:
<TARGET_PATTERNS>Patterns to analyze
Options:
-
--shallowDo not recursively print all nested subtargets; print only the first level. This is set to false by default -
--jsonPrint subtargets as JSON -
-u, --target-universe <TARGET_UNIVERSE>Comma separated list of targets to construct a configured target universe.When the option is specified, command targets are be resolved in this universe. Additionally,
--target-platforms=and--modifier=flags are be used to configure the universe targets, not the command targets.This argument is particularly recommended on most non-trivial cqueries. In the absence of this argument, buck2 will use the target literals in your cquery expression as the value for this argument, which may not be what you want.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit analysis-queries
buck audit analysis resolving query attrs
Usage: buck2 audit analysis-queries [OPTIONS] [TARGET_PATTERNS]...
Arguments:
<TARGET_PATTERNS>Patterns to evaluate. The query attributes for targets matching these patterns will be evaluated
Options:
-
--include-outputsEnable to print the outputs for the targets in the resolved queries -
-u, --target-universe <TARGET_UNIVERSE>Comma separated list of targets to construct a configured target universe.When the option is specified, command targets are be resolved in this universe. Additionally,
--target-platforms=and--modifier=flags are be used to configure the universe targets, not the command targets.This argument is particularly recommended on most non-trivial cqueries. In the absence of this argument, buck2 will use the target literals in your cquery expression as the value for this argument, which may not be what you want.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit execution-platform-resolution
prints out information about execution platform resolution
Usage: buck2 audit execution-platform-resolution [OPTIONS] [TARGET_PATTERNS]...
Arguments:
<TARGET_PATTERNS>Patterns to analyze
Options:
-
-u, --target-universe <TARGET_UNIVERSE>Comma separated list of targets to construct a configured target universe.When the option is specified, command targets are be resolved in this universe. Additionally,
--target-platforms=and--modifier=flags are be used to configure the universe targets, not the command targets.This argument is particularly recommended on most non-trivial cqueries. In the absence of this argument, buck2 will use the target literals in your cquery expression as the value for this argument, which may not be what you want.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit visibility
Verify the visibility for transitive deps of the specified target(s) on the unconfigured target graph
Usage: buck2 audit visibility [OPTIONS] [TARGET_PATTERNS]...
Arguments:
<TARGET_PATTERNS>Target pattern(s) to analyze.
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit starlark
Debug Starlark interpreter
Usage: buck2 audit starlark <COMMAND>
Subcommands:
module: Inspect Starlark module by fully qualified import string like foo//bar:baz.bzlpackage-deps: Inspect Starlark package file all bzl dependencies by package name like foo//bar/baz
buck2 audit starlark module
Inspect Starlark module by fully qualified import string like foo//bar:baz.bzl
Usage: buck2 audit starlark module [OPTIONS] <IMPORT_PATH>
Arguments:
<IMPORT_PATH>Module import path
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit starlark package-deps
Inspect Starlark package file all bzl dependencies by package name like foo//bar/baz
Usage: buck2 audit starlark package-deps [OPTIONS] <PACKAGE>
Arguments:
<PACKAGE>Package
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit dep-files
prints out the select files for a command
Usage: buck2 audit dep-files [OPTIONS] <PATTERN> <CATEGORY> [IDENTIFIER]
Arguments:
-
<PATTERN>Target to query dep files for -
<CATEGORY>Action category -
<IDENTIFIER>Action identifier
Options:
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit deferred-materializer
Access and interact with the deferred materializer
Usage: buck2 audit deferred-materializer [OPTIONS] <COMMAND>
Subcommands:
listlist-subscriptionsfsckrefreshget-refresh-log: Get the log for TTL refreshestest-iterflush-access-times
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit deferred-materializer list
Usage: buck2 audit deferred-materializer list
buck2 audit deferred-materializer list-subscriptions
Usage: buck2 audit deferred-materializer list-subscriptions
buck2 audit deferred-materializer fsck
Usage: buck2 audit deferred-materializer fsck
buck2 audit deferred-materializer refresh
Usage: buck2 audit deferred-materializer refresh <MIN_TTL>
Arguments:
<MIN_TTL>Minimum TTL to require for actions
buck2 audit deferred-materializer get-refresh-log
Get the log for TTL refreshes
Usage: buck2 audit deferred-materializer get-refresh-log
buck2 audit deferred-materializer test-iter
Usage: buck2 audit deferred-materializer test-iter [OPTIONS]
Options:
-
--count <COUNT>- Default value:
1
- Default value:
buck2 audit deferred-materializer flush-access-times
Usage: buck2 audit deferred-materializer flush-access-times
buck2 audit output
Query the action that produced the output artifact. Does not support BXL, test, scratch, or anon artifacts. If the configuration hash of the output path does not match the current platform configuration, the unconfigured target label will be returned.
Usage: buck2 audit output [OPTIONS] <OUTPUT_PATH>
Arguments:
<OUTPUT_PATH>The buck-out path to the build artifact, starting withbuck-outand including the configuration platform.
Options:
-
--json -
-A, --output-all-attributesOutput all attributes, equivalent of --output-attribute ''.Avoid using this flag in automation because it may be expensive to produce certain attributes, and because it makes harder to track which special attributes are used.
-
-B, --output-basic-attributesOutput basic attributes, namely those the user can supply, plus rule type and package name -
-a, --output-attribute <ATTRIBUTE>Regular expressions to match attributes. Regular expressions are used in "search" mode, so for example empty string matches all attributes including special attributes.When using in automation, please specify the regular expression to match the attribute precisely, for example
--output-attribute '^headers$'to make it easier to track which special attributes are used. -
--output-attributes <ATTRIBUTE>Deprecated: Use--output-attributeinstead.List of space-separated attributes to output, --output-attributes attr1 attr2.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit parse
Parses the buck-out path into parts that may be useful (ex: config hash, file path to artifact).
Usage: buck2 audit parse [OPTIONS] <OUTPUT_PATH>
Arguments:
<OUTPUT_PATH>The buck-out path to the build artifact, starting withbuck-outand including the configuration platform.
Options:
-
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag -
-m, --modifier <VALUE>This option is not used -
--json -
--output-attribute <OUTPUT_ATTRIBUTE>
buck2 audit package-values
Inspect package values.
Package values is the thing set with write_package_value function from PACKAGE files.
Usage: buck2 audit package-values [OPTIONS] [PACKAGES]...
Arguments:
<PACKAGES>Package names to inspect (like//foo/bar, no trailing colon)
Options:
-
-m, --modifier <VALUE>This option is not used -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag
buck2 audit perf
Commands for checking buck2 performance
Usage: buck2 audit perf <COMMAND>
Subcommands:
configured-graph-size: utility to measure performance of configured graph size computation
buck2 audit perf configured-graph-size
utility to measure performance of configured graph size computation
Usage: buck2 audit perf configured-graph-size [OPTIONS] [TARGET_PATTERNS]...
Arguments:
<TARGET_PATTERNS>Target patterns to audit
Options:
-
--json -
--sketchwhether to compute sketch or not -
-u, --target-universe <TARGET_UNIVERSE>Comma separated list of targets to construct a configured target universe.When the option is specified, command targets are be resolved in this universe. Additionally,
--target-platforms=and--modifier=flags are be used to configure the universe targets, not the command targets.This argument is particularly recommended on most non-trivial cqueries. In the absence of this argument, buck2 will use the target literals in your cquery expression as the value for this argument, which may not be what you want.
-
--target-platforms <PLATFORM>Configuration target (one) to use to configure targets -
-m, --modifier <VALUE>A configuration modifier to configure all targets on the command line. This may be a constraint value target. -
-c, --config <SECTION.OPTION=VALUE>List of config options -
--config-file <PATH>List of config file paths -
--fake-host <HOST>- Possible values:
defaultlinuxmacoswindows
- Possible values:
-
--fake-arch <ARCH>- Possible values:
defaultaarch64x8664
- Possible values:
-
--fake-xcode-version <VERSION-BUILD>Value must be formatted as: version-build (e.g., 14.3.0-14C18 or 14.1-14B47b) -
--reuse-current-configRe-uses any--configvalues (inline or via modefiles) if there's a previous command, otherwise the flag is ignored.If there is a previous command and
--reuse-current-configis set, then the old config is used, ignoring any overrides.If there is no previous command but the flag was set, then the flag is ignored, the command behaves as if the flag was not set at all.
-
--preemptible <PREEMPTIBLE>Used to configure when this command could be preempted by another command for the same isolation dir.Normally, when you run two commands - from different terminals, say - buck2 will attempt to run them in parallel. However, if the two commands are based on different state, that is they either have different configs or different filesystem states, buck2 cannot run them in parallel. The default behavior in this case is to block the second command until the first completes.
- Possible values:
never: (default) When another command starts that cannot run in parallel with this one, block that commandalways: When another command starts, interrupt this command, even if they could run in parallel. There is no good reason to use this other than that it provides slightly nicer superconsole outputondifferentstate: When another command starts that cannot run in parallel with this one, interrupt this command
- Possible values:
-
--exit-when <EXIT_WHEN>Whether to proceed with or fail this invocation based on the daemon state- Possible values:
never: (default) Execute this command normallydifferentstate: Fail this command if another command is already running with a different statenotidle: Fail this command if another command is already running (regardless of daemon state)
- Possible values:
-
--disable-starlark-typesDisable runtime type checking in Starlark interpreter.This option is not stable, and can be used only locally to diagnose evaluation performance problems.
-
--stackRecord or show target call stacks.Starlark call stacks will be included in duplicate targets error.
If a command outputs targets (like
targetscommand), starlark call stacks will be printed after the targets. -
--profile-patterns <PROFILE_PATTERNS>Enables profiling for all evaluations whose evaluation identifier matches one of the provided patterns.Some examples identifiers: analysis/cell//buck2/app/buck2_action_impl:buck2_action_impl (cfg:linux-x86_64#27ac5723e0c99706) load/cell//build_defs/json.bzl load/prelude//playground/test.bxl load/cell//build_defs/json.bzl@other_cell load_buildfile/fbcode//third-party-buck/platform010/build/ncurses load_packagefile/fbcode//cli/rust/cli_delegate anon_analysis/anon//:_anon_link_rule (anon: 766183dc9b6f680a) (fbcode//buck2/platform/execution:linux-x86_64#08961b14cfb182aa) bxl/prelude//playground/test.bxl:playground
You can pass
--profile-patterns=.*to enable no-op profiling for everything (additionally pass--profile-patterns-mode=noneto use no-op profiling to just get a list of all the identifiers).The profile results will be written to individual .profile files in
<ROOT_OUTPUT>/<data+time>-<uuid>/where ROOT_OUTPUT comes from the --profile-patterns-output flag. In that directory there will also be a file listing all the identifiers that were profiled.Enabling/disabling profiling of an evaluation will invalidate the results of that evaluation and it will be recomputed. In some cases, this will cause other work to also need to be redone (for example, invalidating the result of loading PACKAGE files causes all consumers to be recomputed). But if you keep profiling options consistent between commands, only the work that is otherwise invalidated will be redone (and only for those would profiling results be created).
You must also pass --profile-patterns-mode and --profile-patterns-output.
-
--profile-patterns-output <PATH> -
--profile-patterns-mode <PROFILE_PATTERNS_MODE>Profile mode.Memory profiling modes have suffixes either
-allocatedor-retained.-retainedmeans memory kept in frozen starlark heaps after analysis completes.-retaineddoes not work when profiling loading, because no memory is retained after loading and frozen heap is not even created. This is probably what you want when profiling analysis.-allocatedmeans allocated memory, including memory which is later garbage collected.- Possible values:
time-flameheap-allocatedheap-retainedheap-flame-allocatedheap-flame-retainedheap-summary-allocatedheap-summary-retainedstatementbytecodebytecode-pairstypecheckcoveragenone
- Possible values:
-
--console <super|simple|...>Which console to use for this command- Default value:
auto - Possible values:
autononesimplesimplenottysimplettysuper
- Default value:
-
--ui <UI>Configure additional superconsole ui components.Accepts a comma-separated list of superconsole components to add. Possible values are:
dice - shows information about evaluated dice nodes debugevents - shows information about the flow of events from buckd
These components can be turned on/off interactively. Press 'h' for help when superconsole is active.
- Possible values:
dicedebugeventsio: I/O panelre: RE panel
- Possible values:
-
--no-interactive-consoleDisable console interactions -
--event-log <PATH>Write events to this log file -
--write-build-id <PATH>Write command invocation id into this file -
--unstable-write-invocation-record <PATH>Write the invocation record (as JSON) to this path. No guarantees whatsoever are made regarding the stability of the format -
--command-report-path <PATH>Write the command report to this path. A command report is always written tobuck-out/v2/<uuid>/command_reporteven without this flag