Damien Martin-Guillerez | f88f4d8 | 2015-09-25 13:56:55 +0000 | [diff] [blame] | 1 | // Copyright 2014 The Bazel Authors. All rights reserved. |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | package com.google.devtools.build.lib.runtime; |
| 15 | |
ccalvarin | 93c080a | 2017-10-16 19:21:08 +0200 | [diff] [blame] | 16 | import com.google.devtools.build.lib.runtime.CommandLineEvent.ToolCommandLineEvent; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 17 | import com.google.devtools.build.lib.util.OptionsUtils; |
| 18 | import com.google.devtools.build.lib.vfs.PathFragment; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 19 | import com.google.devtools.common.options.Converters; |
| 20 | import com.google.devtools.common.options.Option; |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 21 | import com.google.devtools.common.options.OptionDocumentationCategory; |
ccalvarin | c82a197 | 2017-07-17 21:13:39 +0200 | [diff] [blame] | 22 | import com.google.devtools.common.options.OptionEffectTag; |
| 23 | import com.google.devtools.common.options.OptionMetadataTag; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 24 | import com.google.devtools.common.options.OptionsBase; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 25 | import java.util.List; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 26 | import java.util.logging.Level; |
| 27 | |
| 28 | /** |
| 29 | * Options common to all commands. |
| 30 | */ |
| 31 | public class CommonCommandOptions extends OptionsBase { |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 32 | |
brandjon | 9426175 | 2017-03-31 20:05:26 +0000 | [diff] [blame] | 33 | // To create a new incompatible change, see the javadoc for AllIncompatibleChangesExpansion. |
| 34 | @Option( |
| 35 | name = "all_incompatible_changes", |
| 36 | defaultValue = "null", |
| 37 | category = "misc", |
ccalvarin | 3bc1547 | 2017-06-27 17:58:35 +0200 | [diff] [blame] | 38 | documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 39 | effectTags = {OptionEffectTag.UNKNOWN}, |
| 40 | metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE}, |
brandjon | 9426175 | 2017-03-31 20:05:26 +0000 | [diff] [blame] | 41 | expansionFunction = AllIncompatibleChangesExpansion.class, |
| 42 | help = |
| 43 | "Enables all options of the form --incompatible_*. Use this option to find places where " |
| 44 | + "your build may break in the future due to deprecations or other changes." |
| 45 | ) |
| 46 | public Void allIncompatibleChanges; |
| 47 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 48 | @Option( |
| 49 | name = "config", |
| 50 | defaultValue = "", |
| 51 | category = "misc", |
ccalvarin | 3bc1547 | 2017-06-27 17:58:35 +0200 | [diff] [blame] | 52 | documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 53 | effectTags = {OptionEffectTag.UNKNOWN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 54 | allowMultiple = true, |
| 55 | help = |
| 56 | "Selects additional config sections from the rc files; for every <command>, it " |
| 57 | + "also pulls in the options from <command>:<config> if such a section exists; " |
| 58 | + "if the section does not exist, this flag is ignored. " |
| 59 | + "Note that it is currently only possible to provide these options on the " |
| 60 | + "command line, not in the rc files. The config sections and flag combinations " |
| 61 | + "they are equivalent to are located in the tools/*.blazerc config files." |
| 62 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 63 | public List<String> configs; |
| 64 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 65 | @Option( |
| 66 | name = "logging", |
| 67 | defaultValue = "3", // Level.INFO |
| 68 | category = "verbosity", |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 69 | documentationCategory = OptionDocumentationCategory.LOGGING, |
| 70 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 71 | converter = Converters.LogLevelConverter.class, |
| 72 | help = "The logging level." |
| 73 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 74 | public Level verbosity; |
| 75 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 76 | @Option( |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 77 | name = "client_cwd", |
| 78 | defaultValue = "", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 79 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
| 80 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 81 | effectTags = {OptionEffectTag.CHANGES_INPUTS}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 82 | converter = OptionsUtils.PathFragmentConverter.class, |
| 83 | help = "A system-generated parameter which specifies the client's working directory" |
| 84 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 85 | public PathFragment clientCwd; |
| 86 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 87 | @Option( |
| 88 | name = "announce_rc", |
| 89 | defaultValue = "false", |
| 90 | category = "verbosity", |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 91 | documentationCategory = OptionDocumentationCategory.LOGGING, |
| 92 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 93 | help = "Whether to announce rc options." |
| 94 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 95 | public boolean announceRcOptions; |
| 96 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 97 | @Option( |
| 98 | name = "always_profile_slow_operations", |
| 99 | defaultValue = "true", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 100 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 101 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 102 | help = "Whether profiling slow operations is always turned on" |
| 103 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 104 | public boolean alwaysProfileSlowOperations; |
| 105 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 106 | @Option( |
Googler | 65ceda9 | 2017-05-31 18:09:32 +0200 | [diff] [blame] | 107 | name = "allow_undefined_configs", |
| 108 | defaultValue = "true", |
| 109 | category = "flags", |
ccalvarin | 3bc1547 | 2017-06-27 17:58:35 +0200 | [diff] [blame] | 110 | documentationCategory = OptionDocumentationCategory.UNCATEGORIZED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 111 | effectTags = {OptionEffectTag.EAGERNESS_TO_EXIT}, |
Googler | 65ceda9 | 2017-05-31 18:09:32 +0200 | [diff] [blame] | 112 | help = "Do not throw an error when the config is not defined." |
| 113 | ) |
| 114 | public boolean allowUndefinedConfigs; |
| 115 | |
| 116 | @Option( |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 117 | name = "profile", |
| 118 | defaultValue = "null", |
| 119 | category = "misc", |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 120 | documentationCategory = OptionDocumentationCategory.LOGGING, |
| 121 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 122 | converter = OptionsUtils.PathFragmentConverter.class, |
| 123 | help = |
| 124 | "If set, profile Blaze and write data to the specified " |
| 125 | + "file. Use blaze analyze-profile to analyze the profile." |
| 126 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 127 | public PathFragment profilePath; |
| 128 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 129 | @Option( |
| 130 | name = "record_full_profiler_data", |
| 131 | defaultValue = "false", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 132 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 133 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 134 | help = |
| 135 | "By default, Blaze profiler will record only aggregated data for fast but numerous " |
| 136 | + "events (such as statting the file). If this option is enabled, profiler will record " |
| 137 | + "each event - resulting in more precise profiling data but LARGE performance " |
| 138 | + "hit. Option only has effect if --profile used as well." |
| 139 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 140 | public boolean recordFullProfilerData; |
| 141 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 142 | @Option( |
| 143 | name = "memory_profile", |
| 144 | defaultValue = "null", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 145 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 146 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 147 | converter = OptionsUtils.PathFragmentConverter.class, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 148 | help = "If set, write memory usage data to the specified file at phase ends." |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 149 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 150 | public PathFragment memoryProfilePath; |
| 151 | |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 152 | @Deprecated |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 153 | @Option( |
| 154 | name = "gc_watchdog", |
| 155 | defaultValue = "false", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 156 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | 3bc1547 | 2017-06-27 17:58:35 +0200 | [diff] [blame] | 157 | effectTags = {OptionEffectTag.NO_OP}, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 158 | metadataTags = {OptionMetadataTag.DEPRECATED}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 159 | deprecationWarning = "Ignoring: this option is no longer supported", |
| 160 | help = "Deprecated." |
| 161 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 162 | public boolean gcWatchdog; |
| 163 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 164 | @Option( |
janakr | ff746b4 | 2017-08-15 21:09:50 +0200 | [diff] [blame] | 165 | name = "experimental_oom_more_eagerly_threshold", |
| 166 | defaultValue = "100", |
| 167 | documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY, |
| 168 | effectTags = {OptionEffectTag.HOST_MACHINE_RESOURCE_OPTIMIZATIONS}, |
| 169 | help = |
| 170 | "If this flag is set to a value less than 100, Blaze will OOM if, after two full GC's, more" |
| 171 | + "than this percentage of the (old gen) heap is still occupied." |
| 172 | ) |
| 173 | public int oomMoreEagerlyThreshold; |
| 174 | |
| 175 | @Option( |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 176 | name = "startup_time", |
| 177 | defaultValue = "0", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 178 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 179 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 180 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 181 | help = "The time in ms the launcher spends before sending the request to the blaze server." |
| 182 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 183 | public long startupTime; |
| 184 | |
Thiago Farina | 36c1d15 | 2016-05-04 14:24:14 +0000 | [diff] [blame] | 185 | @Option( |
| 186 | name = "extract_data_time", |
| 187 | defaultValue = "0", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 188 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 189 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 190 | metadataTags = {OptionMetadataTag.HIDDEN}, |
Thiago Farina | 36c1d15 | 2016-05-04 14:24:14 +0000 | [diff] [blame] | 191 | help = "The time in ms spent on extracting the new blaze version." |
| 192 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 193 | public long extractDataTime; |
| 194 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 195 | @Option( |
| 196 | name = "command_wait_time", |
| 197 | defaultValue = "0", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 198 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 199 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 200 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 201 | help = "The time in ms a command had to wait on a busy Blaze server process." |
| 202 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 203 | public long waitTime; |
| 204 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 205 | @Option( |
| 206 | name = "tool_tag", |
| 207 | defaultValue = "", |
| 208 | category = "misc", |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 209 | documentationCategory = OptionDocumentationCategory.LOGGING, |
| 210 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 211 | help = "A tool name to attribute this Blaze invocation to." |
| 212 | ) |
Googler | 88e3104 | 2015-07-08 19:16:57 +0000 | [diff] [blame] | 213 | public String toolTag; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 214 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 215 | @Option( |
| 216 | name = "restart_reason", |
| 217 | defaultValue = "no_restart", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 218 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 219 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 220 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 221 | help = "The reason for the server restart." |
| 222 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 223 | public String restartReason; |
| 224 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 225 | @Option( |
| 226 | name = "binary_path", |
| 227 | defaultValue = "", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 228 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 229 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS, OptionEffectTag.BAZEL_MONITORING}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 230 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 231 | help = "The absolute path of the blaze binary." |
| 232 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 233 | public String binaryPath; |
| 234 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 235 | @Option( |
| 236 | name = "experimental_allow_project_files", |
| 237 | defaultValue = "false", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 238 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 239 | effectTags = {OptionEffectTag.CHANGES_INPUTS}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 240 | metadataTags = {OptionMetadataTag.EXPERIMENTAL, OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 241 | help = "Enable processing of +<file> parameters." |
| 242 | ) |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 243 | public boolean allowProjectFiles; |
Lukacs Berki | ce1445f | 2016-04-19 15:52:55 +0000 | [diff] [blame] | 244 | |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 245 | @Option( |
| 246 | name = "block_for_lock", |
| 247 | defaultValue = "true", |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 248 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
ccalvarin | e73f881 | 2017-06-26 21:40:04 +0200 | [diff] [blame] | 249 | effectTags = {OptionEffectTag.BAZEL_INTERNAL_CONFIGURATION}, |
ccalvarin | 456adb2 | 2017-07-11 14:23:46 +0200 | [diff] [blame] | 250 | metadataTags = {OptionMetadataTag.HIDDEN}, |
ccalvarin | 2eaa02e | 2017-04-17 23:37:46 +0200 | [diff] [blame] | 251 | help = |
| 252 | "If set (the default), a command will block if there is another one running. If " |
| 253 | + "unset, these commands will immediately return with an error." |
| 254 | ) |
Lukacs Berki | ce1445f | 2016-04-19 15:52:55 +0000 | [diff] [blame] | 255 | public boolean blockForLock; |
ccalvarin | 93c080a | 2017-10-16 19:21:08 +0200 | [diff] [blame] | 256 | |
| 257 | // We could accept multiple of these, in the event where there's a chain of tools that led to a |
| 258 | // Bazel invocation. We would not want to expect anything from the order of these, and would need |
| 259 | // to guarantee that the "label" for each command line is unique. Unless a need is demonstrated, |
| 260 | // though, logs are a better place to track this information than flags, so let's try to avoid it. |
| 261 | @Option( |
| 262 | // In May 2018, this feature will have been out for 6 months. If the format we accept has not |
| 263 | // changed in that time, we can remove the "experimental" prefix and tag. |
| 264 | name = "experimental_tool_command_line", |
| 265 | defaultValue = "", |
| 266 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
| 267 | effectTags = {OptionEffectTag.AFFECTS_OUTPUTS}, |
| 268 | // Keep this flag HIDDEN so that it is not listed with our reported command lines, it being |
| 269 | // reported separately. |
| 270 | metadataTags = {OptionMetadataTag.EXPERIMENTAL, OptionMetadataTag.HIDDEN}, |
| 271 | converter = ToolCommandLineEvent.Converter.class, |
| 272 | help = |
| 273 | "An extra command line to report with this invocation's command line. Useful for tools " |
| 274 | + "that invoke Bazel and want the original information that the tool received to be " |
| 275 | + "logged with the rest of the Bazel invocation." |
| 276 | ) |
| 277 | public ToolCommandLineEvent toolCommandLine; |
ccalvarin | 0dd5a68 | 2017-11-10 01:40:01 +0100 | [diff] [blame^] | 278 | |
| 279 | @Option( |
| 280 | name = "unconditional_warning", |
| 281 | defaultValue = "", |
| 282 | documentationCategory = OptionDocumentationCategory.UNDOCUMENTED, |
| 283 | effectTags = {OptionEffectTag.TERMINAL_OUTPUT}, |
| 284 | allowMultiple = true, |
| 285 | help = |
| 286 | "A warning that will unconditionally get printed with build warnings and errors. This is " |
| 287 | + "useful to deprecate bazelrc files or --config definitions. If the intent is to " |
| 288 | + "effectively deprecate some flag or combination of flags, this is NOT sufficient. " |
| 289 | + "The flag or flags should use the deprecationWarning field in the option definition, " |
| 290 | + "or the bad combination should be checked for programmatically." |
| 291 | ) |
| 292 | public List<String> deprecationWarnings; |
Han-Wen Nienhuys | d08b27f | 2015-02-25 16:45:20 +0100 | [diff] [blame] | 293 | } |