allbuildtestrunquerystartup options
--action_env=<'name=value' assignment with an optional value part>
Specifies the set of environment variables available to actions. Variables can be either specified by name, in which case the value will be taken from the invocation environment, or by the name=value pair which sets the value independent of the invocation environment. This option can be used multiple times; for options given for the same variable, the latest wins, options for different variables accumulate.
may be used multiple times
action command_lines
--all_incompatible_changes
Enables all options of the form --incompatible_*. Use this option to find places where your build may break in the future due to deprecations or other changes. Expands to: --incompatible_allow_python_version_transitions -- incompatible_auto_configure_host_platform -- incompatible_bzl_disallow_load_after_statement --incompatible_cc_coverage --incompatible_depset_is_not_iterable --incompatible_depset_union -- incompatible_disable_cc_configuration_make_variables -- incompatible_disable_cc_toolchain_label_from_crosstool_proto -- incompatible_disable_crosstool_file -- incompatible_disable_deprecated_attr_params -- incompatible_disable_depset_in_cc_user_flags -- incompatible_disable_expand_if_all_available_in_flag_set -- incompatible_disable_genrule_cc_toolchain_dependency -- incompatible_disable_late_bound_option_defaults -- incompatible_disable_legacy_cc_provider -- incompatible_disable_legacy_cpp_toolchain_skylark_api -- incompatible_disable_legacy_crosstool_fields -- incompatible_disable_legacy_flags_cc_toolchain_api -- incompatible_disable_legacy_proto_provider -- incompatible_disable_objc_library_resources -- incompatible_disable_objc_provider_resources -- incompatible_disable_proto_source_root -- incompatible_disable_runtimes_filegroups -- incompatible_disable_sysroot_from_configuration -- incompatible_disable_third_party_license_checking -- incompatible_disable_tools_defaults_package -- incompatible_disallow_dict_plus --incompatible_disallow_filetype -- incompatible_disallow_legacy_java_provider -- incompatible_disallow_legacy_javainfo -- incompatible_disallow_legacy_py_provider -- incompatible_disallow_load_labels_to_cross_package_boundaries -- incompatible_disallow_native_in_build_file -- incompatible_disallow_old_style_args_add -- incompatible_disallow_resource_jars -- incompatible_disallow_struct_provider_syntax -- incompatible_do_not_split_linking_cmdline -- incompatible_dont_emit_static_libgcc -- incompatible_dont_enable_host_nonhost_crosstool_features -- incompatible_enable_cc_toolchain_resolution -- incompatible_enable_legacy_cpp_toolchain_skylark_api -- incompatible_expand_directories -- incompatible_linkopts_in_user_link_flags -- incompatible_list_based_execution_strategy_selection -- incompatible_merge_genfiles_directory --incompatible_new_actions_api -- incompatible_no_attr_license --incompatible_no_output_attr_default -- incompatible_no_support_tools_in_action_inputs -- incompatible_no_target_output_group --incompatible_no_transitive_loads -- incompatible_provide_cc_toolchain_info_from_cc_toolchain_suite -- incompatible_py2_outputs_are_suffixed --incompatible_py3_is_default -- incompatible_remap_main_repo --incompatible_remote_symlinks -- incompatible_remove_cpu_and_compiler_attributes_from_cc_toolchain -- incompatible_remove_legacy_whole_archive -- incompatible_remove_local_resources -- incompatible_remove_native_maven_jar -- incompatible_remove_old_python_version_api -- incompatible_require_ctx_in_configure_features -- incompatible_require_feature_configuration_for_pic -- incompatible_require_java_toolchain_header_compiler_direct -- incompatible_strict_action_env --incompatible_strict_objc_module_maps -- incompatible_string_join_requires_strings -- incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfiles_tree -- incompatible_use_aapt2_by_default -- incompatible_use_jdk11_as_host_javabase -- incompatible_use_python_toolchains -- incompatible_use_toolchain_providers_in_java_common -- incompatible_use_toolchain_resolution_for_java_rules -- incompatible_windows_escape_jvm_flags -- incompatible_windows_native_test_wrapper
incompatible change
--allow_analysis_failures=<true or false>
If true, an analysis failure of a rule target results in the target's propagation of an instance of AnalysisFailureInfo containing the error description, instead of resulting in a build failure.
default: "false"
loading and_analysis
experimental
--analysis_testing_deps_limit=<integer>
Sets the maximum number of transitive dependencies through a rule attribute with a for_analysis_testing configuration transition. Exceeding this limit will result in a rule error.
default: "500"
loading and_analysis
--android_aapt=<aapt, aapt2 or auto>
Selects the version of androidAaptVersion to use for android_binary rules. Flag to help the test and transition to aapt2.
default: "auto"
affects outputs
loading and_analysis
loses incremental_state
--android_compiler=<string>
The Android target compiler.
default: see description
affects outputs
loading and_analysis
loses incremental_state
--android_cpu=<string>
The Android target CPU.
default: "armeabi-v7a"
affects outputs
loading and_analysis
loses incremental_state
--android_crosstool_top=<build target label>
The location of the C++ compiler used for Android builds.
default: "//external:android/crosstool"
affects outputs
changes inputs
loading and_analysis
loses incremental_state
--android_databinding_use_v3_4_args=<true or false>
Use android databinding v2 with 3.4.0 argument
default: "false"
affects outputs
loading and_analysis
loses incremental_state
experimental
--android_dynamic_mode=<off, default or fully>
Determines whether C++ deps of Android rules will be linked dynamically when a cc_binary does not explicitly create a shared library. 'default' means bazel will choose whether to link dynamically. 'fully' means all libraries will be linked dynamically. 'off' means that all libraries will be linked in mostly static mode.
default: "off"
affects outputs
loading and_analysis
--android_grte_top=<label>
The Android target grte_top.
default: see description
changes inputs
loading and_analysis
loses incremental_state
--android_manifest_merger=<legacy or android>
Selects the manifest merger to use for android_binary rules. Flag to help thetransition to the Android manifest merger from the legacy merger.
default: "android"
affects outputs
loading and_analysis
loses incremental_state
--android_manifest_merger_order=<alphabetical, alphabetical_by_configuration or dependency>
Sets the order of manifests passed to the manifest merger for Android binaries. ALPHABETICAL means manifests are sorted by path relative to the execroot. ALPHABETICAL_BY_CONFIGURATION means manifests are sorted by paths relative to the configuration directory within the output directory. DEPENDENCY means manifests are ordered with each library's manifest coming before the manifests of its dependencies.
default: "alphabetical"
action command_lines
execution
--android_resource_shrinking=<true or false>
Enables resource shrinking for android_binary APKs that use ProGuard.
default: "false"
affects outputs
loading and_analysis
--android_sdk=<build target label>
Specifies Android SDK/platform that is used to build Android applications.
default: "@bazel_tools//tools/android:sdk"
changes inputs
loading and_analysis
loses incremental_state
--announce=<true or false>
Deprecated. No-op.
default: "false"
affects outputs
--announce_rc=<true or false>
Whether to announce rc options.
default: "false"
affects outputs
--apk_signing_method=<v1, v2 or v1_v2>
Implementation to use to sign APKs
default: "v1_v2"
action command_lines
affects outputs
loading and_analysis
--apple_bitcode=<none, embedded_markers or embedded>
Specify the Apple bitcode mode for compile steps. Values: 'none', 'embedded_markers', 'embedded'.
default: "none"
loses incremental_state
--apple_compiler=<string>
The Apple target compiler. Useful for selecting variants of a toolchain (e. g. xcode-beta).
default: see description
affects outputs
loading and_analysis
loses incremental_state
--apple_crosstool_top=<build target label>
The label of the crosstool package to be used in Apple and Objc rules and their dependencies.
default: "@bazel_tools//tools/cpp:toolchain"
loses incremental_state
changes inputs
--apple_enable_auto_dsym_dbg=<true or false>
Whether to force enable generating debug symbol(.dSYM) file(s) for dbg builds.
default: "false"
affects outputs
action command_lines
--apple_generate_dsym=<true or false>
Whether to generate debug symbol(.dSYM) file(s).
default: "false"
affects outputs
action command_lines
--apple_grte_top=<build target label>
The Apple target grte_top.
default: see description
changes inputs
loading and_analysis
loses incremental_state
--apple_sdk=<build target label>
Location of target that will provide the appropriate Apple SDK for the current build configuration.
default: see description
affects outputs
loading and_analysis
--aspects=<comma-separated list of options>
Comma-separated list of aspects to be applied to top-level targets. All aspects are applied to all top-level targets independently. Aspects are specified in the form <bzl-file-label>%<aspect_name>, for example '//tools:my_def.bzl%my_aspect', where 'my_aspect' is a top-level value from from a file tools/my_def.bzl
may be used multiple times
--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
--auto_cpu_environment_group=<build target label>
Declare the environment_group to use for automatically mapping cpu values to target_environment values.
default: ""
changes inputs
loading and_analysis
experimental
--bep_publish_used_heap_size_post_build=<true or false>
When set we collect and publish used_heap_size_post_build from build_event_stream.proto. This forces a full GC and is off by default.
default: "false"
--bes_backend=<string>
Specifies the build event service (BES) backend endpoint as HOST or HOST: PORT. Disabled by default.
default: ""
affects outputs
--bes_best_effort=<true or false>
BES best effort upload has been removed. The flag has no more functionality attached to it and will be removed in a future release.
default: "false"
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_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_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_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
--build=<true or false>
Execute the build; this is the usual behaviour. Specifying --nobuild causes the build to stop before executing the build actions, returning zero iff the package loading and analysis phases completed successfully; this mode is useful for testing those phases.
default: "true"
execution
affects outputs
--build_event_binary_file=<string>
If non-empty, write a varint delimited binary representation of representation of the build event protocol to that file.
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_json_file=<string>
If non-empty, write a JSON serialisation of the build event protocol to that file.
default: ""
affects outputs
--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_manual_tests=<true or false>
Forces test targets tagged 'manual' to be built. 'manual' tests are excluded from processing. This option forces them to be built (but not executed).
default: "false"
--build_python_zip=<tri-state (auto, yes, no)>
Build python executable zip; on on Windows, off on other platforms
default: "auto"
affects outputs
--build_runfile_links=<true or false>
If true, build runfiles symlink forests for all targets. If false, write only manifests when possible.
default: "true"
affects outputs
--build_runfile_manifests=<true or false>
If true, write runfiles manifests for all targets. If false, omit them.
default: "true"
affects outputs
--build_tag_filters=<comma-separated list of options>
Specifies a comma-separated list of tags. Each tag can be optionally preceded with '-' to specify excluded tags. Only those targets will be built that contain at least one included tag and do not contain any excluded tags. This option does not affect the set of tests executed with the 'test' command; those are be governed by the test filtering options, for example '--test_tag_filters'
default: ""
--build_test_dwp=<true or false>
If enabled, when building C++ tests statically and with fission the .dwp file for the test binary will be automatically built as well.
default: "false"
loading and_analysis
affects outputs
--build_tests_only=<true or false>
If specified, only *_test and test_suite rules will be built and other targets specified on the command line will be ignored. By default everything that was requested will be built.
default: "false"
--cache_test_results=<tri-state (auto, yes, no)>
If set to 'auto', Bazel reruns a test if and only if: (1) Bazel detects changes in the test or its dependencies, (2) the test is marked as external, (3) multiple test runs were requested with --runs_per_test, or(4) the test previously failed. If set to 'yes', Bazel caches all test results except for tests marked as external. If set to 'no', Bazel does not cache any test results.
default: "auto"
--cc_output_directory_tag=<string>
Specifies a suffix to be added to the configuration directory.
default: ""
affects outputs
--cc_proto_library_header_suffixes=<comma-separated list of options>
Sets the prefixes of header files that a cc_proto_library creates.
default: ".pb.h"
affects outputs
loading and_analysis
--cc_proto_library_source_suffixes=<comma-separated list of options>
Sets the prefixes of source files that a cc_proto_library creates.
default: ".pb.cc"
affects outputs
loading and_analysis
--check_constraint=<string>
Check the listed constraint.
may be used multiple times
--check_licenses=<true or false>
Check that licensing constraints imposed by dependent packages do not conflict with distribution modes of the targets being built. By default, licenses are not checked.
default: "false"
build file_semantics
--check_tests_up_to_date=<true or false>
Don't run tests, just check if they are up-to-date. If all tests results are up-to-date, the testing completes successfully. If any test needs to be built or executed, an error is reported and the testing fails. This option implies --check_up_to_date behavior. Using this option will also add: --check_up_to_date
default: "false"
--check_third_party_targets_have_licenses=<true or false>
If true, all rules and files under //third_party must declare licenses([])
default: "true"
build file_semantics
--check_up_to_date=<true or false>
Don't perform the build, just check if it is up-to-date. If all targets are up-to-date, the build completes successfully. If any step needs to be executed an error is reported and the build fails.
default: "false"
--check_visibility=<true or false>
If disabled, visibility errors are demoted to warnings.
default: "true"
build file_semantics
--collapse_duplicate_defines=<true or false>
When enabled, redundant --defines will be removed early in the build. This avoids unnecessary loss of the analysis cache for certain types of equivalent builds.
default: "false"
loading and_analysis
loses incremental_state
--collect_code_coverage=<true or false>
If specified, Bazel will instrument code (using offline instrumentation where possible) and will collect coverage information during tests. Only targets that match --instrumentation_filter will be affected. Usually this option should not be specified directly - 'bazel coverage' command should be used instead.
default: "false"
affects outputs
--color=<yes, no or auto>
Use terminal controls to colorize output going to stderr.
default: "auto"
--combined_report=<none or lcov>
Specifies desired cumulative coverage report type. At this point only HTML and LCOV reports are supported.
default: "none"
--compilation_mode=<fastbuild, dbg or opt>
Specify the mode the binary will be built in. Values: 'fastbuild', 'dbg', 'opt'.
default: "fastbuild"
affects outputs
action command_lines
--compile_one_dependency=<true or false>
Compile a single dependency of the argument files. This is useful for syntax checking source files in IDEs, for example, by rebuilding a single target that depends on the source file to detect errors as early as possible in the edit/build/test cycle. This argument affects the way all non-flag arguments are interpreted; instead of being targets to build they are source filenames. For each source filename an arbitrary target that depends on it will be built.
default: "false"
--compiler=<string>
The C++ compiler to use for compiling the target.
default: see description
loading and_analysis
execution
--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
--conlyopt=<string>
Additional option to pass to gcc when compiling C source files.
may be used multiple times
action command_lines
affects outputs
--copt=<string>
Additional options to pass to gcc.
may be used multiple times
action command_lines
affects outputs
--coverage_report_generator=<build target label>
Location of the binary that is used to generate coverage reports. This must currently be a filegroup that contains a single file, the binary. Defaults to '//tools/test:coverage_report_generator'.
default: "@bazel_tools//tools/test:coverage_report_generator"
changes inputs
affects outputs
loading and_analysis
--coverage_support=<build target label>
Location of support files that are required on the inputs of every test action that collects code coverage. Defaults to '//tools/test: coverage_support'.
default: "@bazel_tools//tools/test:coverage_support"
changes inputs
affects outputs
loading and_analysis
--cpu=<string>
The target CPU.
default: ""
changes inputs
affects outputs
--crosstool_top=<build target label>
The label of the crosstool package to be used for compiling C++ code.
default: "@bazel_tools//tools/cpp:toolchain"
loading and_analysis
changes inputs
affects outputs
--curses=<yes, no or auto>
Use terminal cursor controls to minimize scrolling output going to stderr.
default: "auto"
--custom_malloc=<build target label>
Specifies a custom malloc implementation. This setting overrides malloc attributes in build rules.
default: see description
changes inputs
affects outputs
--cxxopt=<string>
Additional option to pass to gcc when compiling C++ source files.
may be used multiple times
action command_lines
affects outputs
--default_ios_provisioning_profile=<build target label>
default: ""
changes inputs
--define=<'name=value' assignment>
Each --define option specifies an assignment for a build variable.
may be used multiple times
changes inputs
affects outputs
--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.
default: ""
--desugar_for_android=<true or false>
Whether to desugar Java 8 bytecode before dexing.
default: "true"
affects outputs
loading and_analysis
loses incremental_state
--device_debug_entitlements=<true or false>
If set, and compilation mode is not 'opt', objc apps will include debug entitlements when signing.
default: "true"
changes inputs
--discard_analysis_cache=<true or false>
Discard the analysis cache immediately after the analysis phase completes. Reduces memory usage by ~10%, but makes further incremental builds slower.
default: "false"
--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
--distinct_host_configuration=<true or false>
Build all the tools used during the build for a distinct configuration from that used for the target program. When this is disabled, the same configuration is used for host and target programs. This may cause undesirable rebuilds of tools such as the protocol compiler (and then everything downstream) whenever a minor change is made to the target configuration, such as setting the linker options. When this is enabled (the default), a distinct configuration will be used to build the tools, preventing undesired rebuilds. However, certain libraries will then need to be compiled twice, once for each configuration, which may cause some builds to be slower. As a rule of thumb, this option is likely to benefit users that make frequent changes in configuration (e.g. opt/dbg). Please read the user manual for the full explanation.
default: "true"
loses incremental_state
bazel internal_configuration
loading and_analysis
--dynamic_mode=<off, default or fully>
Determines whether C++ binaries will be linked dynamically. 'default' means Bazel will choose whether to link dynamically. 'fully' means all libraries will be linked dynamically. 'off' means that all libraries will be linked in mostly static mode.
default: "default"
loading and_analysis
affects outputs
--embed_label=<string>
Embed source control revision or release label in binary
default: ""
--enable_apple_binary_native_protos=<true or false>
If set, apple_binary will generate and link objc protos into the output binary.
default: "true"
affects outputs
incompatible change
--enable_fdo_profile_absolute_path=<true or false>
If set, use of fdo_absolute_profile_path will raise an error.
default: "true"
affects outputs
--enable_runfiles=<tri-state (auto, yes, no)>
Enable runfiles symlink tree; By default, it's off on Windows, on on other platforms.
default: "auto"
affects outputs
--enabled_toolchain_types=<build target label>
Enable toolchain resolution for the given toolchain type, if the rules used support that. This does not directly change the core Blaze machinery, but is a signal to participating rule implementations that toolchain resolution should be used.
default: ""
loading and_analysis
--enforce_constraints=<true or false>
Checks the environments each target is compatible with and reports errors if any target has dependencies that don't support the same environments
default: "true"
build file_semantics
--expand_test_suites=<true or false>
Expand test_suite targets into their constituent tests before analysis. When this flag is turned on (the default), negative target patterns will apply to the tests belonging to the test suite, otherwise they will not. Turning off this flag is useful when top-level aspects are applied at command line: then they can analyze test_suite targets.
default: "true"
loading and_analysis
--experimental_action_listener=<build target label>
Use action_listener to attach an extra_action to existing build actions.
may be used multiple times
execution
experimental
--experimental_allow_android_library_deps_without_srcs=<true or false>
Flag to help transition from allowing to disallowing srcs-less android_library rules with deps. The depot needs to be cleaned up to roll this out by default.
default: "false"
eagerness to_exit
loading and_analysis
--experimental_android_compress_java_resources=<true or false>
Compress Java resources in APKs
default: "false"
affects outputs
loading and_analysis
experimental
--experimental_android_databinding_v2=<true or false>
Use android databinding v2
default: "false"
affects outputs
loading and_analysis
loses incremental_state
experimental
--experimental_android_resource_shrinking=<true or false>
Enables resource shrinking for android_binary APKs that use ProGuard.
default: "false"
affects outputs
loading and_analysis
--experimental_android_rewrite_dexes_with_rex=<true or false>
use rex tool to rewrite dex files
default: "false"
affects outputs
loading and_analysis
loses incremental_state
experimental
--experimental_android_throw_on_resource_conflict=<true or false>
If passed, resource merge conflicts will be treated as errors instead of warnings
default: "false"
eagerness to_exit
loading and_analysis
--experimental_android_use_parallel_dex2oat=<true or false>
Use dex2oat in parallel to possibly speed up android_test.
default: "false"
loading and_analysis
host machine_resource_optimizations
experimental
--experimental_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
--experimental_build_event_upload_strategy=<string>
Selects how to upload artifacts referenced in the build event protocol.
default: see description
affects outputs
--experimental_check_desugar_deps=<true or false>
Whether to double-check correct desugaring at Android binary level.
default: "true"
eagerness to_exit
loading and_analysis
experimental
--experimental_desugar_java8_libs=<true or false>
Whether to include supported Java 8 libraries in apps for legacy devices.
default: "false"
affects outputs
loading and_analysis
loses incremental_state
experimental
--experimental_docker_image=<string>
Specify a Docker image name (e.g. "ubuntu:latest") that should be used to execute a sandboxed action when using the docker strategy and the action itself doesn't already have a container-image attribute in its remote_execution_properties in the platform description. The value of this flag is passed verbatim to 'docker run', so it supports the same syntax and mechanisms as Docker itself.
default: ""
execution
--experimental_docker_privileged=<true or false>
If enabled, Bazel will pass the --privileged flag to 'docker run' when running actions. This might be required by your build, but it might also result in reduced hermeticity.
default: "false"
execution
--experimental_docker_use_customized_images=<true or false>
If enabled, injects the uid and gid of the current user into the Docker image before using it. This is required if your build / tests depend on the user having a name and home directory inside the container. This is on by default, but you can disable it in case the automatic image customization feature doesn't work in your case or you know that you don't need it.
default: "true"
execution
--experimental_docker_verbose=<true or false>
If enabled, Bazel will print more verbose messages about the Docker sandbox strategy.
default: "false"
execution
--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_docker_sandbox=<true or false>
Enable Docker-based sandboxing. This option has no effect if Docker is not installed.
default: "false"
execution
--experimental_enable_objc_cc_deps=<true or false>
Allows objc_* rules to depend on cc_library and causes any objc dependencies to be built with --cpu set to "ios_<--ios_cpu>" for any values in --ios_multi_cpu.
default: "true"
loading and_analysis
incompatible change
--experimental_execution_log_file=<string>
Log the executed spawns into this file as delimited Spawn protos.
default: ""
--experimental_external_repositories=<true or false>
Use external repositories for improved stability and speed when available.
default: "false"
--experimental_extra_action_filter=<comma-separated list of regex expressions with prefix '-' specifying excluded paths>
Filters set of targets to schedule extra_actions for.
default: ""
--experimental_extra_action_top_level_only=<true or false>
Only schedules extra_actions for top level targets.
default: "false"
--experimental_generate_json_trace_profile=<true or false>
If enabled, Bazel profiles the build and writes a JSON-format profile into a file in the output base.
default: "false"
affects outputs
bazel monitoring
--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_import_deps_checking=<off, warning or error>
When enabled, check whether the dependencies of an aar_import are complete. This enforcement can break the build, or can just result in warnings.
default: "OFF"
loading and_analysis
--experimental_inmemory_dotd_files=<true or false>
If enabled, C++ .d files will be passed through in memory directly from the remote build nodes instead of being written to disk.
default: "false"
loading and_analysis
execution
affects outputs
experimental
--experimental_inmemory_jdeps_files=<true or false>
If enabled, the dependency (.jdeps) files generated from Java compilations will be passed through in memory directly from the remote build nodes instead of being written to disk.
default: "false"
loading and_analysis
execution
affects outputs
experimental
--experimental_interleave_loading_and_analysis=<true or false>
No-op.
default: "true"
--experimental_j2objc_header_map=<true or false>
Whether to generate J2ObjC header map in parallel of J2ObjC transpilation.
default: "true"
--experimental_java_classpath=<off, javabuilder or bazel>
Enables reduced classpaths for Java compilations.
default: "javabuilder"
--experimental_java_proto_add_allowed_public_imports=<true or false>
If true, add --allowed_public_imports to the java compile actions.
default: "false"
affects outputs
loading and_analysis
experimental
--experimental_json_trace_compression=<true or false>
If enabled, Bazel compresses the JSON-format profile with gzip.
default: "false"
affects outputs
bazel monitoring
--experimental_link_compile_output_separately=<true or false>
This flag is experimental and may go away at any time. If true, dynamically linked binary targets will build and link their own srcs as a dynamic library instead of directly linking it in.
default: "false"
loading and_analysis
affects outputs
experimental
--experimental_local_execution_delay=<integer>
How many milliseconds should local execution be delayed, if remote execution was faster during a build at least once?
default: "1000"
--experimental_local_memory_estimate=<true or false>
Estimate the actual memory available online. By default, Blaze assumes most actions use a fixed amount of memory, and counts that against the total available system memory, regardless of how much memory is actually available. This option enables online estimation of how much memory is available at any given time, and thus does not require accurate estimation of how much memory a given action will take.
default: "false"
--experimental_multi_cpu=<comma-separated list of options>
This flag allows specifying multiple target CPUs. If this is specified, the --cpu option is ignored.
may be used multiple times
affects outputs
experimental
--experimental_multi_threaded_digest=<true or false>
Whether to always compute MD5 digests of files with multiple threads. Might improve performance when using an SSD.
default: "false"
--experimental_objc_enable_module_maps=<true or false>
Enables module map generation and interpretation.
default: "false"
action command_lines
--experimental_objc_fastbuild_options=<comma-separated list of options>
Uses these strings as objc fastbuild compiler options.
default: "-O0,-DDEBUG=1"
action command_lines
--experimental_objc_header_thinning=<true or false>
If set then ObjcCompile actions will have their action inputs reduced by running a tool to detect which headers are actually required for compilation.
default: "false"
changes inputs
loading and_analysis
experimental
--experimental_omitfp=<true or false>
If true, use libunwind for stack unwinding, and compile with -fomit-frame- pointer and -fasynchronous-unwind-tables.
default: "false"
action command_lines
affects outputs
experimental
--experimental_oom_more_eagerly_threshold=<integer>
If this flag is set to a value less than 100, Bazel will OOM if, after two full GC's, more than this percentage of the (old gen) heap is still occupied.
default: "100"
host machine_resource_optimizations
--experimental_persistent_javac
Enable the experimental persistent Java compiler. Expands to: --strategy=Javac=worker --strategy=JavaIjar=local -- strategy=JavaDeployJar=local --strategy=JavaSourceJar=local -- strategy=Turbine=local
--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_post_profile_started_event=<true or false>
If set, Bazel will post the ProfilerStartedEvent including the path to the profile.
default: "false"
affects outputs
bazel monitoring
--experimental_profile_additional_tasks=<phase, action, __action_builder, __action_submit, action_check, __action_execute, action_lock, action_release, __action_graph, action_update, action_complete, info, __exception, create_package, __package_validity_check, __spawn, remote_execution, local_execution, scanner, local_parse, upload_time, process_time, remote_queue, remote_setup, fetch, 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, __configured_target, thread_name, __test, skyframe_eval, skyfunction, critical_path, critical_path_component, handle_gc_notification, local_cpu_usage, __inclusion_parse, __process_scan, __loop_output_artifacts, __locate_relative, __construct_include_paths, __parse_and_hints_results, __process_results_and_enqueue, starlark_parser, starlark_user_fn, starlark_builtin_fn, starlark_user_compiled_fn, action_fs_staging or unknown>
Specifies additional profile tasks to be included in the profile.
may be used multiple times
affects outputs
bazel monitoring
--experimental_profile_cpu_usage=<true or false>
If set, Bazel will measure cpu usage and add it to the JSON profile.
default: "false"
affects outputs
bazel monitoring
--experimental_proto_extra_actions=<true or false>
Run extra actions for alternative Java api versions in a proto_library.
default: "false"
affects outputs
loading and_analysis
experimental
--experimental_remote_download_outputs=<all or minimal>
If set to 'minimal' doesn't download any remote build outputs to the local machine, except the ones required by local actions. This option can significantly reduce build times if network bandwidth is a bottleneck.
default: "all"
affects outputs
--experimental_remote_grpc_log=<string>
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: ""
--experimental_remote_retry=<true or false>
Whether to retry transient remote execution/cache errors.
default: "true"
--experimental_remote_retry_jitter=<double>
The random factor to apply to retry delays on transient errors.
default: "0.1"
--experimental_remote_retry_max_attempts=<integer>
The maximum number of attempts to retry a transient error.
default: "5"
--experimental_remote_retry_max_delay_millis=<long integer>
The maximum delay before retrying a transient error.
default: "5000"
--experimental_remote_retry_multiplier=<double>
The multiplier by which to increase the retry delay on transient errors.
default: "2"
--experimental_remote_retry_start_delay_millis=<long integer>
The initial delay before retrying a transient error.
default: "100"
--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 inteded to save disk space.
default: "false"
bazel internal_configuration
--experimental_repository_hash_file=<string>
If non-empty, specifies a file containing a resolved value, against which the repository directory hashes should be verified
default: ""
affects outputs
experimental
--experimental_repository_resolved_file=<string>
If non-empty, write a Skylark 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_restrict_named_params=<true or false>
If set to true, restricts a number of Starlark built-in function parameters to be only specifiable positionally (and not by keyword).
default: "false"
loading and_analysis
experimental
--experimental_sandbox_base=<string>
Lets the sandbox create its sandbox directories underneath this path. Specify a path on tmpfs (like /run/shm) to possibly improve performance a lot when your build / tests have many input files. Note: You need enough RAM and free space on the tmpfs to hold output and intermediate files generated by running actions.
default: ""
--experimental_sandbox_default_allow_network=<true or false>
Allow network access by default for actions.
default: "true"
--experimental_sandboxfs_map_symlink_targets=<true or false>
If true, maps the targets of symbolic links specified as action inputs into the sandbox. This feature exists purely to workaround buggy rules that do not do this on their own and should be removed once all such rules are fixed.
default: "false"
--experimental_sandboxfs_path=<string>
Path to the sandboxfs binary to use when --experimental_use_sandboxfs is true. If a bare name, use the first binary of that name found in the PATH.
default: "sandboxfs"
--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_slim_json_profile=<true or false>
Slims down the size of the JSON profile by merging events if the profile gets too large.
default: "false"
affects outputs
bazel monitoring
--experimental_spawn_scheduler
Enable dynamic execution by running actions locally and remotely in parallel. Bazel spawns each action locally and remotely and picks the one that completes first. If an action supports workers, the local action will be run in the persistent worker mode. To enable dynamic execution for an individual action mnemonic, use the `--internal_spawn_scheduler` and `--strategy=<mnemonic>=dynamic` flags instead. Expands to: --internal_spawn_scheduler --spawn_strategy=dynamic
--experimental_split_xml_generation=<true or false>
If this flag is set, and a test action does not generate a test.xml file, then Bazel uses a separate action to generate a dummy test.xml file containing the test log. Otherwise, Bazel generates a test.xml as part of the test action.
default: "true"
execution
--experimental_starlark_config_transitions=<true or false>
If set to true, enables creation of configuration transition objects (the `transition()` function) in Starlark.
default: "false"
loading and_analysis
experimental
--experimental_strict_fileset_output=<true or false>
If this option is enabled, filesets will treat all output artifacts as regular files. They will not traverse directories or be sensitive to symlinks.
default: "false"
execution
--experimental_strict_java_deps=<off, warn, error, strict or default>
If true, checks that a Java target explicitly declares all directly used targets as dependencies.
default: "default"
build file_semantics
eagerness to_exit
--experimental_ui_deduplicate=<true or false>
Make the UI deduplicate messages to have a cleaner scroll-back log.
default: "false"
terminal output
--experimental_ui_limit_console_output=<integer>
Number of bytes to which the UI will limit its output (non-positive values indicate unlimited). Once the limit is approaching, the UI will try hard to limit in a meaningful way, but will ultimately just drop all output.
default: "0"
--experimental_use_llvm_covmap=<true or false>
If specified, Bazel will generate llvm-cov coverage map information rather than gcov when collect_code_coverage is enabled.
default: "false"
changes inputs
affects outputs
loading and_analysis
experimental
--experimental_use_sandboxfs=<tri-state (auto, yes, no)>
Use sandboxfs to create the actions' execroot directories instead of building a symlink tree. If "yes", the binary provided by --experimental_sandboxfs_path must be valid and correspond to a supported version of sandboxfs. If "auto", the binary may be missing or not compatible.
default: "false"
--experimental_verify_repository_rules=<string>
If list of repository rules for which the hash of the output directory should be verified, provided a file is specified by -- experimental_repository_hash_file.
may be used multiple times
affects outputs
experimental
--experimental_workspace_rules_log_file=<string>
Log certain Workspace Rules events into this file as delimited WorkspaceEvent protos.
default: see description
--explain=<path>
Causes the build system to explain each executed step of the build. The explanation is written to the specified log file.
default: see description
affects outputs
--explicit_java_test_deps=<true or false>
Explicitly specify a dependency to JUnit or Hamcrest in a java_test instead of accidentally obtaining from the TestRunner's deps. Only works for bazel right now.
default: "false"
--extra_entitlements=<build target label>
Location of a .entitlements file that is merged into any iOS signing action in this build.
default: see description
changes inputs
--extra_execution_platforms=<comma-separated list of options>
The platforms that are available as execution platforms to run actions. Platforms can be specified by exact target, or as a target pattern. These platforms will be considered before those declared in the WORKSPACE file by register_execution_platforms().
may be used multiple times
execution
--extra_toolchains=<comma-separated list of options>
The toolchain rules to be considered during toolchain resolution. Toolchains can be specified by exact target, or as a target pattern. These toolchains will be considered before those declared in the WORKSPACE file by register_toolchains().
may be used multiple times
affects outputs
changes inputs
loading and_analysis
--fat_apk_cpu=<comma-separated list of options>
Setting this option enables fat APKs, which contain native binaries for all specified target architectures, e.g., --fat_apk_cpu=x86,armeabi-v7a. If this flag is specified, then --android_cpu is ignored for dependencies of android_binary rules.
default: "armeabi-v7a"
affects outputs
loading and_analysis
loses incremental_state
--fdo_instrument=<string>
Generate binaries with FDO instrumentation. With Clang/LLVM compiler, it also accepts the directory name under which the raw profile file(s) will be dumped at runtime. Using this option will also add: --copt=-Wno-error
default: see description
affects outputs
--fdo_optimize=<string>
Use FDO profile information to optimize compilation. Specify the name of the zip file containing the .gcda file tree, or an afdo file containing an auto profile. This flag also accepts files specified as labels, for example //foo/bar:file.afdo. Such labels must refer to input files; you may need to add an exports_files directive to the corresponding package to make the file visible to Bazel. It also accepts a raw or an indexed LLVM profile file. This flag will be superseded by fdo_profile rule.
default: see description
affects outputs
--fdo_prefetch_hints=<build target label>
Use cache prefetch hints.
default: see description
affects outputs
--fdo_profile=<build target label>
The fdo_profile representing the profile to be used for optimization.
default: see description
affects outputs
--features=<string>
The given features will be enabled or disabled by default for all packages. Specifying -<feature> will disable the feature globally. Negative features always override positive ones. This flag is used to enable rolling out default feature changes without a Bazel release.
may be used multiple times
changes inputs
affects outputs
--fission=<set of compilation modes>
Specifies which compilation modes use fission for C++ compilations and links. May be any combination of {'fastbuild', 'dbg', 'opt'} or the special values 'yes' to enable all modes and 'no' to disable all modes.
default: "no"
loading and_analysis
action command_lines
affects outputs
--flaky_test_attempts=<positive integer, the string "default", or test_regex@attempts. This flag may be passed more than once>
Each test will be retried up to the specified number of times in case of any test failure. Tests that required more than one attempt to pass would be marked as 'FLAKY' in the test summary. If this option is set, it should specify an int N or the string 'default'. If it's an int, then all tests will be run up to N times. If it is not specified or its value is 'default', then only a single test attempt will be made for regular tests and three for tests marked explicitly as flaky by their rule (flaky=1 attribute).
may be used multiple times
--force_experimental_external_repositories=<true or false>
Forces --experimental_external_repositories.
default: "false"
--force_pic=<true or false>
If enabled, all C++ compilations produce position-independent code ("- fPIC"), links prefer PIC pre-built libraries over non-PIC libraries, and links produce position-independent executables ("-pie").
default: "false"
loading and_analysis
affects outputs
--force_python=<PY2 or PY3>
Deprecated alias for `--python_version`. Disabled by `-- incompatible_remove_old_python_version_api`.
default: see description
loading and_analysis
affects outputs
--genrule_strategy=<comma-separated list of options>
Specify how to execute genrules. This flag will be phased out. Instead, use --spawn_strategy=<value> to control all actions or --strategy=Genrule=<value> to control genrules only.
default: ""
--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"
--grte_top=<label>
A label to a checked-in libc library. The default value is selected by the crosstool toolchain, and you almost never need to override it.
default: see description
action command_lines
affects outputs
--high_priority_workers=<string>
Mnemonics of workers to run with high priority. When high priority workers are running all other workers are throttled.
may be used multiple times
--host_compilation_mode=<fastbuild, dbg or opt>
Specify the mode the tools used during the build will be built in. Values: 'fastbuild', 'dbg', 'opt'.
default: "opt"
affects outputs
action command_lines
--host_compiler=<string>
The C++ compiler to use for host compilation. It is ignored if -- host_crosstool_top is not set.
default: see description
loading and_analysis
execution
--host_conlyopt=<string>
Additional option to pass to gcc when compiling C source files for host tools.
may be used multiple times
action command_lines
affects outputs
--host_copt=<string>
Additional options to pass to gcc for host tools.
may be used multiple times
action command_lines
affects outputs
--host_cpu=<string>
The host CPU.
default: ""
changes inputs
affects outputs
--host_crosstool_top=<build target label>
By default, the --crosstool_top and --compiler options are also used for the host configuration. If this flag is provided, Bazel uses the default libc and compiler for the given crosstool_top.
default: see description
loading and_analysis
changes inputs
affects outputs
--host_cxxopt=<string>
Additional options to pass to gcc for host tools.
may be used multiple times
action command_lines
affects outputs
--host_force_python=<PY2 or PY3>
Overrides the Python version for the host configuration. Can be "PY2" or "PY3".
default: see description
loading and_analysis
affects outputs
--host_grte_top=<label>
If specified, this setting overrides the libc top-level directory (-- grte_top) for the host configuration.
default: see description
action command_lines
affects outputs
--host_java_launcher=<build target label>
The Java launcher used by tools that are executed during a build.
default: see description
--host_java_toolchain=<build target label>
The Java toolchain used to build tools that are executed during a build.
default: "@bazel_tools//tools/jdk:remote_toolchain"
--host_javabase=<build target label>
JAVABASE used for the host JDK. This is the java_runtime which is used to execute tools during a build.
default: see description
--host_javacopt=<string>
Additional options to pass to javac when building tools that are executed during a build.
may be used multiple times
--host_linkopt=<string>
Additional option to pass to gcc when linking host tools.
may be used multiple times
action command_lines
affects outputs
--host_platform=<build target label>
The label of a platform rule that describes the host system.
default: ""
affects outputs
changes inputs
loading and_analysis
--host_swiftcopt=<string>
Additional options to pass to swiftc for host tools.
may be used multiple times
action command_lines
affects outputs
--ignore_unsupported_sandboxing=<true or false>
Do not print a warning when sandboxed execution is not supported on this system.
default: "false"
--incompatible_allow_python_version_transitions=<true or false>
If true, Python rules use the new PY2/PY3 version semantics. For more information, see the documentation for `py_binary`'s `python_version` attribute.
default: "true"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_bzl_disallow_load_after_statement=<true or false>
If set to true, all `load` must be called at the top of .bzl files, before any other statement.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_cc_coverage=<true or false>
If specified, Bazel will use gcov to collect code coverage for C++ test targets. This option only works for gcc compilation.
default: "true"
changes inputs
affects outputs
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_depset_is_not_iterable=<true or false>
If set to true, depset type is not iterable. For loops and functions expecting an iterable will reject depset objects. Use the `.to_list` method to explicitly convert to a list.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_depset_union=<true or false>
If set to true, depset union using `+`, `|` or `.union` are forbidden. Use the `depset` constructor instead.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disable_crosstool_file=<true or false>
If true, Bazel will not allow using the CROSSTOOL file for cc toolchain configuration. Instead, cc_toolchain should have a toolchain_config attribute that points to a rule written in Starlark that provides a CcToolchainConfigInfo provider. See https://github. com/bazelbuild/bazel/issues/7320 for more info.
default: "true"
loading and_analysis
triggered by_all_incompatible_changes
incompatible change
--incompatible_disable_deprecated_attr_params=<true or false>
If set to true, disable the deprecated parameters 'single_file' and 'non_empty' on attribute definition methods, such as attr.label().
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disable_expand_if_all_available_in_flag_set=<true or false>
If true, Bazel will not allow specifying expand_if_all_available in flag_sets(see https://github.com/bazelbuild/bazel/issues/7008 for migration instructions).
default: "true"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_disable_objc_provider_resources=<true or false>
If set to true, disallow use of deprecated resource fields on the Objc provider.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disable_third_party_license_checking=<true or false>
If true, disables all license checking logic. This overrides -- check_third_party_targets_have_licenses
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_dict_plus=<true or false>
If set to true, the `+` becomes disabled for dicts.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_filetype=<true or false>
If set to true, function `FileType` is not available.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_legacy_java_provider=<true or false>
If set to true, usages of old .java provider are disallowed.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_legacy_javainfo=<true or false>
If set to true, old-style JavaInfo provider construction is disallowed.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_legacy_py_provider=<true or false>
If set to true, native Python rules will neither produce nor consume the legacy "py" provider. Use PyInfo instead. Under this flag, passing the legacy provider to a Python target will be an error.
default: "true"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_load_labels_to_cross_package_boundaries=<true or false>
If set to true, the label argument to 'load' cannot cross a package boundary.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_native_in_build_file=<true or false>
If set to true, the native module is not accessible in BUILD files. Use for example `cc_library` instead of `native.cc_library`.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_disallow_old_style_args_add=<true or false>
If set to true, vectorized calls to Args#add are disallowed.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--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
triggered by_all_incompatible_changes
--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: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_dont_enable_host_nonhost_crosstool_features=<true or false>
If true, Bazel will not enable 'host' and 'nonhost' features in the c++ toolchain (see https://github.com/bazelbuild/bazel/issues/7407 for more information).
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_expand_directories=<true or false>
Controls whether directories are expanded to the list of files under that directory when added to Args, instead of replaced by the path of the directory.
default: "true"
incompatible change
triggered by_all_incompatible_changes
--incompatible_list_based_execution_strategy_selection=<true or false>
See https://github.com/bazelbuild/bazel/issues/7480
default: "false"
execution
incompatible change
triggered by_all_incompatible_changes
--incompatible_merge_genfiles_directory=<true or false>
If true, the genfiles directory is folded into the bin directory.
default: "true"
affects outputs
incompatible change
triggered by_all_incompatible_changes
--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: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_no_attr_license=<true or false>
If set to true, disables the function `attr.license`.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_no_output_attr_default=<true or false>
If set to true, disables the `default` parameter of the `attr.output` and `attr.output_list` attribute definition functions.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_no_support_tools_in_action_inputs=<true or false>
If set to true, tools should be passed to `ctx.actions.run()` and `ctx. actions.run_shell()` using the `tools` parameter instead of the `inputs` parameter. Furthermore, if this flag is set and a `tools` parameter is not passed to the action, it is an error for any tools to appear in the `inputs`.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_no_target_output_group=<true or false>
If set to true, disables the output_group field of the 'Target' Starlark type.
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_no_transitive_loads=<true or false>
If set to true, only symbols explicitly defined in the file can be loaded; symbols introduced by load are not implicitly re-exported.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_py2_outputs_are_suffixed=<true or false>
If true, targets built in the Python 2 configuration will appear under an output root that includes the suffix '-py2', while targets built for Python 3 will appear in a root with no Python-related suffix. This means that the `bazel-bin` convenience symlink will point to Python 3 targets rather than Python 2. If you enable this option it is also recommended to enable `-- incompatible_py3_is_default`.
default: "true"
affects outputs
incompatible change
triggered by_all_incompatible_changes
--incompatible_py3_is_default=<true or false>
If true, `py_binary` and `py_test` targets that do not set their `python_version` (or `default_python_version`) attribute will default to PY3 rather than to PY2. It is an error to set this flag without also enabling `--incompatible_allow_python_version_transitions`. If you set this flag it is also recommended to set `-- incompatible_py2_outputs_are_suffixed`.
default: "true"
loading and_analysis
affects outputs
incompatible change
triggered by_all_incompatible_changes
--incompatible_remap_main_repo=<true or false>
If set to true, will treat references to '@<main repo name>' the same as '@'.
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_remote_symlinks=<true or false>
If set to true, Bazel will represent symlinks in action outputs in the remote caching/execution protocol as such. The current behavior is for remote caches/executors to follow symlinks and represent them as files. See #6631 for details.
default: "true"
execution
incompatible change
triggered by_all_incompatible_changes
--incompatible_remove_cpu_and_compiler_attributes_from_cc_toolchain=<true or false>
If true, Bazel will complain when cc_toolchain.cpu and cc_toolchain. compiler attribtues are set (see https://github. com/bazelbuild/bazel/issues/7075 for migration instructions).
default: "true"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_remove_legacy_whole_archive=<true or false>
If true, Bazel will not link library dependencies as whole archive by default (see https://github.com/bazelbuild/bazel/issues/7362 for migration instructions).
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_remove_local_resources=<true or false>
Deprecate local_resources in favor of --local_ram_resources and -- local_cpu_resources.
default: "false"
execution
incompatible change
triggered by_all_incompatible_changes
--incompatible_remove_native_maven_jar=<true or false>
If set to true, the native maven_jar rule is disabled; only the Starlark version will be available
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_remove_old_python_version_api=<true or false>
If true, disables use of the `--force_python` flag and the `default_python_version` attribute for `py_binary` and `py_test`. Use the `--python_version` flag and `python_version` attribute instead, which have exactly the same meaning. This flag also disables `select()`-ing over `-- host_force_python`.
default: "true"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_require_ctx_in_configure_features=<true or false>
If true, Bazel will require 'ctx' parameter in to cc_common. configure_features (see https://github.com/bazelbuild/bazel/issues/7793 for more information).
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_strict_action_env=<true or false>
If true, Bazel uses an environment with a static value for PATH and does not inherit LD_LIBRARY_PATH or TMPDIR. Use --action_env=ENV_VARIABLE if you want to inherit specific environment variables from the client, but note that doing so can prevent cross-user caching if a shared cache is used.
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_strict_objc_module_maps=<true or false>
Propagates Objective-C module maps only to direct dependencies in the 'objc' provider, not to all transitive dependencies.
default: "false"
changes inputs
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_string_join_requires_strings=<true or false>
If set to true, the argument of `string.join` must be an iterable whose elements are strings. If set to false, elements are first converted to string. See https://github.com/bazelbuild/bazel/issues/7802
default: "false"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_symlinked_sandbox_expands_tree_artifacts_in_runfiles_tree=<true or false>
If enabled, the sandbox will expand tree artifacts in runfiles, thus the files that are contained in the tree artifact will be symlinked as individual files.
default: "true"
execution
triggered by_all_incompatible_changes
incompatible change
--incompatible_use_aapt2_by_default=<true or false>
Switch the Android rules to use aapt2 by default for resource processing. To resolve issues when migrating your app to build with aapt2, see https: //developer.android.com/studio/command-line/aapt2#aapt2_changes
default: "false"
loses incremental_state
affects outputs
incompatible change
triggered by_all_incompatible_changes
--incompatible_use_python_toolchains=<true or false>
If set to true, executable native Python rules will use the Python runtime specified by the Python toolchain, rather than the runtime given by legacy flags like --python_top.
default: "false"
loading and_analysis
incompatible change
triggered by_all_incompatible_changes
--incompatible_use_toolchain_providers_in_java_common=<true or false>
If set to true, java_common APIs that take a java_toolchain or host_javabase parameter require a JavaTootoolchainInfo or JavaRuntimeInfo instead of a configured target.
default: "true"
build file_semantics
incompatible change
triggered by_all_incompatible_changes
--incompatible_windows_escape_jvm_flags=<true or false>
On Linux/macOS/non-Windows: no-op. On Windows: this flag affects how java_binary and java_test targets are built; in particular, how the launcher of these targets escapes flags at the time of running the java_binary/java_test. When the flag is true, the launcher escapes the JVM flags using Windows-style escaping (correct behavior). When the flag is false, the launcher uses Bash-style escaping (buggy behavior). See https: //github.com/bazelbuild/bazel/issues/7072
default: "true"
action command_lines
affects outputs
incompatible change
triggered by_all_incompatible_changes
--incompatible_windows_native_test_wrapper=<true or false>
On Windows: if true, uses the C++ test wrapper to run tests, otherwise uses tools/test/test-setup.sh as on other platforms. On other platforms: no-op.
default: "false"
loading and_analysis
test runner
incompatible change
triggered by_all_incompatible_changes
--incremental_dexing=<true or false>
Does most of the work for dexing separately for each Jar file.
default: "true"
affects outputs
loading and_analysis
loses incremental_state
--instrument_test_targets=<true or false>
When coverage is enabled, specifies whether to consider instrumenting test rules. When set, test rules included by --instrumentation_filter are instrumented. Otherwise, test rules are always excluded from coverage instrumentation.
default: "false"
affects outputs
--instrumentation_filter=<comma-separated list of regex expressions with prefix '-' specifying excluded paths>
When coverage is enabled, only rules with names included by the specified regex-based filter will be instrumented. Rules prefixed with '-' are excluded instead. Note that only non-test rules are instrumented unless -- instrument_test_targets is enabled.
default: "-/javatests[/:],-/test/java[/:]"
affects outputs
--interface_shared_objects=<true or false>
Use interface shared objects if supported by the toolchain. All ELF toolchains currently support this setting.
default: "true"
loading and_analysis
affects outputs
affects outputs
--ios_cpu=<string>
Specifies to target CPU of iOS compilation.
default: "x86_64"
no op
deprecated
--ios_memleaks=<true or false>
Enable checking for memory leaks in ios_test targets.
default: "false"
action command_lines
--ios_minimum_os=<dotted version (for example '2.3' or '3.3alpha2.4')>
Minimum compatible iOS version for target simulators and devices.
default: see description
loses incremental_state
--ios_multi_cpus=<comma-separated list of options>
Comma-separated list of architectures to build an ios_application with. The result is a universal binary containing all specified architectures.
default: ""
loses incremental_state
loading and_analysis
--ios_sdk_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
Specifies the version of the iOS SDK to use to build iOS applications.
default: see description
loses incremental_state
--ios_signing_cert_name=<string>
Certificate name to use for iOS signing. If not set will fall back to provisioning profile. May be the certificate's keychain identity preference or (substring) of the certificate's common name, as per codesign's man page (SIGNING IDENTITIES).
default: see description
action command_lines
--ios_simulator_device=<string>
The device to simulate when running an iOS application in the simulator, e. g. 'iPhone 6'. You can get a list of devices by running 'xcrun simctl list devicetypes' on the machine the simulator will be run on.
default: "iPhone 5s"
test runner
--ios_simulator_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
The version of iOS to run on the simulator when running or testing. This is ignored for ios_test rules if a target device is specified in the rule.
default: "9.3"
test runner
--j2objc_translation_flags=<comma-separated list of options>
Additional options to pass to the J2ObjC tool.
may be used multiple times
--java_debug
Causes the Java virtual machine of a java test to wait for a connection from a JDWP-compliant debugger (such as jdb) before starting the test. Implies -test_output=streamed. Expands to: --test_arg=--wrapper_script_flag=--debug -- test_output=streamed --test_strategy=exclusive --test_timeout=9999 -- nocache_test_results
--java_deps=<true or false>
Generate dependency information (for now, compile-time classpath) per Java target.
default: "true"
--java_header_compilation=<true or false>
Compile ijars directly from source.
default: "true"
--java_launcher=<build target label>
The Java launcher to use when building Java binaries. The "launcher" attribute overrides this flag.
default: see description
--java_toolchain=<build target label>
The name of the toolchain rule for Java.
default: "@bazel_tools//tools/jdk:remote_toolchain"
--javabase=<build target label>
JAVABASE used for the JDK invoked by Blaze. This is the java_runtime which will be used to execute external Java commands.
default: "@bazel_tools//tools/jdk:jdk"
--javacopt=<string>
Additional options to pass to javac.
may be used multiple times
--jobs=<integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5">
The number of concurrent jobs to run. Takes {@value FLAG_SYNTAX}. Values must be between 1 and5000 values above 2500 may cause memory issues. "auto" calculates a reasonable default based on host resources.
default: "auto"
host machine_resource_optimizations
execution
--jvmopt=<string>
Additional options to pass to the Java VM. These options will get added to the VM startup options of each java_binary target.
may be used multiple times
--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_external_runfiles=<true or false>
If true, build runfiles symlink forests for external repositories under . runfiles/wsname/external/repo (in addition to .runfiles/repo).
default: "true"
affects outputs
--legacy_important_outputs=<true or false>
Use this to suppress generation of the legacy important_outputs field in the TargetComplete event.
default: "true"
affects outputs
--legacy_whole_archive=<true or false>
Deprecated, superseded by --incompatible_remove_legacy_whole_archive (see https://github.com/bazelbuild/bazel/issues/7362 for details). When on, use --whole-archive for cc_binary rules that have linkshared=1 and either linkstatic=1 or '-static' in linkopts. This is for backwards compatibility only. A better alternative is to use alwayslink=1 where required.
default: "true"
action command_lines
affects outputs
deprecated
--linkopt=<string>
Additional option to pass to gcc when linking.
may be used multiple times
action command_lines
affects outputs
--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 onhost resources. Must be at least 1.
default: "auto"
bazel internal_configuration
--local_cpu_resources=<integer, or "HOST_CPUS", optionally followed by [-|*]<float>.>
Explicitly set the number of local CPU threads available to Bazel. Takes an integer, or "HOST_CPUS", optionally followed by [-|*]<float> (eg. HOST_CPUS*.5 to use half the available CPU cores).By default, ("HOST_CPUS"), Bazel will query system configuration to estimate number of CPU cores available for the locally executed build actions. Note: This is a no-op if --local_resources is set.
default: "HOST_CPUS"
--local_ram_resources=<integer, or "HOST_RAM", optionally followed by [-|*]<float>.>
Explicitly set the amount of local host RAM (in MB) available to Bazel. Takes an integer, or "HOST_RAM", optionally followed by [-|*]<float> (eg. HOST_RAM*.5 to use half the available RAM).By default, ("HOST_RAM*.67"), Bazel will query system configuration to estimate amount of RAM available for the locally executed build actions and will use 67% of available RAM. Note: This is a no-op if --ram_utilization_factor or --local_resources is set.
default: "HOST_RAM*.67"
--local_resources=<comma-separated available amount of RAM (in MB), CPU (in cores) and available I/O (1.0 being average workstation)>
Explicitly set amount of local resources available to Blaze. By default, Bazel will query system configuration to estimate amount of RAM (in MB) and number of CPU cores available for the locally executed build actions. It would also assume default I/O capabilities of the local workstation (1.0). This options allows to explicitly set all 3 values. Note, that if this option is used, Bazel will ignore --ram_utilization_factor, --local_cpu_resources, and --local_ram_resources.
default: see description
--local_termination_grace_seconds=<integer>
Time to wait between terminating a local process due to timeout and forcefully shutting it down.
default: "15"
--local_test_jobs=<integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5">
The max number of local test jobs to run concurrently. Takes an integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5". 0 means local resources will limit the number of local test jobs to run concurrently instead. Setting this greater than the value for --jobs is ineffectual.
default: "auto"
--logging=<0 <= an integer <= 6>
The logging level.
default: "3"
affects outputs
--ltobackendopt=<string>
Additional option to pass to the LTO backend step (under -- features=thin_lto).
may be used multiple times
action command_lines
affects outputs
--ltoindexopt=<string>
Additional option to pass to the LTO indexing step (under -- features=thin_lto).
may be used multiple times
action command_lines
affects outputs
--macos_cpus=<comma-separated list of options>
Comma-separated list of architectures for which to build Apple macOS binaries.
default: "x86_64"
loses incremental_state
loading and_analysis
--macos_minimum_os=<dotted version (for example '2.3' or '3.3alpha2.4')>
Minimum compatible macOS version for targets.
default: see description
loses incremental_state
--macos_sdk_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
Specifies the version of the macOS SDK to use to build macOS applications.
default: see description
loses incremental_state
--materialize_param_files=<true or false>
Writes intermediate parameter files to output tree even when using remote action execution. Useful when debugging actions.
default: "false"
--max_config_changes_to_show=<integer>
When discarding the analysis cache due to a change in the build options, displays up to the given number of changed option names. If the number given is -1, all changed options will be displayed.
default: "3"
terminal output
--memory_profile_stable_heap_parameters=<two integers, separated by a comma>
Tune memory profile's computation of stable heap at end of build. Should be two integers separated by a comma. First parameter is the number of GCs to perform. Second parameter is the number of seconds to wait between GCs.
default: "1,0"
bazel monitoring
--message_translations=<string>
The message translations used for translating messages in Java targets.
may be used multiple times
--minimum_os_version=<string>
The minimum OS version which your compilation targets.
default: see description
loading and_analysis
affects outputs
--modify_execution_info=<regex=[+-]key,regex=[+-]key,...>
Add or remove keys from an action's execution info based on action mnemonic. Applies only to actions which support execution info. Many common actions support execution info, e.g. Genrule, CppCompile, Javac, SkylarkAction, TestRunner. When specifying multiple values, order matters because many regexes may apply to the same mnemonic. Syntax: "regex=[+-]key,[+-]key,...". Examples: '.*=+x,.*=-y,.*=+z' adds 'x' and 'z' to, and removes 'y' from, the execution info for all actions. 'Genrule=+requires-x' adds 'requires-x' to the execution info for all Genrule actions. '(?!Genrule).*=-requires-x' removes 'requires-x' from the execution info for all non-Genrule actions.
default: ""
execution
affects outputs
loading and_analysis
--objc_debug_with_GLIBCXX=<true or false>
If set, and compilation mode is set to 'dbg', define GLIBCXX_DEBUG, GLIBCXX_DEBUG_PEDANTIC and GLIBCPP_CONCEPT_CHECKS.
default: "false"
action command_lines
--objc_enable_binary_stripping=<true or false>
Whether to perform symbol and dead-code strippings on linked binaries. Binary strippings will be performed if both this flag and -- compilationMode=opt are specified.
default: "false"
action command_lines
--objc_generate_linkmap=<true or false>
Specifies whether to generate a linkmap file.
default: "false"
affects outputs
--objc_header_scanner_tool=<build target label>
Location of tool to scan Objective-C code for inclusions and output a . headers_list file.
default: "@bazel_tools//tools/objc:header_scanner"
changes inputs
--objc_header_thinning_partition_size=<integer>
The maximum number of source files to process within in each header scanning action.
default: "120"
host machine_resource_optimizations
--objc_use_dotd_pruning=<true or false>
If set, .d files emitted by clang will be used to prune the set of inputs passed into objc compiles.
default: "true"
changes inputs
loading and_analysis
--objccopt=<string>
Additional options to pass to Objective C compilation.
may be used multiple times
action command_lines
--output_filter=<valid Java regular expression>
Only shows warnings for rules with a name matching the provided regular expression.
default: see description
affects outputs
--output_groups=<comma-separated list of options>
Specifies which output groups of the top-level targets to build. If omitted, a default set of output groups are built. When specified the default set is overridden. However you may use -- output_groups=+<output_group> or --output_groups=-<output_group> to instead modify the set of output groups.
may be used multiple times
execution
affects outputs
--override_repository=<equals-separated mapping of repository name to path>
Overrides a repository with a local directory.
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%"
--parse_headers_verifies_modules=<true or false>
If enabled, the parse_headers feature verifies that a header module can be built for the target in question instead of doing a separate compile of the header.
default: "false"
loading and_analysis
changes inputs
--per_file_copt=<comma-separated list of regex expressions with prefix '-' specifying excluded paths followed by an @ and a comma separated list of options>
Additional options to selectively pass to gcc when compiling certain files. This option can be passed multiple times. Syntax: regex_filter@option_1, option_2,...,option_n. Where regex_filter stands for a list of include and exclude regular expression patterns (Also see --instrumentation_filter). option_1 to option_n stand for arbitrary command line options. If an option contains a comma it has to be quoted with a backslash. Options can contain @. Only the first @ is used to split the string. Example: -- per_file_copt=//foo/.*\.cc,-//foo/bar\.cc@-O0 adds the -O0 command line option to the gcc command line of all cc files in //foo/ except bar.cc.
may be used multiple times
action command_lines
affects outputs
--per_file_ltobackendopt=<comma-separated list of regex expressions with prefix '-' specifying excluded paths followed by an @ and a comma separated list of options>
Additional options to selectively pass to LTO backend (under -- features=thin_lto) when compiling certain backend objects. This option can be passed multiple times. Syntax: regex_filter@option_1,option_2,..., option_n. Where regex_filter stands for a list of include and exclude regular expression patterns. option_1 to option_n stand for arbitrary command line options. If an option contains a comma it has to be quoted with a backslash. Options can contain @. Only the first @ is used to split the string. Example: --per_file_ltobackendopt=//foo/.*\.o,-//foo/bar\.o@-O0 adds the -O0 command line option to the LTO backend command line of all o files in //foo/ except bar.o.
may be used multiple times
action command_lines
affects outputs
--persistent_android_resource_processor
Enable the persistent Android resource processor by using workers. Expands to: --internal_persistent_busybox_tools -- strategy=AaptPackage=worker --strategy=AndroidResourceParser=worker -- strategy=AndroidResourceValidator=worker -- strategy=AndroidResourceCompiler=worker --strategy=RClassGenerator=worker --strategy=AndroidResourceLink=worker --strategy=AndroidAapt2=worker -- strategy=AndroidAssetMerger=worker -- strategy=AndroidResourceMerger=worker -- strategy=AndroidCompiledResourceMerger=worker
host machine_resource_optimizations
execution
--platform_mappings=<relative path>
The location of a mapping file that describes which platform to use if none is set or which flags to set when a platform already exists. Must be relative to the main workspace root. Defaults to 'platform_mappings' (a file directly under the workspace root).
default: ""
affects outputs
changes inputs
loading and_analysis
--platform_suffix=<string>
Specifies a suffix to be added to the configuration directory.
default: see description
loses incremental_state
affects outputs
loading and_analysis
--platforms=<build target label>
The labels of the platform rules describing the target platforms for the current command.
default: ""
affects outputs
changes inputs
loading and_analysis
--plugin=<build target label>
Plugins to use in the build. Currently works with java_plugin.
may be used multiple times
--print_relative_test_log_paths=<true or false>
If true, when printing the path to a test log, use relative path that makes use of the 'testlogs' convenience symlink. N.B. - A subsequent 'build'/'test'/etc invocation with a different configuration can cause the target of this symlink to change, making the path printed previously no longer useful.
default: "false"
affects outputs
--process_headers_in_dependencies=<true or false>
When building a target //a:a, process headers in all targets that //a:a depends on (if header processing is enabled for the toolchain).
default: "false"
execution
--profile=<path>
If set, profile Bazel and write data to the specified file. Use bazel analyze-profile to analyze the profile.
default: see description
affects outputs
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"
--progress_report_interval=<integer in 0-3600 range>
The number of seconds to wait between two reports on still running jobs. The default value 0 means to use the default 10:30:60 incremental algorithm.
default: "0"
affects outputs
--proguard_top=<build target label>
Specifies which version of ProGuard to use for code removal when building a Java binary.
default: see description
--project_id=<string>
Specifies the BES project identifier. Defaults to null.
default: see description
affects outputs
--proto_compiler=<build target label>
The label of the proto-compiler.
default: "@com_google_protobuf//:protoc"
affects outputs
loading and_analysis
--proto_toolchain_for_cc=<build target label>
Label of proto_lang_toolchain() which describes how to compile C++ protos
default: "@com_google_protobuf//:cc_toolchain"
affects outputs
loading and_analysis
--proto_toolchain_for_j2objc=<build target label>
Label of proto_lang_toolchain() which describes how to compile j2objc protos
default: "@bazel_tools//tools/j2objc:j2objc_proto_toolchain"
affects outputs
loading and_analysis
--proto_toolchain_for_java=<build target label>
Label of proto_lang_toolchain() which describes how to compile Java protos
default: "@com_google_protobuf//:java_toolchain"
affects outputs
loading and_analysis
--proto_toolchain_for_javalite=<build target label>
Label of proto_lang_toolchain() which describes how to compile JavaLite protos
default: "@com_google_protobuf_javalite//:javalite_toolchain"
affects outputs
loading and_analysis
--protocopt=<string>
Additional options to pass to the protobuf compiler.
may be used multiple times
affects outputs
--python_path=<string>
The absolute path of the Python interpreter invoked to run Python targets on the target platform. Deprecated; disabled by -- incompatible_use_python_toolchains.
default: see description
loading and_analysis
affects outputs
--python_top=<build target label>
The label of a py_runtime representing the Python interpreter invoked to run Python targets on the target platform. Deprecated; disabled by -- incompatible_use_python_toolchains.
default: see description
loading and_analysis
affects outputs
--python_version=<PY2 or PY3>
The Python major version mode, either `PY2` or `PY3`. Note that under the new version semantics (`--incompatible_allow_python_version_transitions`) this is overridden by `py_binary` and `py_test` targets (even if they don't explicitly specify a version) so there is usually not much reason to supply this flag.
default: see description
loading and_analysis
affects outputs
--python2_path=<string>
Deprecated, no-op. Disabled by `--incompatible_use_python_toolchains`.
default: see description
no op
deprecated
--python3_path=<string>
Deprecated, no-op. Disabled by `--incompatible_use_python_toolchains`.
default: see description
no op
deprecated
--ram_utilization_factor=<integer>
Specify what percentage of the system's RAM Bazel should try to use for its subprocesses. This option affects how many processes Bazel will try to run in parallel. If you run several Bazel builds in parallel, using a lower value for this option may avoid thrashing and thus improve overall throughput. Using a value higher than 67 is NOT recommended. Note that Blaze's estimates are very coarse, so the actual RAM usage may be much higher or much lower than specified. Note also that this option does not affect the amount of memory that the Bazel server itself will use. Setting this value overrides --local_ram_resources
default: "0"
--remote_accept_cached=<true or false>
Whether to accept remotely cached action results.
default: "true"
--remote_allow_symlink_upload=<true or false>
If true, upload action symlink outputs to the remote cache. If this option is not enabled, cachable actions that output symlinks will fail.
default: "true"
execution
--remote_cache=<string>
A URI of a caching endpoint. The supported schemas are http(s) and grpc. If no schema is provided we'll default to grpc. See https://docs.bazel.build/versions/master/remote-caching.html
default: see description
--remote_cache_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) for the HTTP cache.
default: see description
--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_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.
default: see description
--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>
The strategy to use when remote execution has to fallback to local execution.
default: "local"
--remote_max_connections=<integer>
The max. number of concurrent network connections to the remote cache/executor. By default Bazel limits the number of TCP connections to 100. Setting this flag to 0 will make Bazel choose the number of connections automatically.
default: "100"
host machine_resource_optimizations
--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_timeout=<integer>
The maximum number of seconds to wait for remote execution and cache calls. For the REST cache, this is both the connect and the read timeout.
default: "60"
--remote_upload_local_results=<true or false>
Whether to upload locally executed action results to the remote cache.
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"
--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.
default: see description
bazel internal_configuration
--resource_autosense=<true or false>
This flag has no effect, and is deprecated
default: "false"
--run_under=<prefix in front of command>
Prefix to insert in front of command before running. Examples: --run_under=valgrind --run_under=strace --run_under='strace -c' --run_under='valgrind --quiet --num-callers=20' --run_under=//package:target --run_under='//package:target --options'
default: see description
action command_lines
--runs_per_test=<positive integer or test_regex@runs. This flag may be passed more than once>
Specifies number of times to run each test. If any of those attempts fail for any reason, the whole test would be considered failed. Normally the value specified is just an integer. Example: --runs_per_test=3 will run all tests 3 times. Alternate syntax: regex_filter@runs_per_test. Where runs_per_test stands for an integer value and regex_filter stands for a list of include and exclude regular expression patterns (Also see --instrumentation_filter). Example: --runs_per_test=//foo/.*,-//foo/bar/.*@3 runs all tests in //foo/ except those under foo/bar three times. This option can be passed multiple times.
may be used multiple times
--runs_per_test_detects_flakes=<true or false>
If true, any shard in which at least one run/attempt passes and at least one run/attempt fails gets a FLAKY status.
default: "false"
--sandbox_add_mount_pair=<single path or a 'source:target' pair>
Add additional path pair to mount in sandbox.
may be used multiple times
--sandbox_block_path=<string>
For sandboxed actions, disallow access to this path.
may be used multiple times
--sandbox_debug=<true or false>
Enables debugging features for the sandboxing feature. This includes two things: first, the sandbox root contents are left untouched after a build (and if sandboxfs is in use, the file system is left mounted); and second, prints extra debugging information on execution. This can help developers of Bazel or Starlark rules with debugging failures due to missing input files, etc.
default: "false"
--sandbox_fake_hostname=<true or false>
Change the current hostname to 'localhost' for sandboxed actions.
default: "false"
--sandbox_fake_username=<true or false>
Change the current username to 'nobody' for sandboxed actions.
default: "false"
--sandbox_tmpfs_path=<string>
For sandboxed actions, mount an empty, writable directory at this path (if supported by the sandboxing implementation, ignored otherwise).
may be used multiple times
--sandbox_writable_path=<string>
For sandboxed actions, make an existing directory writable in the sandbox (if supported by the sandboxing implementation, ignored otherwise).
may be used multiple times
--save_temps=<true or false>
If set, temporary outputs from gcc will be saved. These include .s files (assembler code), .i files (preprocessed C) and .ii files (preprocessed C++).
default: "false"
affects outputs
--share_native_deps=<true or false>
If true, native libraries that contain identical functionality will be shared among different targets
default: "true"
loading and_analysis
affects outputs
--shell_executable=<path>
Absolute path to the shell executable for Bazel to use. If this is unset, but the BAZEL_SH environment variable is set on the first Bazel invocation (that starts up a Bazel server), Bazel uses that. If neither is set, Bazel uses a hard-coded default path depending on the operating system it runs on (Windows: c:/tools/msys64/usr/bin/bash.exe, FreeBSD: /usr/local/bin/bash, all others: /bin/bash). Note that using a shell that is not compatible with bash may lead to build failures or runtime failures of the generated binaries.
default: see description
loading and_analysis
--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_result=<integer>
Show the results of the build. For each target, state whether or not it was brought up-to-date, and if so, a list of output files that were built. The printed files are convenient strings for copy+pasting to the shell, to execute them. This option requires an integer argument, which is the threshold number of targets above which result information is not printed. Thus zero causes suppression of the message and MAX_INT causes printing of the result to occur always. The default is one.
default: "1"
affects outputs
--show_task_finish=<true or false>
Display progress messages when tasks complete, not just when they start.
default: "false"
--show_timestamps=<true or false>
Include timestamps in messages
default: "false"
--spawn_strategy=<comma-separated list of options>
Specify how spawn actions are executed by default. 'standalone' means run all of them locally without any kind of sandboxing. 'sandboxed' means to run them in a sandboxed environment with limited privileges (details depend on platform support).
default: ""
--stamp=<true or false>
Stamp binaries with the date, username, hostname, workspace information, etc.
default: "false"
affects outputs
--strategy=<'name=value1[,..,valueN]' assignment>
Specify how to distribute compilation of other spawn actions. Example: 'Javac=local' means to spawn Java compilation locally. 'JavaIjar=sandboxed' means to spawn Java Ijar actions in a sandbox.
may be used multiple times
--strategy_regexp=<'<RegexFilter>=value[,value]' assignment>
Override which spawn strategy should be used to execute spawn actions that have descriptions matching a certain regex_filter. See --per_file_copt for details onregex_filter matching. The first regex_filter that matches the description is used. This option overrides other flags for specifying strategy. Example: --strategy_regexp=//foo.*\.cc,-//foo/bar=local means to run actions using local strategy if their descriptions match //foo.*.cc but not //foo/bar. Example: --strategy_regexp='Compiling.*/bar=local --strategy_regexp=Compiling=sandboxed will run 'Compiling //foo/bar/baz' with the 'local' strategy, but reversing the order would run it with 'sandboxed'.
may be used multiple times
--strict_filesets=<true or false>
If this option is enabled, filesets crossing package boundaries are reported as errors. It does not work when check_fileset_dependencies_recursively is disabled.
default: "false"
build file_semantics
eagerness to_exit
--strict_proto_deps=<off, warn, error, strict or default>
Unless OFF, checks that a proto_library target explicitly declares all directly used targets as dependencies.
default: "error"
build file_semantics
eagerness to_exit
incompatible change
--strict_system_includes=<true or false>
If true, headers found through system include paths (-isystem) are also required to be declared.
default: "false"
loading and_analysis
eagerness to_exit
--strip=<always, sometimes or never>
Specifies whether to strip binaries and shared libraries (using "-Wl,-- strip-debug"). The default value of 'sometimes' means strip iff -- compilation_mode=fastbuild.
default: "sometimes"
affects outputs
--stripopt=<string>
Additional options to pass to strip when generating a '<name>.stripped' binary.
may be used multiple times
action command_lines
affects outputs
--subcommands=<true, pretty_print or false>
Display the subcommands executed during a build.
default: "false"
--swiftcopt=<string>
Additional options to pass to Swift compilation.
may be used multiple times
action command_lines
--symlink_prefix=<string>
The prefix that is prepended to any of the convenience symlinks that are created after a build. If '/' is passed, then no symlinks are created and no warning is emitted. If omitted, the default value is the name of the build tool.
default: see description
affects outputs
--target_environment=<build target label>
Declares this build's target environment. Must be a label reference to an "environment" rule. If specified, all top-level targets must be compatible with this environment.
may be used multiple times
changes inputs
--target_platform_fallback=<build target label>
The label of a platform rule that should be used if no target platform is set and no platform mapping matches the current set of flags.
default: "@bazel_tools//platforms:target_platform"
affects outputs
changes inputs
loading and_analysis
--test_arg=<string>
Specifies additional options and arguments that should be passed to the test executable. Can be used multiple times to specify several arguments. If multiple tests are executed, each of them will receive identical arguments. Used only by the 'bazel test' command.
may be used multiple times
--test_env=<'name=value' assignment with an optional value part>
Specifies additional environment variables to be injected into the test runner environment. Variables can be either specified by name, in which case its value will be read from the Bazel client environment, or by the name=value pair. This option can be used multiple times to specify several variables. Used only by the 'bazel test' command.
may be used multiple times
test runner
--test_filter=<string>
Specifies a filter to forward to the test framework. Used to limit the tests run. Note that this does not affect which targets are built.
default: see description
--test_keep_going=<true or false>
When disabled, any non-passing test will cause the entire build to stop. By default all tests are run, even if some do not pass.
default: "true"
--test_lang_filters=<comma-separated list of options>
Specifies a comma-separated list of test languages. Each language can be optionally preceded with '-' to specify excluded languages. Only those test targets will be found that are written in the specified languages. The name used for each language should be the same as the language prefix in the *_test rule, e.g. one of 'cc', 'java', 'py', etc. This option affects --build_tests_only behavior and the test command.
default: ""
--test_output=<summary, errors, all or streamed>
Specifies desired output mode. Valid values are 'summary' to output only test status summary, 'errors' to also print test logs for failed tests, 'all' to print logs for all tests and 'streamed' to output logs for all tests in real time (this will force tests to be executed locally one at a time regardless of --test_strategy value).
default: "summary"
--test_result_expiration=<integer>
This option is deprecated and has no effect.
default: "-1"
--test_sharding_strategy=<explicit or disabled>
Specify strategy for test sharding: 'explicit' to only use sharding if the 'shard_count' BUILD attribute is present. 'disabled' to never use test sharding.
default: "explicit"
--test_size_filters=<comma-separated list of values: small, medium, large or enormous>
Specifies a comma-separated list of test sizes. Each size can be optionally preceded with '-' to specify excluded sizes. Only those test targets will be found that contain at least one included size and do not contain any excluded sizes. This option affects --build_tests_only behavior and the test command.
default: ""
--test_strategy=<string>
Specifies which strategy to use when running tests.
default: ""
--test_summary=<short, terse, detailed, none or testcase>
Specifies the desired format ot the test summary. Valid values are 'short' to print information only about tests executed, 'terse', to print information only about unsuccessful tests that were run, 'detailed' to print detailed information about failed test cases, and 'none' to omit the summary.
default: "short"
--test_tag_filters=<comma-separated list of options>
Specifies a comma-separated list of test tags. Each tag can be optionally preceded with '-' to specify excluded tags. Only those test targets will be found that contain at least one included tag and do not contain any excluded tags. This option affects --build_tests_only behavior and the test command.
default: ""
--test_timeout=<single integer or comma-separated list of 4 integers>
Override the default test timeout values for test timeouts (in secs). If a single positive integer value is specified it will override all categories. If 4 comma-separated integers are specified, they will override the timeouts for short, moderate, long and eternal (in that order). In either form, a value of -1 tells blaze to use its default timeouts for that category.
default: "-1"
--test_timeout_filters=<comma-separated list of values: short, moderate, long or eternal>
Specifies a comma-separated list of test timeouts. Each timeout can be optionally preceded with '-' to specify excluded timeouts. Only those test targets will be found that contain at least one included timeout and do not contain any excluded timeouts. This option affects --build_tests_only behavior and the test command.
default: ""
--test_tmpdir=<path>
Specifies the base temporary directory for 'bazel test' to use.
default: see description
--test_verbose_timeout_warnings=<true or false>
If true, print additional warnings when the actual test execution time does not match the timeout defined by the test (whether implied or explicit).
default: "false"
affects outputs
--tls_certificate=<string>
Specify the TLS client certificate to use.
default: see description
--tls_enabled=<true or false>
Specifies whether to use TLS for remote execution/caching and the build event service (BES).
default: "false"
--tool_tag=<string>
A tool name to attribute this Bazel invocation to.
default: ""
affects outputs
bazel monitoring
--toolchain_resolution_debug=<true or false>
Print debug information while finding toolchains for a rule. This might help developers of Bazel or Starlark rules with debugging failures due to missing toolchains.
default: "false"
terminal output
--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
--translations=<tri-state (auto, yes, no)>
Translate Java messages; bundle all translations into the jar for each affected rule.
default: "auto"
--trim_test_configuration=<true or false>
When enabled, test-related options will be cleared below the top level of the build. When this flag is active, tests cannot be built as dependencies of non-test rules, but changes to test-related options will not cause non- test rules to be re-analyzed.
default: "false"
loading and_analysis
loses incremental_state
--tvos_cpus=<comma-separated list of options>
Comma-separated list of architectures for which to build Apple tvOS binaries.
default: "x86_64"
loses incremental_state
loading and_analysis
--tvos_minimum_os=<dotted version (for example '2.3' or '3.3alpha2.4')>
Minimum compatible tvOS version for target simulators and devices.
default: see description
loses incremental_state
--tvos_sdk_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
Specifies the version of the tvOS SDK to use to build tvOS applications.
default: see description
loses incremental_state
--tvos_simulator_device=<string>
The device to simulate when running an tvOS application in the simulator, e. g. 'Apple TV 1080p'. You can get a list of devices by running 'xcrun simctl list devicetypes' on the machine the simulator will be run on.
default: "Apple TV 1080p"
test runner
--tvos_simulator_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
The version of tvOS to run on the simulator when running or testing.
default: "9.0"
test runner
--ui=<true or false>
Switches to a progress bar that more explicitly shows progress, such as loaded packages and executed actions.
default: "true"
--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. This option has no effect if --noui is set.
default: "8"
--use_ijars=<true or false>
If enabled, this option causes Java compilation to use interface jars. This will result in faster incremental compilation, but error messages can be different.
default: "true"
--use_singlejar_apkbuilder=<true or false>
Build Android APKs with SingleJar.
default: "true"
loading and_analysis
--verbose_explanations=<true or false>
Increases the verbosity of the explanations issued if --explain is enabled. Has no effect if --explain is not enabled.
default: "false"
affects outputs
--verbose_failures=<true or false>
If a command fails, print out the full command line.
default: "false"
--verbose_test_summary=<true or false>
If true, print additional information (timing, number of failed runs, etc) in the test summary.
default: "true"
affects outputs
--watchfs=<true or false>
If true, bazel tries to use the operating system's file watch service for local changes instead of scanning every file for a change.
default: "false"
--watchos_cpus=<comma-separated list of options>
Comma-separated list of architectures for which to build Apple watchOS binaries.
default: "i386"
loses incremental_state
loading and_analysis
--watchos_minimum_os=<dotted version (for example '2.3' or '3.3alpha2.4')>
Minimum compatible watchOS version for target simulators and devices.
default: see description
loses incremental_state
--watchos_sdk_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
Specifies the version of the watchOS SDK to use to build watchOS applications.
default: see description
loses incremental_state
--watchos_simulator_device=<string>
The device to simulate when running an watchOS application in the simulator, e.g. 'Apple Watch - 38mm'. You can get a list of devices by running 'xcrun simctl list devicetypes' on the machine the simulator will be run on.
default: "Apple Watch - 38mm"
test runner
--watchos_simulator_version=<dotted version (for example '2.3' or '3.3alpha2.4')>
The version of watchOS to run on the simulator when running or testing.
default: "2.0"
test runner
--worker_extra_flag=<'name=value' assignment>
Extra command-flags that will be passed to worker processes in addition to --persistent_worker, keyed by mnemonic (e.g. --worker_extra_flag=Javac=--debug.
may be used multiple times
--worker_max_instances=<[name=]value, where value is an integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5">
How many instances of a worker process (like the persistent Java compiler) may be launched if you use the 'worker' strategy. May be specified as [name=value] to give a different value per worker mnemonic. Takesan integer, or a keyword ("auto", "HOST_CPUS", "HOST_RAM"), optionally followed by an operation ([-|*]<float>) eg. "auto", "HOST_CPUS*.5". 'auto' calculates a reasonable default based on machine capacity."=value" sets a default for unspecified mnemonics.
may be used multiple times
--worker_quit_after_build=<true or false>
If enabled, all workers quit after a build is done.
default: "false"
--worker_sandboxing=<true or false>
If enabled, workers will be executed in a sandboxed environment.
default: "false"
--worker_verbose=<true or false>
If enabled, prints verbose messages when workers are started, shutdown, ...
default: "false"
--workspace_status_command=<path>
A command invoked at the beginning of the build to provide status information about the workspace in the form of key/value pairs. See the User's Manual for the full specification.
default: ""
--xbinary_fdo=<build target label>
Use XbinaryFDO profile information to optimize compilation. Specify the name of default cross binary profile. When the option is used together with --fdo_instrument/--fdo_optimize/--fdo_profile, those options will always prevail as if xbinary_fdo is never specified.
default: see description
affects outputs
--xcode_version=<string>
If specified, uses Xcode of the given version for relevant build actions. If unspecified, uses the executor default version of Xcode.
default: see description
loses incremental_state
--xcode_version_config=<build target label>
The label of the xcode_config rule to be used for selecting the Xcode version in the build configuration.
default: "@local_config_xcode//:host_xcodes"
loses incremental_state
loading and_analysis