aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java690
1 files changed, 392 insertions, 298 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index c38cfc2e5e..8c733c5db1 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -75,6 +75,7 @@ import com.google.devtools.common.options.Converter;
import com.google.devtools.common.options.Converters;
import com.google.devtools.common.options.EnumConverter;
import com.google.devtools.common.options.Option;
+import com.google.devtools.common.options.OptionsParser.OptionUsageRestrictions;
import com.google.devtools.common.options.OptionsParsingException;
import com.google.devtools.common.options.TriState;
import java.util.ArrayList;
@@ -479,123 +480,153 @@ public final class BuildConfiguration {
*/
public static class Options extends FragmentOptions implements Cloneable {
@Option(
- name = "define",
- converter = Converters.AssignmentConverter.class,
- defaultValue = "",
- category = "semantics",
- allowMultiple = true,
- help = "Each --define option specifies an assignment for a build variable."
+ name = "define",
+ converter = Converters.AssignmentConverter.class,
+ defaultValue = "",
+ category = "semantics",
+ allowMultiple = true,
+ help = "Each --define option specifies an assignment for a build variable."
)
public List<Map.Entry<String, String>> commandLineBuildVariables;
- @Option(name = "cpu",
- defaultValue = "",
- category = "semantics",
- converter = AutoCpuConverter.class,
- help = "The target CPU.")
+ @Option(
+ name = "cpu",
+ defaultValue = "",
+ category = "semantics",
+ converter = AutoCpuConverter.class,
+ help = "The target CPU."
+ )
public String cpu;
/**
* Allows a configuration to record if --experimental_multi_cpu was used to set a cpu value.
- * This is necessary to ensure that a configuration transition that sets cpu does not erase
- * the difference between a pair of configurations created by --experimental_multi_cpu, leading
- * to a crash when the configurations are treated as the same.
+ * This is necessary to ensure that a configuration transition that sets cpu does not erase the
+ * difference between a pair of configurations created by --experimental_multi_cpu, leading to a
+ * crash when the configurations are treated as the same.
*
* <p>TODO(b/33780512): Remove once dynamic configurations are used.
*/
- @Option(name = "experimental multi cpu distinguisher",
- defaultValue = "",
- category = "internal")
+ @Option(
+ name = "experimental multi cpu distinguisher",
+ defaultValue = "",
+ optionUsageRestrictions = OptionUsageRestrictions.INTERNAL
+ )
public String experimentalMultiCpuDistinguisher;
- @Option(name = "min_param_file_size",
- defaultValue = "32768",
- category = "undocumented",
- help = "Minimum command line length before creating a parameter file.")
+ @Option(
+ name = "min_param_file_size",
+ defaultValue = "32768",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help = "Minimum command line length before creating a parameter file."
+ )
public int minParamFileSize;
- @Option(name = "experimental_extended_sanity_checks",
- defaultValue = "false",
- category = "undocumented",
- help = "Enables internal validation checks to make sure that configured target "
- + "implementations only access things they should. Causes a performance hit.")
+ @Option(
+ name = "experimental_extended_sanity_checks",
+ defaultValue = "false",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help =
+ "Enables internal validation checks to make sure that configured target "
+ + "implementations only access things they should. Causes a performance hit."
+ )
public boolean extendedSanityChecks;
- @Option(name = "experimental_allow_runtime_deps_on_neverlink",
- defaultValue = "true",
- category = "undocumented",
- help = "Flag to help transition from allowing to disallowing runtime_deps on neverlink"
- + " Java archives. The depot needs to be cleaned up to roll this out by default.")
+ @Option(
+ name = "experimental_allow_runtime_deps_on_neverlink",
+ defaultValue = "true",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help =
+ "Flag to help transition from allowing to disallowing runtime_deps on neverlink"
+ + " Java archives. The depot needs to be cleaned up to roll this out by default."
+ )
public boolean allowRuntimeDepsOnNeverLink;
- @Option(name = "strict_filesets",
- defaultValue = "false",
- category = "semantics",
- help = "If this option is enabled, filesets crossing package boundaries are reported "
- + "as errors. It does not work when check_fileset_dependencies_recursively is "
- + "disabled.")
+ @Option(
+ name = "strict_filesets",
+ defaultValue = "false",
+ category = "semantics",
+ help =
+ "If this option is enabled, filesets crossing package boundaries are reported "
+ + "as errors. It does not work when check_fileset_dependencies_recursively is "
+ + "disabled."
+ )
public boolean strictFilesets;
// Plugins are build using the host config. To avoid cycles we just don't propagate
// this option to the host config. If one day we decide to use plugins when building
// host tools, we can improve this by (for example) creating a compiler configuration that is
// used only for building plugins.
- @Option(name = "plugin",
- converter = LabelConverter.class,
- allowMultiple = true,
- defaultValue = "",
- category = "flags",
- help = "Plugins to use in the build. Currently works with java_plugin.")
+ @Option(
+ name = "plugin",
+ converter = LabelConverter.class,
+ allowMultiple = true,
+ defaultValue = "",
+ category = "flags",
+ help = "Plugins to use in the build. Currently works with java_plugin."
+ )
public List<Label> pluginList;
- @Option(name = "plugin_copt",
- converter = PluginOptionConverter.class,
- allowMultiple = true,
- category = "flags",
- defaultValue = ":",
- help = "Plugin options")
+ @Option(
+ name = "plugin_copt",
+ converter = PluginOptionConverter.class,
+ allowMultiple = true,
+ category = "flags",
+ defaultValue = ":",
+ help = "Plugin options"
+ )
public List<Map.Entry<String, String>> pluginCoptList;
- @Option(name = "stamp",
- defaultValue = "false",
- category = "semantics",
- help = "Stamp binaries with the date, username, hostname, workspace information, etc.")
+ @Option(
+ name = "stamp",
+ defaultValue = "false",
+ category = "semantics",
+ help = "Stamp binaries with the date, username, hostname, workspace information, etc."
+ )
public boolean stampBinaries;
// This default value is always overwritten in the case of "bazel coverage" by
// CoverageCommand.setDefaultInstrumentationFilter().
- @Option(name = "instrumentation_filter",
- converter = RegexFilter.RegexFilterConverter.class,
- defaultValue = "-/javatests[/:]",
- category = "semantics",
- help = "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.")
+ @Option(
+ name = "instrumentation_filter",
+ converter = RegexFilter.RegexFilterConverter.class,
+ defaultValue = "-/javatests[/:]",
+ category = "semantics",
+ help =
+ "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."
+ )
public RegexFilter instrumentationFilter;
- @Option(name = "instrument_test_targets",
- defaultValue = "false",
- category = "semantics",
- help = "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.")
+ @Option(
+ name = "instrument_test_targets",
+ defaultValue = "false",
+ category = "semantics",
+ help =
+ "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."
+ )
public boolean instrumentTestTargets;
- @Option(name = "host_cpu",
- defaultValue = "",
- category = "semantics",
- converter = AutoCpuConverter.class,
- help = "The host CPU.")
+ @Option(
+ name = "host_cpu",
+ defaultValue = "",
+ category = "semantics",
+ converter = AutoCpuConverter.class,
+ help = "The host CPU."
+ )
public String hostCpu;
- @Option(name = "compilation_mode",
- abbrev = 'c',
- converter = CompilationMode.Converter.class,
- defaultValue = "fastbuild",
- category = "semantics", // Should this be "flags"?
- help = "Specify the mode the binary will be built in. "
- + "Values: 'fastbuild', 'dbg', 'opt'.")
+ @Option(
+ name = "compilation_mode",
+ abbrev = 'c',
+ converter = CompilationMode.Converter.class,
+ defaultValue = "fastbuild",
+ category = "semantics", // Should this be "flags"?
+ help = "Specify the mode the binary will be built in. " + "Values: 'fastbuild', 'dbg', 'opt'."
+ )
public CompilationMode compilationMode;
/**
@@ -603,31 +634,37 @@ public final class BuildConfiguration {
* to a constant, so that the output files for the host are completely independent of those for
* the target, no matter what options are in force (k8/piii, opt/dbg, etc).
*/
- @Option(name = "output directory name",
- defaultValue = "null",
- category = "internal")
+ @Option(
+ name = "output directory name",
+ defaultValue = "null",
+ optionUsageRestrictions = OptionUsageRestrictions.INTERNAL
+ )
public String outputDirectoryName;
- @Option(name = "platform_suffix",
- defaultValue = "null",
- category = "misc",
- help = "Specifies a suffix to be added to the configuration directory.")
+ @Option(
+ name = "platform_suffix",
+ defaultValue = "null",
+ category = "misc",
+ help = "Specifies a suffix to be added to the configuration directory."
+ )
public String platformSuffix;
// TODO(bazel-team): The test environment is actually computed in BlazeRuntime and this option
// is not read anywhere else. Thus, it should be in a different options class, preferably one
// specific to the "test" command or maybe in its own configuration fragment.
// BlazeRuntime, though.
- @Option(name = "test_env",
- converter = Converters.OptionalAssignmentConverter.class,
- allowMultiple = true,
- defaultValue = "",
- category = "testing",
- help = "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."
+ @Option(
+ name = "test_env",
+ converter = Converters.OptionalAssignmentConverter.class,
+ allowMultiple = true,
+ defaultValue = "",
+ category = "testing",
+ help =
+ "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."
)
public List<Map.Entry<String, String>> testEnvironment;
@@ -650,226 +687,273 @@ public final class BuildConfiguration {
)
public List<Map.Entry<String, String>> actionEnvironment;
- @Option(name = "collect_code_coverage",
- defaultValue = "false",
- category = "testing",
- help = "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."
+ @Option(
+ name = "collect_code_coverage",
+ defaultValue = "false",
+ category = "testing",
+ help =
+ "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."
)
public boolean collectCodeCoverage;
- @Option(name = "microcoverage",
- defaultValue = "false",
- category = "testing",
- help = "If specified with coverage, Blaze will collect microcoverage (per test method "
- + "coverage) information during tests. Only targets that match "
- + "--instrumentation_filter will be affected. Usually this option should not be "
- + "specified directly - 'blaze coverage --microcoverage' command should be used "
- + "instead."
+ @Option(
+ name = "microcoverage",
+ defaultValue = "false",
+ category = "testing",
+ help =
+ "If specified with coverage, Blaze will collect microcoverage (per test method "
+ + "coverage) information during tests. Only targets that match "
+ + "--instrumentation_filter will be affected. Usually this option should not be "
+ + "specified directly - 'blaze coverage --microcoverage' command should be used "
+ + "instead."
)
public boolean collectMicroCoverage;
- @Option(name = "coverage_support",
- converter = LabelConverter.class,
- defaultValue = "@bazel_tools//tools/test:coverage_support",
- category = "testing",
- help = "Location of support files that are required on the inputs of every test action "
- + "that collects code coverage. Defaults to '//tools/test:coverage_support'.")
+ @Option(
+ name = "coverage_support",
+ converter = LabelConverter.class,
+ defaultValue = "@bazel_tools//tools/test:coverage_support",
+ category = "testing",
+ help =
+ "Location of support files that are required on the inputs of every test action "
+ + "that collects code coverage. Defaults to '//tools/test:coverage_support'."
+ )
public Label coverageSupport;
- @Option(name = "coverage_report_generator",
- converter = LabelConverter.class,
- defaultValue = "@bazel_tools//tools/test:coverage_report_generator",
- category = "testing",
- help = "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'.")
+ @Option(
+ name = "coverage_report_generator",
+ converter = LabelConverter.class,
+ defaultValue = "@bazel_tools//tools/test:coverage_report_generator",
+ category = "testing",
+ help =
+ "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'."
+ )
public Label coverageReportGenerator;
- @Option(name = "experimental_use_llvm_covmap",
- defaultValue = "false",
- category = "experimental",
- help = "If specified, Bazel will generate llvm-cov coverage map information rather than "
- + "gcov when collect_code_coverage is enabled."
+ @Option(
+ name = "experimental_use_llvm_covmap",
+ defaultValue = "false",
+ category = "experimental",
+ help =
+ "If specified, Bazel will generate llvm-cov coverage map information rather than "
+ + "gcov when collect_code_coverage is enabled."
)
public boolean useLLVMCoverageMapFormat;
- @Option(name = "cache_test_results",
- defaultValue = "auto",
- category = "testing",
- abbrev = 't', // it's useful to toggle this on/off quickly
- help = "If 'auto', Bazel will only rerun a test if any of the following conditions apply: "
- + "(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 "
- + "(4) the test failed "
- + "If 'yes', the caching behavior will be the same as 'auto' except that "
- + "it may cache test failures and test runs with --runs_per_test. "
- + "If 'no', all tests will be always executed.")
+ @Option(
+ name = "cache_test_results",
+ defaultValue = "auto",
+ category = "testing",
+ abbrev = 't', // it's useful to toggle this on/off quickly
+ help =
+ "If 'auto', Bazel will only rerun a test if any of the following conditions apply: "
+ + "(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 "
+ + "(4) the test failed "
+ + "If 'yes', the caching behavior will be the same as 'auto' except that "
+ + "it may cache test failures and test runs with --runs_per_test. "
+ + "If 'no', all tests will be always executed."
+ )
public TriState cacheTestResults;
@Deprecated
- @Option(name = "test_result_expiration",
- defaultValue = "-1", // No expiration by defualt.
- category = "testing",
- help = "This option is deprecated and has no effect.")
+ @Option(
+ name = "test_result_expiration",
+ defaultValue = "-1", // No expiration by defualt.
+ category = "testing",
+ help = "This option is deprecated and has no effect."
+ )
public int testResultExpiration;
- @Option(name = "test_sharding_strategy",
- defaultValue = "explicit",
- category = "testing",
- converter = TestActionBuilder.ShardingStrategyConverter.class,
- help = "Specify strategy for test sharding: "
- + "'explicit' to only use sharding if the 'shard_count' BUILD attribute is present. "
- + "'disabled' to never use test sharding. "
- + "'experimental_heuristic' to enable sharding on remotely executed tests without an "
- + "explicit 'shard_count' attribute which link in a supported framework. Considered "
- + "experimental.")
+ @Option(
+ name = "test_sharding_strategy",
+ defaultValue = "explicit",
+ category = "testing",
+ converter = TestActionBuilder.ShardingStrategyConverter.class,
+ help =
+ "Specify strategy for test sharding: "
+ + "'explicit' to only use sharding if the 'shard_count' BUILD attribute is present. "
+ + "'disabled' to never use test sharding. "
+ + "'experimental_heuristic' to enable sharding on remotely executed tests without an "
+ + "explicit 'shard_count' attribute which link in a supported framework. Considered "
+ + "experimental."
+ )
public TestActionBuilder.TestShardingStrategy testShardingStrategy;
- @Option(name = "runs_per_test",
- allowMultiple = true,
- defaultValue = "1",
- category = "testing",
- converter = RunsPerTestConverter.class,
- help = "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. ")
+ @Option(
+ name = "runs_per_test",
+ allowMultiple = true,
+ defaultValue = "1",
+ category = "testing",
+ converter = RunsPerTestConverter.class,
+ help =
+ "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. "
+ )
public List<PerLabelOptions> runsPerTest;
- @Option(name = "build_runfile_links",
- defaultValue = "true",
- category = "strategy",
- help = "If true, build runfiles symlink forests for all targets. "
- + "If false, write only manifests when possible.")
+ @Option(
+ name = "build_runfile_links",
+ defaultValue = "true",
+ category = "strategy",
+ help =
+ "If true, build runfiles symlink forests for all targets. "
+ + "If false, write only manifests when possible."
+ )
public boolean buildRunfiles;
- @Option(name = "legacy_external_runfiles",
- defaultValue = "true",
- category = "strategy",
- help = "If true, build runfiles symlink forests for external repositories under "
- + ".runfiles/wsname/external/repo (in addition to .runfiles/repo).")
+ @Option(
+ name = "legacy_external_runfiles",
+ defaultValue = "true",
+ category = "strategy",
+ help =
+ "If true, build runfiles symlink forests for external repositories under "
+ + ".runfiles/wsname/external/repo (in addition to .runfiles/repo)."
+ )
public boolean legacyExternalRunfiles;
- @Option(name = "test_arg",
- allowMultiple = true,
- defaultValue = "",
- category = "testing",
- help = "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."
+ @Option(
+ name = "test_arg",
+ allowMultiple = true,
+ defaultValue = "",
+ category = "testing",
+ help =
+ "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."
)
public List<String> testArguments;
- @Option(name = "test_filter",
- allowMultiple = false,
- defaultValue = "null",
- category = "testing",
- help = "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.")
+ @Option(
+ name = "test_filter",
+ allowMultiple = false,
+ defaultValue = "null",
+ category = "testing",
+ help =
+ "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."
+ )
public String testFilter;
- @Option(name = "check_fileset_dependencies_recursively",
- defaultValue = "true",
- category = "semantics",
- help = "If false, fileset targets will, whenever possible, create "
- + "symlinks to directories instead of creating one symlink for each "
- + "file inside the directory. Disabling this will significantly "
- + "speed up fileset builds, but targets that depend on filesets will "
- + "not be rebuilt if files are added, removed or modified in a "
- + "subdirectory which has not been traversed.")
+ @Option(
+ name = "check_fileset_dependencies_recursively",
+ defaultValue = "true",
+ category = "semantics",
+ help =
+ "If false, fileset targets will, whenever possible, create "
+ + "symlinks to directories instead of creating one symlink for each "
+ + "file inside the directory. Disabling this will significantly "
+ + "speed up fileset builds, but targets that depend on filesets will "
+ + "not be rebuilt if files are added, removed or modified in a "
+ + "subdirectory which has not been traversed."
+ )
public boolean checkFilesetDependenciesRecursively;
@Option(
- name = "experimental_skyframe_native_filesets",
- defaultValue = "false",
- category = "experimental",
- help =
- "If true, Blaze will use the skyframe-native implementation of the Fileset rule."
- + " This offers improved performance in incremental builds of Filesets as well as"
- + " correct incremental behavior, but is not yet stable. The default is false,"
- + " meaning Blaze uses the legacy impelementation of Fileset."
+ name = "experimental_skyframe_native_filesets",
+ defaultValue = "false",
+ category = "experimental",
+ help =
+ "If true, Blaze will use the skyframe-native implementation of the Fileset rule."
+ + " This offers improved performance in incremental builds of Filesets as well as"
+ + " correct incremental behavior, but is not yet stable. The default is false,"
+ + " meaning Blaze uses the legacy impelementation of Fileset."
)
public boolean skyframeNativeFileset;
@Option(
- name = "run_under",
- category = "run",
- defaultValue = "null",
- converter = RunUnderConverter.class,
- help =
- "Prefix to insert in front of command before running. "
- + "Examples:\n"
- + "\t--run_under=valgrind\n"
- + "\t--run_under=strace\n"
- + "\t--run_under='strace -c'\n"
- + "\t--run_under='valgrind --quiet --num-callers=20'\n"
- + "\t--run_under=//package:target\n"
- + "\t--run_under='//package:target --options'\n"
+ name = "run_under",
+ category = "run",
+ defaultValue = "null",
+ converter = RunUnderConverter.class,
+ help =
+ "Prefix to insert in front of command before running. "
+ + "Examples:\n"
+ + "\t--run_under=valgrind\n"
+ + "\t--run_under=strace\n"
+ + "\t--run_under='strace -c'\n"
+ + "\t--run_under='valgrind --quiet --num-callers=20'\n"
+ + "\t--run_under=//package:target\n"
+ + "\t--run_under='//package:target --options'\n"
)
public RunUnder runUnder;
- @Option(name = "distinct_host_configuration",
- defaultValue = "true",
- category = "strategy",
- help = "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 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.")
+ @Option(
+ name = "distinct_host_configuration",
+ defaultValue = "true",
+ category = "strategy",
+ help =
+ "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."
+ )
public boolean useDistinctHostConfiguration;
- @Option(name = "check_visibility",
- defaultValue = "true",
- category = "checking",
- help = "If disabled, visibility errors are demoted to warnings.")
+ @Option(
+ name = "check_visibility",
+ defaultValue = "true",
+ category = "checking",
+ help = "If disabled, visibility errors are demoted to warnings."
+ )
public boolean checkVisibility;
// Moved from viewOptions to here because license information is very expensive to serialize.
// Having it here allows us to skip computation of transitive license information completely
// when the setting is disabled.
- @Option(name = "check_licenses",
- defaultValue = "false",
- category = "checking",
- help = "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.")
+ @Option(
+ name = "check_licenses",
+ defaultValue = "false",
+ category = "checking",
+ help =
+ "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."
+ )
public boolean checkLicenses;
@Option(
- name = "enforce_constraints",
- defaultValue = "true",
- category = "undocumented",
- help =
- "Checks the environments each target is compatible with and reports errors if any "
- + "target has dependencies that don't support the same environments",
- oldName = "experimental_enforce_constraints"
+ name = "enforce_constraints",
+ defaultValue = "true",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help =
+ "Checks the environments each target is compatible with and reports errors if any "
+ + "target has dependencies that don't support the same environments",
+ oldName = "experimental_enforce_constraints"
)
public boolean enforceConstraints;
- @Option(name = "experimental_action_listener",
- allowMultiple = true,
- defaultValue = "",
- category = "experimental",
- converter = LabelConverter.class,
- help = "Use action_listener to attach an extra_action to existing build actions.")
+ @Option(
+ name = "experimental_action_listener",
+ allowMultiple = true,
+ defaultValue = "",
+ category = "experimental",
+ converter = LabelConverter.class,
+ help = "Use action_listener to attach an extra_action to existing build actions."
+ )
public List<Label> actionListeners;
// TODO(bazel-team): Either remove this flag once transparent compression is shown to not
@@ -878,38 +962,45 @@ public final class BuildConfiguration {
@Option(
name = "experimental_transparent_compression",
defaultValue = "true",
- category = "undocumented",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
help =
"Enables gzip compression for the contents of FileWriteActions, which reduces "
+ "memory usage in the analysis phase at the expense of additional time overhead."
)
public boolean transparentCompression;
- @Option(name = "is host configuration",
- defaultValue = "false",
- category = "internal",
- help = "Shows whether these options are set for host configuration.")
+ @Option(
+ name = "is host configuration",
+ defaultValue = "false",
+ optionUsageRestrictions = OptionUsageRestrictions.INTERNAL,
+ help = "Shows whether these options are set for host configuration."
+ )
public boolean isHost;
- @Option(name = "features",
- allowMultiple = true,
- defaultValue = "",
- category = "flags",
- help = "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 "
- + "Blaze release.")
+ @Option(
+ name = "features",
+ allowMultiple = true,
+ defaultValue = "",
+ category = "flags",
+ help =
+ "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 "
+ + "Blaze release."
+ )
public List<String> defaultFeatures;
- @Option(name = "target_environment",
- converter = LabelConverter.class,
- allowMultiple = true,
- defaultValue = "",
- category = "flags",
- help = "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."
+ @Option(
+ name = "target_environment",
+ converter = LabelConverter.class,
+ allowMultiple = true,
+ defaultValue = "",
+ category = "flags",
+ help =
+ "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."
)
public List<Label> targetEnvironments;
@@ -941,27 +1032,30 @@ public final class BuildConfiguration {
}
}
- @Option(name = "experimental_dynamic_configs",
- defaultValue = "notrim_partial",
- category = "undocumented",
- converter = DynamicConfigsConverter.class,
- help = "Dynamically instantiates build configurations instead of using the default "
- + "static globally defined ones")
+ @Option(
+ name = "experimental_dynamic_configs",
+ defaultValue = "notrim_partial",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ converter = DynamicConfigsConverter.class,
+ help =
+ "Dynamically instantiates build configurations instead of using the default "
+ + "static globally defined ones"
+ )
public DynamicConfigsMode useDynamicConfigurations;
@Option(
- name = "experimental_enable_runfiles",
- defaultValue = "auto",
- category = "undocumented",
- help = "Enable runfiles; off on Windows, on on other platforms"
+ name = "experimental_enable_runfiles",
+ defaultValue = "auto",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help = "Enable runfiles; off on Windows, on on other platforms"
)
public TriState enableRunfiles;
@Option(
- name = "build_python_zip",
- defaultValue = "auto",
- category = "undocumented",
- help = "Build python executable zip; on on Windows, off on other platforms"
+ name = "build_python_zip",
+ defaultValue = "auto",
+ optionUsageRestrictions = OptionUsageRestrictions.UNDOCUMENTED,
+ help = "Build python executable zip; on on Windows, off on other platforms"
)
public TriState buildPythonZip;