allbuildtestrunquerystartup options
--allow_yanked_versions=<string>
Specified the module versions in the form of `<module1>@<version1>, <module2>@<version2>` that will be allowed in the resolved dependency graph even if they are declared yanked in the registry where they come from (if they are not coming from a NonRegistryOverride). Otherwise, yanked versions will cause the resolution to fail. You can also define allowed yanked version with the `BZLMOD_ALLOW_YANKED_VERSIONS` environment variable. You can disable this check by using the keyword 'all' (not recommended).
may be used multiple times
loading and_analysis
--announce_rc=<true or false>
Whether to announce rc options.
default: "false"
affects outputs
--aspect_deps=<off, conservative or precise>
How to resolve aspect dependencies when the output format is one of {xml, proto,record}. 'off' means no aspect dependencies are resolved, 'conservative' (the default) means all declared aspect dependencies are added regardless of whether they are given the rule class of direct dependencies, 'precise' means that only those aspects are added that are possibly active given the rule class of the direct dependencies. Note that precise mode requires loading other packages to evaluate a single target thus making it slower than the other modes. Also note that even precise mode is not completely precise: the decision whether to compute an aspect is decided in the analysis phase, which is not run during 'bazel query'.
default: "conservative"
build file_semantics
--attempt_to_print_relative_paths=<true or false>
When printing the location part of messages, attempt to use a path relative to the workspace directory or one of the directories specified by -- package_path.
default: "false"
terminal output
--bep_maximum_open_remote_upload_files=<integer>
Maximum number of open files allowed during BEP artifact upload.
default: "-1"
affects outputs
--bes_backend=<string>
Specifies the build event service (BES) backend endpoint in the form [SCHEME://]HOST[:PORT]. The default is to disable BES uploads. Supported schemes are grpc and grpcs (grpc with TLS enabled). If no scheme is provided, Bazel assumes grpcs.
default: ""
affects outputs
--bes_check_preceding_lifecycle_events=<true or false>
Sets the field check_preceding_lifecycle_events_present on PublishBuildToolEventStreamRequest which tells BES to check whether it previously received InvocationAttemptStarted and BuildEnqueued events matching the current tool event.
default: "false"
affects outputs
--bes_header=<'name=value' assignment>
Specify a header in NAME=VALUE form that will be included in BES requests. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.
may be used multiple times
affects outputs
--bes_instance_name=<string>
Specifies the instance name under which the BES will persist uploaded BEP. Defaults to null.
default: see description
affects outputs
--bes_keywords=<comma-separated list of options>
Specifies a list of notification keywords to be added the default set of keywords published to BES ("command_name=<command_name> ", "protocol_name=BEP"). Defaults to none.
may be used multiple times
affects outputs
--bes_lifecycle_events=<true or false>
Specifies whether to publish BES lifecycle events. (defaults to 'true').
default: "true"
affects outputs
--bes_oom_finish_upload_timeout=<An immutable length of time.>
Specifies how long bazel should wait for the BES/BEP upload to complete while OOMing. This flag ensures termination when the JVM is severely GC thrashing and cannot make progress on any user thread.
default: "10m"
bazel monitoring
--bes_outerr_buffer_size=<integer>
Specifies the maximal size of stdout or stderr to be buffered in BEP, before it is reported as a progress event. Individual writes are still reported in a single event, even if larger than the specified value up to -- bes_outerr_chunk_size.
default: "10240"
affects outputs
--bes_outerr_chunk_size=<integer>
Specifies the maximal size of stdout or stderr to be sent to BEP in a single message.
default: "1048576"
affects outputs
--bes_proxy=<string>
Connect to the Build Event Service through a proxy. Currently this flag can only be used to configure a Unix domain socket (unix:/path/to/socket).
default: see description
--bes_results_url=<string>
Specifies the base URL where a user can view the information streamed to the BES backend. Bazel will output the URL appended by the invocation id to the terminal.
default: ""
terminal output
--bes_system_keywords=<comma-separated list of options>
Specifies a list of notification keywords to be included directly, without the "user_keyword=" prefix included for keywords supplied via -- bes_keywords. Intended for Build service operators that set -- bes_lifecycle_events=false and include keywords when calling PublishLifecycleEvent. Build service operators using this flag should prevent users from overriding the flag value.
may be used multiple times
affects outputs
--bes_timeout=<An immutable length of time.>
Specifies how long bazel should wait for the BES/BEP upload to complete after the build and tests have finished. A valid timeout is a natural number followed by a unit: Days (d), hours (h), minutes (m), seconds (s), and milliseconds (ms). The default value is '0' which means that there is no timeout.
default: "0s"
affects outputs
--bes_upload_mode=<wait_for_upload_complete, nowait_for_upload_complete or fully_async>
Specifies whether the Build Event Service upload should block the build completion or should end the invocation immediately and finish the upload in the background. Either 'wait_for_upload_complete' (default), 'nowait_for_upload_complete', or 'fully_async'.
default: "wait_for_upload_complete"
eagerness to_exit
--build_event_binary_file=<string>
If non-empty, write a varint delimited binary representation of representation of the build event protocol to that file. This option implies --bes_upload_mode=wait_for_upload_complete.
default: ""
affects outputs
--build_event_binary_file_path_conversion=<true or false>
Convert paths in the binary file representation of the build event protocol to more globally valid URIs whenever possible; if disabled, the file:// uri scheme will always be used
default: "true"
affects outputs
--build_event_binary_file_upload_mode=<wait_for_upload_complete, nowait_for_upload_complete or fully_async>
Specifies whether the Build Event Service upload for -- build_event_binary_file should block the build completion or should end the invocation immediately and finish the upload in the background. Either 'wait_for_upload_complete' (default), 'nowait_for_upload_complete', or 'fully_async'.
default: "wait_for_upload_complete"
eagerness to_exit
--build_event_json_file=<string>
If non-empty, write a JSON serialisation of the build event protocol to that file. This option implies --bes_upload_mode=wait_for_upload_complete.
default: ""
affects outputs
--build_event_json_file_path_conversion=<true or false>
Convert paths in the json file representation of the build event protocol to more globally valid URIs whenever possible; if disabled, the file:// uri scheme will always be used
default: "true"
affects outputs
--build_event_json_file_upload_mode=<wait_for_upload_complete, nowait_for_upload_complete or fully_async>
Specifies whether the Build Event Service upload for -- build_event_json_file should block the build completion or should end the invocation immediately and finish the upload in the background. Either 'wait_for_upload_complete' (default), 'nowait_for_upload_complete', or 'fully_async'.
default: "wait_for_upload_complete"
eagerness to_exit
--build_event_max_named_set_of_file_entries=<integer>
The maximum number of entries for a single named_set_of_files event; values smaller than 2 are ignored and no event splitting is performed. This is intended for limiting the maximum event size in the build event protocol, although it does not directly control event size. The total event size is a function of the structure of the set as well as the file and uri lengths, which may in turn depend on the hash function.
default: "-1"
affects outputs
--build_event_publish_all_actions=<true or false>
Whether all actions should be published.
default: "false"
affects outputs
--build_event_text_file=<string>
If non-empty, write a textual representation of the build event protocol to that file
default: ""
affects outputs
--build_event_text_file_path_conversion=<true or false>
Convert paths in the text file representation of the build event protocol to more globally valid URIs whenever possible; if disabled, the file:// uri scheme will always be used
default: "true"
affects outputs
--build_event_text_file_upload_mode=<wait_for_upload_complete, nowait_for_upload_complete or fully_async>
Specifies whether the Build Event Service upload for -- build_event_text_file should block the build completion or should end the invocation immediately and finish the upload in the background. Either 'wait_for_upload_complete' (default), 'nowait_for_upload_complete', or 'fully_async'.
default: "wait_for_upload_complete"
eagerness to_exit
--build_metadata=<'name=value' assignment>
Custom key-value string pairs to supply in a build event.
may be used multiple times
terminal output
--check_bazel_compatibility=<error, warning or off>
Check bazel version compatibility of Bazel modules. Valid values are `error` to escalate it to a resolution failure, `off` to disable the check, or `warning` to print a warning when mismatch detected.
default: "error"
loading and_analysis
--check_bzl_visibility=<true or false>
If disabled, .bzl load visibility errors are demoted to warnings.
default: "true"
build file_semantics
--check_direct_dependencies=<off, warning or error>
Check if the direct `bazel_dep` dependencies declared in the root module are the same versions you get in the resolved dependency graph. Valid values are `off` to disable the check, `warning` to print a warning when mismatch detected or `error` to escalate it to a resolution failure.
default: "warning"
loading and_analysis
--color=<yes, no or auto>
Use terminal controls to colorize output.
default: "auto"
--config=<string>
Selects additional config sections from the rc files; for every <command>, it also pulls in the options from <command>:<config> if such a section exists; if this section doesn't exist in any .rc file, Blaze fails with an error. The config sections and flag combinations they are equivalent to are located in the tools/*.blazerc config files.
may be used multiple times
--consistent_labels=<true or false>
If enabled, every query command emits labels as if by the Starlark <code>str</code> function applied to a <code>Label</code> instance. This is useful for tools that need to match the output of different query commands and/or labels emitted by rules. If not enabled, output formatters are free to emit apparent repository names (relative to the main repository) instead to make the output more readable.
default: "false"
terminal output
--credential_helper=<Path to a credential helper. It may be absolute, relative to the PATH environment variable, or %workspace%-relative. The path be optionally prefixed by a scope followed by an '='. The scope is a domain name, optionally with a single leading '*' wildcard component. A helper applies to URIs matching its scope, with more specific scopes preferred. If a helper has no scope, it applies to every URI.>
Configures a credential helper conforming to the <a href="https://github.com/EngFlow/credential-helper-spec">Credential Helper Specification</a> to use for retrieving authorization credentials for repository fetching, remote caching and execution, and the build event service.Credentials supplied by a helper take precedence over credentials supplied by `--google_default_credentials`, `--google_credentials`, a `.netrc` file, or the auth parameter to `repository_ctx.download()` and `repository_ctx.download_and_extract()`.May be specified multiple times to set up multiple helpers.See https://blog.engflow.com/2023/10/09/configuring-bazels-credential-helper/ for instructions.
may be used multiple times
--credential_helper_cache_duration=<An immutable length of time.>
The default duration for which credentials supplied by a credential helper are cached if the helper does not provide when the credentials expire.
default: "30m"
--credential_helper_timeout=<An immutable length of time.>
Configures the timeout for a credential helper.Credential helpers failing to respond within this timeout will fail the invocation.
default: "10s"
--curses=<yes, no or auto>
Use terminal cursor controls to minimize scrolling output.
default: "auto"
--deleted_packages=<comma-separated list of package names>
A comma-separated list of names of packages which the build system will consider non-existent, even if they are visible somewhere on the package path.Use this option when deleting a subpackage 'x/y' of an existing package 'x'. For example, after deleting x/y/BUILD in your client, the build system may complain if it encounters a label '//x:y/z' if that is still provided by another package_path entry. Specifying --deleted_packages x/y avoids this problem.
may be used multiple times
--disk_cache=<path>
A path to a directory where Bazel can read and write actions and action outputs. If the directory does not exist, it will be created.
default: see description
--distdir=<path>
Additional places to search for archives before accessing the network to download them.
may be used multiple times
bazel internal_configuration
--enable_bzlmod=<true or false>
If true, enables the Bzlmod dependency management system, taking precedence over WORKSPACE. See https://bazel.build/docs/bzlmod for more information.
default: "true"
loading and_analysis
--enable_platform_specific_config=<true or false>
If true, Bazel picks up host-OS-specific config lines from bazelrc files. For example, if the host OS is Linux and you run bazel build, Bazel picks up lines starting with build:linux. Supported OS identifiers are linux, macos, windows, freebsd, and openbsd. Enabling this flag is equivalent to using --config=linux on Linux, --config=windows on Windows, etc.
default: "false"
--enable_workspace=<true or false>
If true, enables the legacy WORKSPACE system for external dependencies. See https://bazel.build/external/overview for more information.
default: "true"
loading and_analysis
--experimental_action_resource_set=<true or false>
If set to true, ctx.actions.run() and ctx.actions.run_shell() accept a resource_set parameter for local execution. Otherwise it will default to 250 MB for memory and 1 cpu.
default: "true"
execution
build file_semantics
experimental
--experimental_announce_profile_path=<true or false>
If enabled, adds the JSON profile path to the log.
default: "false"
bazel monitoring
--experimental_bep_target_summary=<true or false>
Whether to publish TargetSummary events.
default: "false"
--experimental_build_event_expand_filesets=<true or false>
If true, expand Filesets in the BEP when presenting output files.
default: "false"
affects outputs
--experimental_build_event_fully_resolve_fileset_symlinks=<true or false>
If true, fully resolve relative Fileset symlinks in the BEP when presenting output files. Requires --experimental_build_event_expand_filesets.
default: "false"
affects outputs
--experimental_build_event_upload_max_retries=<integer>
The maximum number of times Bazel should retry uploading a build event.
default: "4"
bazel internal_configuration
--experimental_build_event_upload_retry_minimum_delay=<An immutable length of time.>
Initial, minimum delay for exponential backoff retries when BEP upload fails. (exponent: 1.6)
default: "1s"
bazel internal_configuration
--experimental_build_event_upload_strategy=<string>
Selects how to upload artifacts referenced in the build event protocol.
default: see description
affects outputs
--experimental_bzl_visibility=<true or false>
If enabled, adds a `visibility()` function that .bzl files may call during top-level evaluation to set their visibility for the purpose of load() statements.
default: "true"
loading and_analysis
experimental
--experimental_cc_shared_library=<true or false>
If set to true, rule attributes and Starlark API methods needed for the rule cc_shared_library will be available
default: "false"
build file_semantics
loading and_analysis
experimental
--experimental_cc_static_library=<true or false>
If set to true, rule attributes and Starlark API methods needed for the rule cc_static_library will be available
default: "false"
build file_semantics
loading and_analysis
experimental
--experimental_circuit_breaker_strategy=<failure>
Specifies the strategy for the circuit breaker to use. Available strategies are "failure". On invalid value for the option the behavior same as the option is not set.
default: see description
execution
--experimental_collect_load_average_in_profiler=<true or false>
If enabled, the profiler collects the system's overall load average.
default: "true"
bazel monitoring
--experimental_collect_pressure_stall_indicators=<true or false>
If enabled, the profiler collects the Linux PSI data.
default: "false"
bazel monitoring
--experimental_collect_resource_estimation=<true or false>
If enabled, the profiler collects CPU and memory usage estimation for local actions.
default: "false"
bazel monitoring
--experimental_collect_system_network_usage=<true or false>
If enabled, the profiler collects the system's network usage.
default: "false"
bazel monitoring
--experimental_collect_worker_data_in_profiler=<true or false>
If enabled, the profiler collects worker's aggregated resource data.
default: "false"
bazel monitoring
--experimental_command_profile=<cpu, wall, alloc or lock>
Records a Java Flight Recorder profile for the duration of the command. One of the supported profiling event types (cpu, wall, alloc or lock) must be given as an argument. The profile is written to a file named after the event type under the output base directory. The syntax and semantics of this flag might change in the future to support additional profile types or output formats; use at your own risk.
default: see description
--experimental_disable_external_package=<true or false>
If set to true, the auto-generated //external package will not be available anymore. Bazel will still be unable to parse the file 'external/BUILD', but globs reaching into external/ from the unnamed package will work.
default: "false"
loading and_analysis
loses incremental_state
experimental
--experimental_disk_cache_gc_idle_delay=<An immutable length of time.>
How long the server must remain idle before a garbage collection of the disk cache occurs. To specify the garbage collection policy, set --experimental_disk_cache_gc_max_size and/or --experimental_disk_cache_gc_max_age.
default: "5m"
--experimental_disk_cache_gc_max_age=<An immutable length of time.>
If set to a positive value, the disk cache will be periodically garbage collected to remove entries older than this age. If set in conjunction with --experimental_disk_cache_gc_max_size, both criteria are applied. Garbage collection occurrs in the background once the server has become idle, as determined by the --experimental_disk_cache_gc_idle_delay flag.
default: "0"
--experimental_disk_cache_gc_max_size=<size in bytes, optionally followed by a K, M, G or T multiplier>
If set to a positive value, the disk cache will be periodically garbage collected to stay under this size. If set in conjunction with --experimental_disk_cache_gc_max_age, both criteria are applied. Garbage collection occurrs in the background once the server has become idle, as determined by the --experimental_disk_cache_gc_idle_delay flag.
default: "0"
--experimental_downloader_config=<string>
Specify a file to configure the remote downloader with. This file consists of lines, each of which starts with a directive (`allow`, `block` or `rewrite`) followed by either a host name (for `allow` and `block`) or two patterns, one to match against, and one to use as a substitute URL, with back-references starting from `$1`. It is possible for multiple `rewrite` directives for the same URL to be give, and in this case multiple URLs will be returned.
default: see description
--experimental_enable_android_migration_apis=<true or false>
If set to true, enables the APIs required to support the Android Starlark migration.
default: "false"
build file_semantics
--experimental_enable_scl_dialect=<true or false>
If set to true, .scl files may be used in load() statements.
default: "false"
build file_semantics
--experimental_explicit_aspects=<true or false>
aquery, cquery: whether to include aspect-generated actions in the output. query: no-op (aspects are always followed).
default: "false"
terminal output
--experimental_google_legacy_api=<true or false>
If set to true, exposes a number of experimental pieces of Starlark build API pertaining to Google legacy code.
default: "false"
loading and_analysis
experimental
--experimental_graphless_query=<tri-state (auto, yes, no)>
If true, uses a Query implementation that does not make a copy of the graph. The new implementation only supports --order_output=no, as well as only a subset of output formatters.
default: "auto"
build file_semantics
eagerness to_exit
--experimental_guard_against_concurrent_changes=<true or false>
Turn this off to disable checking the ctime of input files of an action before uploading it to a remote cache. There may be cases where the Linux kernel delays writing of files, which could cause false positives.
default: "false"
--experimental_isolated_extension_usages=<true or false>
If true, enables the <code>isolate</code> parameter in the <a href="https: //bazel.build/rules/lib/globals/module#use_extension" ><code>use_extension</code></a> function.
default: "false"
loading and_analysis
--experimental_java_library_export=<true or false>
If enabled, experimental_java_library_export_do_not_use module is available.
default: "false"
loading and_analysis
incompatible change
--experimental_platforms_api=<true or false>
If set to true, enables a number of platform-related Starlark APIs useful for debugging.
default: "false"
loading and_analysis
experimental
--experimental_profile_additional_tasks=<phase, action, action_check, action_lock, action_release, action_update, action_complete, bzlmod, info, create_package, remote_execution, local_execution, scanner, local_parse, upload_time, remote_process_time, remote_queue, remote_setup, fetch, local_process_time, vfs_stat, vfs_dir, vfs_readlink, vfs_md5, vfs_xattr, vfs_delete, vfs_open, vfs_read, vfs_write, vfs_glob, vfs_vmfs_stat, vfs_vmfs_dir, vfs_vmfs_read, wait, thread_name, thread_sort_index, skyframe_eval, skyfunction, critical_path, critical_path_component, handle_gc_notification, action_counts, action_cache_counts, local_cpu_usage, system_cpu_usage, cpu_usage_estimation, local_memory_usage, system_memory_usage, memory_usage_estimation, system_network_up_usage, system_network_down_usage, workers_memory_usage, system_load_average, starlark_parser, starlark_user_fn, starlark_builtin_fn, starlark_user_compiled_fn, starlark_repository_fn, action_fs_staging, remote_cache_check, remote_download, remote_network, filesystem_traversal, worker_execution, worker_setup, worker_borrow, worker_working, worker_copying_outputs, credential_helper, pressure_stall_io, pressure_stall_memory, conflict_check, dynamic_lock, repository_fetch, repository_vendor or unknown>
Specifies additional profile tasks to be included in the profile.
may be used multiple times
bazel monitoring
--experimental_profile_include_primary_output=<true or false>
Includes the extra "out" attribute in action events that contains the exec path to the action's primary output.
default: "false"
bazel monitoring
--experimental_profile_include_target_label=<true or false>
Includes target label in action events' JSON profile data.
default: "false"
bazel monitoring
--experimental_record_metrics_for_all_mnemonics=<true or false>
By default the number of action types is limited to the 20 mnemonics with the largest number of executed actions. Setting this option will write statistics for all mnemonics.
default: "false"
--experimental_remote_cache_async=<true or false>
If true, remote cache I/O will happen in the background instead of taking place as the part of a spawn.
default: "false"
--experimental_remote_cache_compression_threshold=<integer>
The minimum blob size required to compress/decompress with zstd. Ineffectual unless --remote_cache_compression is set.
default: "0"
--experimental_remote_cache_lease_extension=<true or false>
If set to true, Bazel will extend the lease for outputs of remote actions during the build by sending `FindMissingBlobs` calls periodically to remote cache. The frequency is based on the value of `--experimental_remote_cache_ttl`.
default: "false"
--experimental_remote_cache_ttl=<An immutable length of time.>
The guaranteed minimal TTL of blobs in the remote cache after their digests are recently referenced e.g. by an ActionResult or FindMissingBlobs. Bazel does several optimizations based on the blobs' TTL e.g. doesn't repeatedly call GetActionResult in an incremental build. The value should be set slightly less than the real TTL since there is a gap between when the server returns the digests and when Bazel receives them.
default: "3h"
execution
--experimental_remote_capture_corrupted_outputs=<path>
A path to a directory where the corrupted outputs will be captured to.
default: see description
--experimental_remote_discard_merkle_trees=<true or false>
If set to true, discard in-memory copies of the input root's Merkle tree and associated input mappings during calls to GetActionResult() and Execute(). This reduces memory usage significantly, but does require Bazel to recompute them upon remote cache misses and retries.
default: "false"
--experimental_remote_downloader=<string>
A Remote Asset API endpoint URI, to be used as a remote download proxy. The supported schemas are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no schema is provided Bazel will default to grpcs. See: https://github.com/bazelbuild/remote-apis/blob/master/build/bazel/remote/asset/v1/remote_asset.proto
default: see description
--experimental_remote_downloader_local_fallback=<true or false>
Whether to fall back to the local downloader if remote downloader fails.
default: "false"
--experimental_remote_execution_keepalive=<true or false>
Whether to use keepalive for remote execution calls.
default: "false"
--experimental_remote_failure_rate_threshold=<integer in 0-100 range>
Sets the allowed number of failure rate in percentage for a specific time window after which it stops calling to the remote cache/executor. By default the value is 10. Setting this to 0 means no limitation.
default: "10"
execution
--experimental_remote_failure_window_interval=<An immutable length of time.>
The interval in which the failure rate of the remote requests are computed. On zero or negative value the failure duration is computed the whole duration of the execution.Following units can be used: Days (d), hours (h), minutes (m), seconds (s), and milliseconds (ms). If the unit is omitted, the value is interpreted as seconds.
default: "60s"
execution
--experimental_remote_mark_tool_inputs=<true or false>
If set to true, Bazel will mark inputs as tool inputs for the remote executor. This can be used to implement remote persistent workers.
default: "false"
--experimental_remote_merkle_tree_cache=<true or false>
If set to true, Merkle tree calculations will be memoized to improve the remote cache hit checking speed. The memory foot print of the cache is controlled by --experimental_remote_merkle_tree_cache_size.
default: "false"
--experimental_remote_merkle_tree_cache_size=<long integer>
The number of Merkle trees to memoize to improve the remote cache hit checking speed. Even though the cache is automatically pruned according to Java's handling of soft references, out-of-memory errors can occur if set too high. If set to 0 the cache size is unlimited. Optimal value varies depending on project's size. Default to 1000.
default: "1000"
--experimental_remote_output_service=<string>
HOST or HOST:PORT of a remote output service endpoint. The supported schemas are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no schema is provided Bazel will default to grpcs. Specify grpc:// or unix: schema to disable TLS.
default: see description
--experimental_remote_output_service_output_path_prefix=<string>
The path under which the contents of output directories managed by the --experimental_remote_output_service are placed. The actual output directory used by a build will be a descendant of this path and determined by the output service.
default: ""
--experimental_remote_require_cached=<true or false>
If set to true, enforce that all actions that can run remotely are cached, or else fail the build. This is useful to troubleshoot non-determinism issues as it allows checking whether actions that should be cached are actually cached without spuriously injecting new results into the cache.
default: "false"
--experimental_remote_scrubbing_config=<Converts to a Scrubber>
Enables remote cache key scrubbing with the supplied configuration file, which must be a protocol buffer in text format (see src/main/protobuf/remote_scrubbing.proto).This feature is intended to facilitate sharing a remote/disk cache between actions executing on different platforms but targeting the same platform. It should be used with extreme care, as improper settings may cause accidental sharing of cache entries and result in incorrect builds.Scrubbing does not affect how an action is executed, only how its remote/disk cache key is computed for the purpose of retrieving or storing an action result. Scrubbed actions are incompatible with remote execution, and will always be executed locally instead.Modifying the scrubbing configuration does not invalidate outputs present in the local filesystem or internal caches; a clean build is required to reexecute affected actions.In order to successfully use this feature, you likely want to set a custom --host_platform together with --experimental_platform_in_output_dir (to normalize output prefixes) and --incompatible_strict_action_env (to normalize environment variables).
default: see description
--experimental_repo_remote_exec=<true or false>
If set to true, repository_rule gains some remote execution capabilities.
default: "false"
build file_semantics
loading and_analysis
experimental
--experimental_repository_cache_hardlinks=<true or false>
If set, the repository cache will hardlink the file in case of a cache hit, rather than copying. This is intended to save disk space.
default: "false"
bazel internal_configuration
--experimental_repository_downloader_retries=<integer>
The maximum number of attempts to retry a download error. If set to 0, retries are disabled.
default: "0"
experimental
--experimental_repository_resolved_file=<string>
If non-empty, write a Starlark value with the resolved information of all Starlark repository rules that were executed.
default: ""
affects outputs
--experimental_resolved_file_instead_of_workspace=<string>
If non-empty read the specified resolved file instead of the WORKSPACE file
default: ""
changes inputs
--experimental_rule_extension_api=<true or false>
Enable experimental rule extension API and subrule APIs
default: "false"
loading and_analysis
experimental
--experimental_run_bep_event_include_residue=<true or false>
Whether to include the command-line residue in run build events which could contain the residue. By default, the residue is not included in run command build events that could contain the residue.
default: "false"
affects outputs
--experimental_scale_timeouts=<double>
Scale all timeouts in Starlark repository rules by this factor. In this way, external repositories can be made working on machines that are slower than the rule author expected, without changing the source code
default: "1.0"
bazel internal_configuration
experimental
--experimental_sibling_repository_layout=<true or false>
If set to true, non-main repositories are planted as symlinks to the main repository in the execution root. That is, all repositories are direct children of the $output_base/execution_root directory. This has the side effect of freeing up $output_base/execution_root/__main__/external for the real top-level 'external' directory.
default: "false"
action command_lines
bazel internal_configuration
loading and_analysis
loses incremental_state
experimental
--experimental_stream_log_file_uploads=<true or false>
Stream log file uploads directly to the remote storage rather than writing them to disk.
default: "false"
affects outputs
--experimental_ui_max_stdouterr_bytes=<integer in (-1)-1073741819 range>
The maximum size of the stdout / stderr files that will be printed to the console. -1 implies no limit.
default: "1048576"
execution
--experimental_windows_watchfs=<true or false>
If true, experimental Windows support for --watchfs is enabled. Otherwise --watchfsis a non-op on Windows. Make sure to also enable --watchfs.
default: "false"
--experimental_worker_for_repo_fetching=<off, platform, virtual or auto>
The threading mode to use for repo fetching. If set to 'off', no worker thread is used, and the repo fetching is subject to restarts. Otherwise, uses a virtual worker thread.
default: "auto"
--experimental_workspace_rules_log_file=<path>
Log certain Workspace Rules events into this file as delimited WorkspaceEvent protos.
default: see description
--fetch=<true or false>
Allows the command to fetch external dependencies. If set to false, the command will utilize any cached version of the dependency, and if none exists, the command will result in failure.
default: "true"
--gc_thrashing_limits=<comma separated pairs of <period>:<count>>
Limits which, if reached, cause GcThrashingDetector to crash Bazel with an OOM. Each limit is specified as <period>:<count> where period is a duration and count is a positive integer. If more than --gc_thrashing_threshold percent of tenured space (old gen heap) remains occupied after <count> consecutive full GCs within <period>, an OOM is triggered. Multiple limits can be specified separated by commas.
default: "1s:2,20s:3,1m:5"
host machine_resource_optimizations
--gc_thrashing_threshold=<integer in 0-100 range>
The percent of tenured space occupied (0-100) above which GcThrashingDetector considers memory pressure events against its limits (-- gc_thrashing_limits). If set to 100, GcThrashingDetector is disabled.
default: "100"
host machine_resource_optimizations
--generate_json_trace_profile=<tri-state (auto, yes, no)>
If enabled, Bazel profiles the build and writes a JSON-format profile into a file in the output base. View profile by loading into chrome://tracing. By default Bazel writes the profile for all build-like commands and query.
default: "auto"
bazel monitoring
--google_auth_scopes=<comma-separated list of options>
A comma-separated list of Google Cloud authentication scopes.
default: "https://www.googleapis.com/auth/cloud-platform"
--google_credentials=<string>
Specifies the file to get authentication credentials from. See https://cloud.google.com/docs/authentication for details.
default: see description
--google_default_credentials=<true or false>
Whether to use 'Google Application Default Credentials' for authentication. See https://cloud.google.com/docs/authentication for details. Disabled by default.
default: "false"
--graph:conditional_edges_limit=<integer>
The maximum number of condition labels to show. -1 means no truncation and 0 means no annotation. This option is only applicable to --output=graph.
default: "4"
terminal output
--graph:factored=<true or false>
If true, then the graph will be emitted 'factored', i.e. topologically- equivalent nodes will be merged together and their labels concatenated. This option is only applicable to --output=graph.
default: "true"
terminal output
--graph:node_limit=<integer>
The maximum length of the label string for a graph node in the output. Longer labels will be truncated; -1 means no truncation. This option is only applicable to --output=graph.
default: "512"
terminal output
--grpc_keepalive_time=<An immutable length of time.>
Configures keep-alive pings for outgoing gRPC connections. If this is set, then Bazel sends pings after this much time of no read operations on the connection, but only if there is at least one pending gRPC call. Times are treated as second granularity; it is an error to set a value less than one second. By default, keep-alive pings are disabled. You should coordinate with the service owner before enabling this setting. For example to set a value of 30 seconds to this flag, it should be done as this --grpc_keepalive_time=30s
default: see description
--grpc_keepalive_timeout=<An immutable length of time.>
Configures a keep-alive timeout for outgoing gRPC connections. If keep-alive pings are enabled with --grpc_keepalive_time, then Bazel times out a connection if it does not receive a ping reply after this much time. Times are treated as second granularity; it is an error to set a value less than one second. If keep-alive pings are disabled, then this setting is ignored.
default: "20s"
--heap_dump_on_oom=<true or false>
Whether to manually output a heap dump if an OOM is thrown (including manual OOMs due to reaching --gc_thrashing_limits). The dump will be written to <output_base>/<invocation_id>.heapdump.hprof. This option effectively replaces -XX:+HeapDumpOnOutOfMemoryError, which has no effect for manual OOMs.
default: "false"
bazel monitoring
--heuristically_drop_nodes=<true or false>
If true, Blaze will remove FileState and DirectoryListingState nodes after related File and DirectoryListing node is done to save memory. We expect that it is less likely that these nodes will be needed again. If so, the program will re-evaluate them.
default: "false"
loses incremental_state
--http_connector_attempts=<integer>
The maximum number of attempts for http downloads.
default: "8"
bazel internal_configuration
--http_connector_retry_max_timeout=<An immutable length of time.>
The maximum timeout for http download retries. With a value of 0, no timeout maximum is defined.
default: "0s"
bazel internal_configuration
--http_max_parallel_downloads=<integer>
The maximum number parallel http downloads.
default: "8"
bazel internal_configuration
--http_timeout_scaling=<double>
Scale all timeouts related to http downloads by the given factor
default: "1.0"
bazel internal_configuration
--ignore_dev_dependency=<true or false>
If true, Bazel ignores `bazel_dep` and `use_extension` declared as `dev_dependency` in the MODULE.bazel of the root module. Note that, those dev dependencies are always ignored in the MODULE.bazel if it's not the root module regardless of the value of this flag.
default: "false"
loading and_analysis
--implicit_deps=<true or false>
If enabled, implicit dependencies will be included in the dependency graph over which the query operates. An implicit dependency is one that is not explicitly specified in the BUILD file but added by bazel. For cquery, this option controls filtering resolved toolchains.
default: "true"
build file_semantics
--include_aspects=<true or false>
aquery, cquery: whether to include aspect-generated actions in the output. query: no-op (aspects are always followed).
default: "true"
terminal output
--incompatible_allow_tags_propagation=<true or false>
If set to true, tags will be propagated from a target to the actions' execution requirements; otherwise tags are not propagated. See https: //github.com/bazelbuild/bazel/issues/8830 for details.
default: "true"
build file_semantics
experimental
--incompatible_always_check_depset_elements=<true or false>
Check the validity of elements added to depsets, in all constructors. Elements must be immutable, but historically the depset(direct=...) constructor forgot to check. Use tuples instead of lists in depset elements. See https://github.com/bazelbuild/bazel/issues/10313 for details.
default: "true"
build file_semantics
incompatible change
--incompatible_autoload_externally=<comma-separated set of options>
A comma-separated list of rules (or other symbols) that were previously part of Bazel and which are now to be retrieved from their respective external repositories. This flag is intended to be used to facilitate migration of rules out of Bazel. See also https://github. com/bazelbuild/bazel/issues/23043. A symbol that is autoloaded within a file behaves as if its built-into- Bazel definition were replaced by its canonical new definition in an external repository. For a BUILD file, this essentially means implicitly adding a load() statement. For a .bzl file, it's either a load() statement or a change to a field of the `native` object, depending on whether the autoloaded symbol is a rule. Bazel maintains a hardcoded list of all symbols that may be autoloaded; only those symbols may appear in this flag. For each symbol, Bazel knows the new definition location in an external repository, as well as a set of special-cased repositories that must not autoload it to avoid creating cycles. A list item of "+foo" in this flag causes symbol foo to be autoloaded, except in foo's exempt repositories, within which the Bazel-defined version of foo is still available. A list item of "foo" triggers autoloading as above, but the Bazel-defined version of foo is not made available to the excluded repositories. This ensures that foo's external repository does not depend on the old Bazel implementation of foo A list item of "-foo" does not trigger any autoloading, but makes the Bazel- defined version of foo inaccessible throughout the workspace. This is used to validate that the workspace is ready for foo's definition to be deleted from Bazel. If a symbol is not named in this flag then it continues to work as normal -- no autoloading is done, nor is the Bazel-defined version suppressed. For configuration see https://github. com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/packages/AutoloadSymbols. java As a shortcut also whole repository may be used, for example +@rules_python will autoload all Python rules.
default: ""
loses incremental_state
build file_semantics
incompatible change
--incompatible_config_setting_private_default_visibility=<true or false>
If incompatible_enforce_config_setting_visibility=false, this is a noop. Else, if this flag is false, any config_setting without an explicit visibility attribute is //visibility:public. If this flag is true, config_setting follows the same visibility logic as all other rules. See https://github.com/bazelbuild/bazel/issues/12933.
default: "false"
loading and_analysis
incompatible change
--incompatible_depset_for_java_output_source_jars=<true or false>
When true, Bazel no longer returns a list from java_info.java_output[0]. source_jars but returns a depset instead.
default: "true"
loading and_analysis
incompatible change
--incompatible_depset_for_libraries_to_link_getter=<true or false>
When true, Bazel no longer returns a list from linking_context. libraries_to_link but returns a depset instead.
default: "true"
loading and_analysis
incompatible change
--incompatible_disable_native_repo_rules=<true or false>
If false, native repo rules can be used in WORKSPACE; otherwise, Starlark repo rules must be used instead. Native repo rules include local_repository, new_local_repository, local_config_platform, android_sdk_repository, and android_ndk_repository.
default: "false"
bazel internal_configuration
--incompatible_disable_non_executable_java_binary=<true or false>
If true, java_binary is always executable. create_executable attribute is removed.
default: "false"
loading and_analysis
incompatible change
--incompatible_disable_objc_library_transition=<true or false>
Disable objc_library's custom transition and inherit from the top level target instead
default: "true"
build file_semantics
incompatible change
--incompatible_disable_starlark_host_transitions=<true or false>
If set to true, rule attributes cannot set 'cfg = "host"'. Rules should set 'cfg = "exec"' instead.
default: "false"
loading and_analysis
incompatible change
--incompatible_disable_target_provider_fields=<true or false>
If set to true, disable the ability to access providers on 'target' objects via field syntax. Use provider-key syntax instead. For example, instead of using `ctx.attr.dep.my_info` to access `my_info` from inside a rule implementation function, use `ctx.attr.dep[MyInfo]`. See https://github. com/bazelbuild/bazel/issues/9014 for details.
default: "false"
build file_semantics
incompatible change
--incompatible_disallow_empty_glob=<true or false>
If set to true, the default value of the `allow_empty` argument of glob() is False.
default: "false"
build file_semantics
incompatible change
--incompatible_disallow_struct_provider_syntax=<true or false>
If set to true, rule implementation functions may not return a struct. They must instead return a list of provider instances.
default: "false"
build file_semantics
incompatible change
--incompatible_disallow_symlink_file_to_dir=<true or false>
No-op.
default: "true"
loading and_analysis
incompatible change
--incompatible_do_not_split_linking_cmdline=<true or false>
When true, Bazel no longer modifies command line flags used for linking, and also doesn't selectively decide which flags go to the param file and which don't. See https://github.com/bazelbuild/bazel/issues/7670 for details.
default: "true"
loading and_analysis
incompatible change
--incompatible_enable_deprecated_label_apis=<true or false>
If enabled, certain deprecated APIs (native.repository_name, Label. workspace_name, Label.relative) can be used.
default: "true"
loading and_analysis
--incompatible_enable_proto_toolchain_resolution=<true or false>
If true, proto lang rules define toolchains from rules_proto, rules_java, rules_cc repositories.
default: "false"
loading and_analysis
incompatible change
--incompatible_enforce_config_setting_visibility=<true or false>
If true, enforce config_setting visibility restrictions. If false, every config_setting is visible to every target. See https://github. com/bazelbuild/bazel/issues/12932.
default: "true"
loading and_analysis
incompatible change
--incompatible_existing_rules_immutable_view=<true or false>
If set to true, native.existing_rule and native.existing_rules return lightweight immutable view objects instead of mutable dicts.
default: "true"
build file_semantics
loading and_analysis
incompatible change
--incompatible_fail_on_unknown_attributes=<true or false>
If enabled, targets that have unknown attributes set to None fail.
default: "true"
loading and_analysis
incompatible change
--incompatible_fix_package_group_reporoot_syntax=<true or false>
In package_group's `packages` attribute, changes the meaning of the value "//..." to refer to all packages in the current repository instead of all packages in any repository. You can use the special value "public" in place of "//..." to obtain the old behavior. This flag requires that -- incompatible_package_group_has_public_syntax also be enabled.
default: "true"
build file_semantics
incompatible change
--incompatible_java_common_parameters=<true or false>
If set to true, the output_jar, and host_javabase parameters in pack_sources and host_javabase in compile will all be removed.
default: "true"
build file_semantics
incompatible change
--incompatible_lexicographical_output=<true or false>
If this option is set, sorts --order_output=auto output in lexicographical order.
default: "true"
terminal output
incompatible change
--incompatible_merge_fixed_and_default_shell_env=<true or false>
If enabled, actions registered with ctx.actions.run and ctx.actions. run_shell with both 'env' and 'use_default_shell_env = True' specified will use an environment obtained from the default shell environment by overriding with the values passed in to 'env'. If disabled, the value of 'env' is completely ignored in this case.
default: "true"
loading and_analysis
incompatible change
--incompatible_new_actions_api=<true or false>
If set to true, the API to create actions is only available on `ctx. actions`, not on `ctx`.
default: "true"
build file_semantics
incompatible change
--incompatible_no_attr_license=<true or false>
If set to true, disables the function `attr.license`.
default: "true"
build file_semantics
incompatible change
--incompatible_no_implicit_file_export=<true or false>
If set, (used) source files are are package private unless exported explicitly. See https://github. com/bazelbuild/proposals/blob/master/designs/2019-10-24-file-visibility.md
default: "false"
build file_semantics
incompatible change
--incompatible_no_implicit_watch_label=<true or false>
If true, then methods on <code>repository_ctx</code> that are passed a Label will no longer automatically watch the file under that label for changes even if <code>watch = "no"</code>, and <code>repository_ctx. path</code> no longer causes the returned path to be watched. Use <code>repository_ctx.watch</code> instead.
default: "false"
loading and_analysis
incompatible change
--incompatible_no_rule_outputs_param=<true or false>
If set to true, disables the `outputs` parameter of the `rule()` Starlark function.
default: "false"
build file_semantics
incompatible change
--incompatible_objc_provider_remove_linking_info=<true or false>
If set to true, the ObjcProvider's APIs for linking info will be removed.
default: "false"
build file_semantics
incompatible change
--incompatible_package_group_has_public_syntax=<true or false>
In package_group's `packages` attribute, allows writing "public" or "private" to refer to all packages or no packages respectively.
default: "true"
build file_semantics
incompatible change
--incompatible_package_group_includes_double_slash=<true or false>
If enabled, when outputting package_group's `packages` attribute, the leading `//` will not be omitted.
default: "true"
terminal output
incompatible change
--incompatible_remote_build_event_upload_respect_no_cache=<true or false>
Deprecated. No-op. Use --remote_build_event_upload=minimal instead.
default: "false"
--incompatible_remote_dangling_symlinks=<true or false>
If set to true, symlinks uploaded to a remote or disk cache are allowed to dangle.
default: "true"
execution
incompatible change
--incompatible_remote_downloader_send_all_headers=<true or false>
Whether to send all values of a multi-valued header to the remote downloader instead of just the first.
default: "true"
incompatible change
--incompatible_remote_output_paths_relative_to_input_root=<true or false>
If set to true, output paths are relative to input root instead of working directory.
default: "false"
incompatible change
--incompatible_remote_results_ignore_disk=<true or false>
No-op
default: "true"
incompatible change
--incompatible_remote_symlinks=<true or false>
If set to true, Bazel will always upload symlinks as such to a remote or disk cache. Otherwise, non-dangling relative symlinks (and only those) will be uploaded as the file or directory they point to.
default: "true"
execution
incompatible change
--incompatible_require_linker_input_cc_api=<true or false>
If set to true, rule create_linking_context will require linker_inputs instead of libraries_to_link. The old getters of linking_context will also be disabled and just linker_inputs will be available.
default: "true"
build file_semantics
loading and_analysis
incompatible change
--incompatible_run_shell_command_string=<true or false>
If set to true, the command parameter of actions.run_shell will only accept string
default: "true"
build file_semantics
incompatible change
--incompatible_stop_exporting_language_modules=<true or false>
If enabled, certain language-specific modules (such as `cc_common`) are unavailable in user .bzl files and may only be called from their respective rules repositories.
default: "false"
loading and_analysis
incompatible change
--incompatible_struct_has_no_methods=<true or false>
Disables the to_json and to_proto methods of struct, which pollute the struct field namespace. Instead, use json.encode or json.encode_indent for JSON, or proto.encode_text for textproto.
default: "false"
build file_semantics
incompatible change
--incompatible_top_level_aspects_require_providers=<true or false>
If set to true, the top level aspect will honor its required providers and only run on top level targets whose rules' advertised providers satisfy the required providers of the aspect.
default: "false"
loading and_analysis
incompatible change
--incompatible_unambiguous_label_stringification=<true or false>
When true, Bazel will stringify the label @//foo:bar to @//foo:bar, instead of //foo:bar. This only affects the behavior of str(), the % operator, and so on; the behavior of repr() is unchanged. See https://github. com/bazelbuild/bazel/issues/15916 for more information.
default: "true"
loading and_analysis
incompatible change
--incompatible_use_cc_configure_from_rules_cc=<true or false>
When true, Bazel will no longer allow using cc_configure from @bazel_tools. Please see https://github.com/bazelbuild/bazel/issues/10134 for details and migration instructions.
default: "false"
loading and_analysis
incompatible change
--incompatible_use_plus_in_repo_names=<true or false>
If true, uses the plus sign (+) as the separator in canonical repo names, instead of the tilde (~). This is to address severe performance issues on Windows; see https://github.com/bazelbuild/bazel/issues/22865 for more information.
default: "false"
loading and_analysis
--incompatible_visibility_private_attributes_at_definition=<true or false>
If set to true, the visibility of private rule attributes is checked with respect to the rule definition, falling back to rule usage if not visible.
default: "true"
build file_semantics
incompatible change
--infer_universe_scope=<true or false>
If set and --universe_scope is unset, then a value of --universe_scope will be inferred as the list of unique target patterns in the query expression. Note that the --universe_scope value inferred for a query expression that uses universe-scoped functions (e.g.`allrdeps`) may not be what you want, so you should use this option only if you know what you are doing. See https://bazel.build/reference/query#sky-query for details and examples. If --universe_scope is set, then this option's value is ignored. Note: this option applies only to `query` (i.e. not `cquery`).
default: "false"
loading and_analysis
--invocation_id=<UUID>
Unique identifier, in UUID format, for the command being run. If explicitly specified uniqueness must be ensured by the caller. The UUID is printed to stderr, the BEP and remote execution protocol.
default: ""
bazel monitoring
bazel internal_configuration
--keep_going=<true or false>
Continue as much as possible after an error. While the target that failed and those that depend on it cannot be analyzed, other prerequisites of these targets can be.
default: "false"
eagerness to_exit
--keep_state_after_build=<true or false>
If false, Blaze will discard the inmemory state from this build when the build finishes. Subsequent builds will not have any incrementality with respect to this one.
default: "true"
loses incremental_state
--legacy_important_outputs=<true or false>
Use this to suppress generation of the legacy important_outputs field in the TargetComplete event. important_outputs are required for Bazel to ResultStore integration.
default: "true"
affects outputs
--line_terminator_null=<true or false>
Whether each format is terminated with \0 instead of newline.
default: "false"
terminal output
--loading_phase_threads=<integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5">
Number of parallel threads to use for the loading/analysis phase.Takes an integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5". "auto" sets a reasonable default based on host resources. Must be at least 1.
default: "auto"
bazel internal_configuration
--lockfile_mode=<off, update, refresh or error>
Specifies how and whether or not to use the lockfile. Valid values are `update` to use the lockfile and update it if there are changes, `refresh` to additionally refresh mutable information (yanked versions and previously missing modules) from remote registries from time to time, `error` to use the lockfile but throw an error if it's not up-to-date, or `off` to neither read from or write to the lockfile.
default: "update"
loading and_analysis
--logging=<0 <= an integer <= 6>
The logging level.
default: "3"
affects outputs
--max_computation_steps=<long integer>
The maximum number of Starlark computation steps that may be executed by a BUILD file (zero means no limit).
default: "0"
build file_semantics
--memory_profile=<path>
If set, write memory usage data to the specified file at phase ends and stable heap to master log at end of build.
default: see description
bazel monitoring
--memory_profile_stable_heap_parameters=<integers, separated by a comma expected in pairs>
Tune memory profile's computation of stable heap at end of build. Should be and even number of integers separated by commas. In each pair the first integer is the number of GCs to perform. The second integer in each pair is the number of seconds to wait between GCs. Ex: 2,4,4,0 would 2 GCs with a 4sec pause, followed by 4 GCs with zero second pause
default: "1,0"
bazel monitoring
--nested_set_depth_limit=<integer>
The maximum depth of the graph internal to a depset (also known as NestedSet), above which the depset() constructor will fail.
default: "3500"
loading and_analysis
--nodep_deps=<true or false>
If enabled, deps from "nodep" attributes will be included in the dependency graph over which the query operates. A common example of a "nodep" attribute is "visibility". Run and parse the output of `info build- language` to learn about all the "nodep" attributes in the build language.
default: "true"
build file_semantics
--noorder_results
Output the results in dependency-ordered (default) or unordered fashion. The unordered output is faster but only supported when --output is not minrank, maxrank, or graph. Expands to: --order_output=no
terminal output
--null
Whether each format is terminated with \0 instead of newline. Expands to: --line_terminator_null=true
terminal output
--order_output=<no, deps, auto or full>
Output the results unordered (no), dependency-ordered (deps), or fully ordered (full). The default is 'auto', meaning that results are output either dependency-ordered or fully ordered, depending on the output formatter (dependency-ordered for proto, minrank, maxrank, and graph, fully ordered for all others). When output is fully ordered, nodes are printed in a fully deterministic (total) order. First, all nodes are sorted alphabetically. Then, each node in the list is used as the start of a post- order depth-first search in which outgoing edges to unvisited nodes are traversed in alphabetical order of the successor nodes. Finally, nodes are printed in the reverse of the order in which they were visited.
default: "auto"
terminal output
--order_results
Output the results in dependency-ordered (default) or unordered fashion. The unordered output is faster but only supported when --output is not minrank, maxrank, or graph. Expands to: --order_output=auto
terminal output
--output=<string>
The format in which the query results should be printed. Allowed values for query are: build, graph, streamed_jsonproto, label, label_kind, location, maxrank, minrank, package, proto, streamed_proto, textproto, xml.
default: "label"
terminal output
--override_module=<equals-separated mapping of module name to path>
Override a module with a local path in the form of <module name>=<path>. If the given path is an absolute path, it will be used as it is. If the given path is a relative path, it is relative to the current working directory. If the given path starts with '%workspace%, it is relative to the workspace root, which is the output of `bazel info workspace`. If the given path is empty, then remove any previous overrides.
may be used multiple times
--override_repository=<equals-separated mapping of repository name to path>
Override a repository with a local path in the form of <repository name>=<path>. If the given path is an absolute path, it will be used as it is. If the given path is a relative path, it is relative to the current working directory. If the given path starts with '%workspace%, it is relative to the workspace root, which is the output of `bazel info workspace`. If the given path is empty, then remove any previous overrides.
may be used multiple times
--package_path=<colon-separated list of options>
A colon-separated list of where to look for packages. Elements beginning with '%workspace%' are relative to the enclosing workspace. If omitted or empty, the default is the output of 'bazel info default-package-path'.
default: "%workspace%"
--profile=<path>
If set, profile Bazel and write data to the specified file. Use bazel analyze-profile to analyze the profile.
default: see description
bazel monitoring
--progress_in_terminal_title=<true or false>
Show the command progress in the terminal title. Useful to see what bazel is doing when having multiple terminal tabs.
default: "false"
--proto:default_values=<true or false>
If true, attributes whose value is not explicitly specified in the BUILD file are included; otherwise they are omitted. This option is applicable to --output=proto
default: "true"
terminal output
--proto:definition_stack=<true or false>
Populate the definition_stack proto field, which records for each rule instance the Starlark call stack at the moment the rule's class was defined.
default: "false"
terminal output
--proto:flatten_selects=<true or false>
If enabled, configurable attributes created by select() are flattened. For list types the flattened representation is a list containing each value of the select map exactly once. Scalar types are flattened to null.
default: "true"
build file_semantics
--proto:include_attribute_source_aspects=<true or false>
Populate the source_aspect_name proto field of each Attribute with the source aspect that the attribute came from (empty string if it did not).
default: "false"
terminal output
--proto:include_synthetic_attribute_hash=<true or false>
Whether or not to calculate and populate the $internal_attr_hash attribute.
default: "false"
terminal output
--proto:instantiation_stack=<true or false>
Populate the instantiation call stack of each rule. Note that this requires the stack to be present
default: "false"
terminal output
--proto:locations=<true or false>
Whether to output location information in proto output at all.
default: "true"
terminal output
--proto:output_rule_attrs=<comma-separated list of options>
Comma separated list of attributes to include in output. Defaults to all attributes. Set to empty string to not output any attribute. This option is applicable to --output=proto.
default: "all"
terminal output
--proto:rule_inputs_and_outputs=<true or false>
Whether or not to populate the rule_input and rule_output fields.
default: "true"
terminal output
--query_file=<string>
If set, query will read the query from the file named here, rather than on the command line. It is an error to specify a file here as well as a command-line query.
default: ""
changes inputs
--record_full_profiler_data=<true or false>
By default, Bazel profiler will record only aggregated data for fast but numerous events (such as statting the file). If this option is enabled, profiler will record each event - resulting in more precise profiling data but LARGE performance hit. Option only has effect if --profile used as well.
default: "false"
bazel monitoring
--registry=<string>
Specifies the registries to use to locate Bazel module dependencies. The order is important: modules will be looked up in earlier registries first, and only fall back to later registries when they're missing from the earlier ones.
may be used multiple times
changes inputs
--relative_locations=<true or false>
If true, the location of BUILD files in xml and proto outputs will be relative. By default, the location output is an absolute path and will not be consistent across machines. You can set this option to true to have a consistent result across machines.
default: "false"
terminal output
--remote_accept_cached=<true or false>
Whether to accept remotely cached action results.
default: "true"
--remote_build_event_upload=<all or minimal>
If set to 'all', all local outputs referenced by BEP are uploaded to remote cache.If set to 'minimal', local outputs referenced by BEP are not uploaded to the remote cache, except for files that are important to the consumers of BEP (e.g. test logs and timing profile). bytestream:// scheme is always used for the uri of files even if they are missing from remote cache.Default to 'minimal'.
default: "minimal"
--remote_bytestream_uri_prefix=<string>
The hostname and instance name to be used in bytestream:// URIs that are written into build event streams. This option can be set when builds are performed using a proxy, which causes the values of --remote_executor and --remote_instance_name to no longer correspond to the canonical name of the remote execution service. When not set, it will default to "${hostname}/${instance_name}".
default: see description
--remote_cache=<string>
A URI of a caching endpoint. The supported schemas are http, https, grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no schema is provided Bazel will default to grpcs. Specify grpc://, http:// or unix: schema to disable TLS. See https://bazel.build/remote/caching
default: see description
--remote_cache_compression=<true or false>
If enabled, compress/decompress cache blobs with zstd when their size is at least --experimental_remote_cache_compression_threshold.
default: "false"
--remote_cache_header=<'name=value' assignment>
Specify a header that will be included in cache requests: --remote_cache_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.
may be used multiple times
--remote_default_exec_properties=<'name=value' assignment>
Set the default exec properties to be used as the remote execution platform if an execution platform does not already set exec_properties.
may be used multiple times
affects outputs
--remote_default_platform_properties=<string>
Set the default platform properties to be set for the remote execution API, if the execution platform does not already set remote_execution_properties. This value will also be used if the host platform is selected as the execution platform for remote execution.
default: ""
--remote_download_all
Downloads all remote outputs to the local machine. This flag is an alias for --remote_download_outputs=all. Expands to: --remote_download_outputs=all
affects outputs
--remote_download_minimal
Does not download any remote build outputs to the local machine. This flag is an alias for --remote_download_outputs=minimal. Expands to: --remote_download_outputs=minimal
affects outputs
--remote_download_outputs=<all, minimal or toplevel>
If set to 'minimal' doesn't download any remote build outputs to the local machine, except the ones required by local actions. If set to 'toplevel' behaves like'minimal' except that it also downloads outputs of top level targets to the local machine. Both options can significantly reduce build times if network bandwidth is a bottleneck.
default: "toplevel"
affects outputs
--remote_download_regex=<valid Java regular expression>
Force remote build outputs whose path matches this pattern to be downloaded, irrespective of --remote_download_outputs. Multiple patterns may be specified by repeating this flag.
may be used multiple times
affects outputs
--remote_download_symlink_template=<string>
Instead of downloading remote build outputs to the local machine, create symbolic links. The target of the symbolic links can be specified in the form of a template string. This template string may contain {hash} and {size_bytes} that expand to the hash of the object and the size in bytes, respectively. These symbolic links may, for example, point to a FUSE file system that loads objects from the CAS on demand.
default: ""
affects outputs
--remote_download_toplevel
Only downloads remote outputs of top level targets to the local machine. This flag is an alias for --remote_download_outputs=toplevel. Expands to: --remote_download_outputs=toplevel
affects outputs
--remote_downloader_header=<'name=value' assignment>
Specify a header that will be included in remote downloader requests: --remote_downloader_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.
may be used multiple times
--remote_exec_header=<'name=value' assignment>
Specify a header that will be included in execution requests: --remote_exec_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.
may be used multiple times
--remote_execution_priority=<integer>
The relative priority of actions to be executed remotely. The semantics of the particular priority values are server-dependent.
default: "0"
--remote_executor=<string>
HOST or HOST:PORT of a remote execution endpoint. The supported schemas are grpc, grpcs (grpc with TLS enabled) and unix (local UNIX sockets). If no schema is provided Bazel will default to grpcs. Specify grpc:// or unix: schema to disable TLS.
default: see description
--remote_grpc_log=<path>
If specified, a path to a file to log gRPC call related details. This log consists of a sequence of serialized com.google.devtools.build.lib.remote.logging.RemoteExecutionLog.LogEntry protobufs with each message prefixed by a varint denoting the size of the following serialized protobuf message, as performed by the method LogEntry.writeDelimitedTo(OutputStream).
default: see description
--remote_header=<'name=value' assignment>
Specify a header that will be included in requests: --remote_header=Name=Value. Multiple headers can be passed by specifying the flag multiple times. Multiple values for the same name will be converted to a comma-separated list.
may be used multiple times
--remote_instance_name=<string>
Value to pass as instance_name in the remote execution API.
default: ""
--remote_local_fallback=<true or false>
Whether to fall back to standalone local execution strategy if remote execution fails.
default: "false"
--remote_local_fallback_strategy=<string>
No-op, deprecated. See https://github.com/bazelbuild/bazel/issues/7480 for details.
default: "local"
--remote_max_connections=<integer>
Limit the max number of concurrent connections to remote cache/executor. By default the value is 100. Setting this to 0 means no limitation. For HTTP remote cache, one TCP connection could handle one request at one time, so Bazel could make up to --remote_max_connections concurrent requests. For gRPC remote cache/executor, one gRPC channel could usually handle 100+ concurrent requests, so Bazel could make around `--remote_max_connections * 100` concurrent requests.
default: "100"
host machine_resource_optimizations
--remote_print_execution_messages=<failure, success or all>
Choose when to print remote execution messages. Valid values are `failure`, to print only on failures, `success` to print only on successes and `all` to print always.
default: "failure"
terminal output
--remote_proxy=<string>
Connect to the remote cache through a proxy. Currently this flag can only be used to configure a Unix domain socket (unix:/path/to/socket).
default: see description
--remote_result_cache_priority=<integer>
The relative priority of remote actions to be stored in remote cache. The semantics of the particular priority values are server-dependent.
default: "0"
--remote_retries=<integer>
The maximum number of attempts to retry a transient error. If set to 0, retries are disabled.
default: "5"
--remote_retry_max_delay=<An immutable length of time.>
The maximum backoff delay between remote retry attempts. Following units can be used: Days (d), hours (h), minutes (m), seconds (s), and milliseconds (ms). If the unit is omitted, the value is interpreted as seconds.
default: "5s"
--remote_timeout=<An immutable length of time.>
The maximum amount of time to wait for remote execution and cache calls. For the REST cache, this is both the connect and the read timeout. Following units can be used: Days (d), hours (h), minutes (m), seconds (s), and milliseconds (ms). If the unit is omitted, the value is interpreted as seconds.
default: "60s"
--remote_upload_local_results=<true or false>
Whether to upload locally executed action results to the remote cache if the remote cache supports it and the user is authorized to do so.
default: "true"
--remote_verify_downloads=<true or false>
If set to true, Bazel will compute the hash sum of all remote downloads and discard the remotely cached values if they don't match the expected value.
default: "true"
--repo_env=<'name=value' assignment with an optional value part>
Specifies additional environment variables to be available only for repository rules. Note that repository rules see the full environment anyway, but in this way configuration information can be passed to repositories through options without invalidating the action graph.
may be used multiple times
action command_lines
--repositories_without_autoloads=<comma-separated set of options>
A list of additional repositories (beyond the hardcoded ones Bazel knows about) where autoloads are not to be added. This should typically contain repositories that are transitively depended on by a repository that may be loaded automatically (and which can therefore potentially create a cycle).
default: ""
loses incremental_state
build file_semantics
incompatible change
--repository_cache=<path>
Specifies the cache location of the downloaded values obtained during the fetching of external repositories. An empty string as argument requests the cache to be disabled, otherwise the default of '<output_user_root>/cache/repos/v1' is used
default: see description
bazel internal_configuration
--repository_disable_download=<true or false>
If set, downloading using ctx.download{,_and_extract} is not allowed during repository fetching. Note that network access is not completely disabled; ctx.execute could still run an arbitrary executable that accesses the Internet.
default: "false"
bazel internal_configuration
--show_loading_progress=<true or false>
If enabled, causes Bazel to print "Loading package:" messages.
default: "true"
--show_progress=<true or false>
Display progress messages during a build.
default: "true"
--show_progress_rate_limit=<double>
Minimum number of seconds between progress messages in the output.
default: "0.2"
--show_timestamps=<true or false>
Include timestamps in messages
default: "false"
--skyframe_high_water_mark_full_gc_drops_per_invocation=<integer, >= 0>
Flag for advanced configuration of Bazel's internal Skyframe engine. If Bazel detects its retained heap percentage usage exceeds the threshold set by --skyframe_high_water_mark_threshold, when a full GC event occurs, it will drop unnecessary temporary Skyframe state, up to this many times per invocation. Defaults to Integer.MAX_VALUE; effectively unlimited. Zero means that full GC events will never trigger drops. If the limit is reached, Skyframe state will no longer be dropped when a full GC event occurs and that retained heap percentage threshold is exceeded.
default: "2147483647"
host machine_resource_optimizations
--skyframe_high_water_mark_minor_gc_drops_per_invocation=<integer, >= 0>
Flag for advanced configuration of Bazel's internal Skyframe engine. If Bazel detects its retained heap percentage usage exceeds the threshold set by --skyframe_high_water_mark_threshold, when a minor GC event occurs, it will drop unnecessary temporary Skyframe state, up to this many times per invocation. Defaults to Integer.MAX_VALUE; effectively unlimited. Zero means that minor GC events will never trigger drops. If the limit is reached, Skyframe state will no longer be dropped when a minor GC event occurs and that retained heap percentage threshold is exceeded.
default: "2147483647"
host machine_resource_optimizations
--skyframe_high_water_mark_threshold=<integer>
Flag for advanced configuration of Bazel's internal Skyframe engine. If Bazel detects its retained heap percentage usage is at least this threshold, it will drop unnecessary temporary Skyframe state. Tweaking this may let you mitigate wall time impact of GC thrashing, when the GC thrashing is (i) caused by the memory usage of this temporary state and (ii) more costly than reconstituting the state when it is needed.
default: "85"
host machine_resource_optimizations
--slim_profile=<true or false>
Slims down the size of the JSON profile by merging events if the profile gets too large.
default: "true"
bazel monitoring
--starlark_cpu_profile=<string>
Writes into the specified file a pprof profile of CPU usage by all Starlark threads.
default: ""
bazel monitoring
--strict_test_suite=<true or false>
If true, the tests() expression gives an error if it encounters a test_suite containing non-test targets.
default: "false"
build file_semantics
eagerness to_exit
--tls_certificate=<string>
Specify a path to a TLS certificate that is trusted to sign server certificates.
default: see description
--tls_client_certificate=<string>
Specify the TLS client certificate to use; you also need to provide a client key to enable client authentication.
default: see description
--tls_client_key=<string>
Specify the TLS client key to use; you also need to provide a client certificate to enable client authentication.
default: see description
--tool_deps=<true or false>
Query: If disabled, dependencies on 'exec configuration' will not be included in the dependency graph over which the query operates. An 'exec configuration' dependency edge, such as the one from any 'proto_library' rule to the Protocol Compiler, usually points to a tool executed during the build rather than a part of the same 'target' program. Cquery: If disabled, filters out all configured targets which cross an execution transition from the top-level target that discovered this configured target. That means if the top-level target is in the target configuration, only configured targets also in the target configuration will be returned. If the top-level target is in the exec configuration, only exec configured targets will be returned. This option will NOT exclude resolved toolchains.
default: "true"
build file_semantics
--tool_tag=<string>
A tool name to attribute this Bazel invocation to.
default: ""
affects outputs
bazel monitoring
--track_incremental_state=<true or false>
If false, Blaze will not persist data that allows for invalidation and re- evaluation on incremental builds in order to save memory on this build. Subsequent builds will not have any incrementality with respect to this one. Usually you will want to specify --batch when setting this to false.
default: "true"
loses incremental_state
--ui_actions_shown=<integer>
Number of concurrent actions shown in the detailed progress bar; each action is shown on a separate line. The progress bar always shows at least one one, all numbers less than 1 are mapped to 1.
default: "8"
terminal output
--ui_event_filters=<Convert list of comma separated event kind to list of filters>
Specifies which events to show in the UI. It is possible to add or remove events to the default ones using leading +/-, or override the default set completely with direct assignment. The set of supported event kinds include INFO, DEBUG, ERROR and more.
may be used multiple times
terminal output
--universe_scope=<comma-separated list of options>
A comma-separated set of target patterns (additive and subtractive). The query may be performed in the universe defined by the transitive closure of the specified targets. This option is used for the query and cquery commands. For cquery, the input to this option is the targets all answers are built under and so this option may affect configurations and transitions. If this option is not specified, the top-level targets are assumed to be the targets parsed from the query expression. Note: For cquery, not specifying this option may cause the build to break if targets parsed from the query expression are not buildable with top-level options.
default: ""
loading and_analysis
--vendor_dir=<path>
Specifies the directory that should hold the external repositories in vendor mode, whether for the purpose of fetching them into it or using them while building. The path can be specified as either an absolute path or a path relative to the workspace directory.
default: see description
loading and_analysis
--watchfs=<true or false>
On Linux/macOS: If true, bazel tries to use the operating system's file watch service for local changes instead of scanning every file for a change. On Windows: this flag currently is a non-op but can be enabled in conjunction with --experimental_windows_watchfs. On any OS: The behavior is undefined if your workspace is on a network file system, and files are edited on a remote machine.
default: "false"
--xml:default_values=<true or false>
If true, rule attributes whose value is not explicitly specified in the BUILD file are printed; otherwise they are omitted.
default: "false"
terminal output
--xml:line_numbers=<true or false>
If true, XML output contains line numbers. Disabling this option may make diffs easier to read. This option is only applicable to --output=xml.
default: "true"
terminal output