Skip to content

Commit c02d128

Browse files
larsrc-googlecopybara-github
authored andcommitted
Deprecate flags --experimental_require_availability_info and --experimental_availability_info_exempt.
PiperOrigin-RevId: 530301817 Change-Id: I1efb1bbcb2239e2faea14fe12451cd20688c29a5
1 parent 4e8a74f commit c02d128

File tree

4 files changed

+20
-67
lines changed

4 files changed

+20
-67
lines changed

src/main/java/com/google/devtools/build/lib/bazel/rules/BUILD

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ java_library(
3737
"//src/main/java/com/google/devtools/build/lib/analysis:actions/file_write_action_context",
3838
"//src/main/java/com/google/devtools/build/lib/analysis:actions/template_expansion_action",
3939
"//src/main/java/com/google/devtools/build/lib/analysis:analysis_cluster",
40-
"//src/main/java/com/google/devtools/build/lib/analysis:blaze_directories",
4140
"//src/main/java/com/google/devtools/build/lib/analysis:common_prerequisite_validator",
4241
"//src/main/java/com/google/devtools/build/lib/analysis:config/build_configuration",
4342
"//src/main/java/com/google/devtools/build/lib/analysis:config/build_options",

src/main/java/com/google/devtools/build/lib/bazel/rules/BazelRulesModule.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
import com.google.devtools.build.lib.util.AbruptExitException;
3434
import com.google.devtools.build.lib.util.DetailedExitCode;
3535
import com.google.devtools.build.lib.util.ResourceFileLoader;
36+
import com.google.devtools.common.options.Converters;
3637
import com.google.devtools.common.options.Option;
3738
import com.google.devtools.common.options.OptionDocumentationCategory;
3839
import com.google.devtools.common.options.OptionEffectTag;
@@ -341,6 +342,25 @@ public static class BuildGraveyardOptions extends OptionsBase {
341342
metadataTags = {OptionMetadataTag.INCOMPATIBLE_CHANGE},
342343
help = "This option is deprecated and has no effect.")
343344
public boolean autoConfigureHostPlatform;
345+
346+
@Deprecated
347+
@Option(
348+
name = "experimental_require_availability_info",
349+
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
350+
effectTags = {OptionEffectTag.UNKNOWN},
351+
defaultValue = "false",
352+
help = "Deprecated no-op.")
353+
public boolean requireAvailabilityInfo;
354+
355+
@Deprecated
356+
@Option(
357+
name = "experimental_availability_info_exempt",
358+
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
359+
effectTags = {OptionEffectTag.UNKNOWN},
360+
defaultValue = "Genrule,TestRunner",
361+
converter = Converters.CommaSeparatedOptionListConverter.class,
362+
help = "Deprecated no-op.")
363+
public List<String> availabilityInfoExempt;
344364
}
345365

346366
/** This is where deprecated Bazel-specific options only used by the build command go to die. */

src/main/java/com/google/devtools/build/lib/dynamic/DynamicExecutionOptions.java

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -119,28 +119,6 @@ public class DynamicExecutionOptions extends OptionsBase {
119119
defaultValue = "false")
120120
public boolean debugSpawnScheduler;
121121

122-
@Option(
123-
name = "experimental_require_availability_info",
124-
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
125-
effectTags = {OptionEffectTag.UNKNOWN},
126-
defaultValue = "false",
127-
help =
128-
"If true, fail the build if there are actions that set requires-darwin but do not have"
129-
+ "Xcode availability-related execution requirements set.")
130-
public boolean requireAvailabilityInfo;
131-
132-
@Option(
133-
name = "experimental_availability_info_exempt",
134-
documentationCategory = OptionDocumentationCategory.UNDOCUMENTED,
135-
effectTags = {OptionEffectTag.UNKNOWN},
136-
defaultValue = "Genrule,TestRunner",
137-
converter = Converters.CommaSeparatedOptionListConverter.class,
138-
help =
139-
"A comma-separated list of mnemonics that are not required to have Xcode-related "
140-
+ "execution info if --experimental_require_availability_info=true. No-op if "
141-
+ "--experimental_require_availability_info=false.")
142-
public List<String> availabilityInfoExempt;
143-
144122
@Option(
145123
name = "experimental_dynamic_slow_remote_time",
146124
documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,

src/main/java/com/google/devtools/build/lib/dynamic/DynamicSpawnStrategy.java

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,7 @@
2929
import com.google.devtools.build.lib.actions.Artifact;
3030
import com.google.devtools.build.lib.actions.DynamicStrategyRegistry;
3131
import com.google.devtools.build.lib.actions.DynamicStrategyRegistry.DynamicMode;
32-
import com.google.devtools.build.lib.actions.EnvironmentalExecException;
3332
import com.google.devtools.build.lib.actions.ExecException;
34-
import com.google.devtools.build.lib.actions.ExecutionRequirements;
3533
import com.google.devtools.build.lib.actions.SandboxedSpawnStrategy;
3634
import com.google.devtools.build.lib.actions.Spawn;
3735
import com.google.devtools.build.lib.actions.SpawnResult;
@@ -191,7 +189,6 @@ private static boolean canExecRemote(
191189
public ImmutableList<SpawnResult> exec(
192190
final Spawn spawn, final ActionExecutionContext actionExecutionContext)
193191
throws ExecException, InterruptedException {
194-
DynamicSpawnStrategy.verifyAvailabilityInfo(options, spawn);
195192
ImmutableList<SpawnResult> nonDynamicResults =
196193
maybeExecuteNonDynamically(spawn, actionExecutionContext);
197194
if (nonDynamicResults != null) {
@@ -270,47 +267,6 @@ private void tryScheduleLocalJob() {
270267
}
271268
}
272269

273-
/**
274-
* Checks if the given spawn has the right execution requirements to indicate whether it can
275-
* succeed when running remotely and/or locally depending on the Xcode versions it needs.
276-
*
277-
* @param options the dynamic execution options that configure this check
278-
* @param spawn the spawn to validate
279-
* @throws ExecException if the spawn does not contain the expected execution requirements
280-
*/
281-
static void verifyAvailabilityInfo(DynamicExecutionOptions options, Spawn spawn)
282-
throws ExecException {
283-
if (options.requireAvailabilityInfo
284-
&& !options.availabilityInfoExempt.contains(spawn.getMnemonic())) {
285-
if (spawn.getExecutionInfo().containsKey(ExecutionRequirements.REQUIRES_DARWIN)
286-
&& !spawn.getExecutionInfo().containsKey(ExecutionRequirements.REQUIREMENTS_SET)) {
287-
String message =
288-
String.format(
289-
"The following spawn was missing Xcode-related execution requirements. Please"
290-
+ " let the Bazel team know if you encounter this issue. You can work around"
291-
+ " this error by passing --experimental_require_availability_info=false --"
292-
+ " at your own risk! This may cause some actions to be executed on the"
293-
+ " wrong platform, which can result in build failures.\n"
294-
+ "Failing spawn: mnemonic = %s\n"
295-
+ "tool files = %s\n"
296-
+ "execution platform = %s\n"
297-
+ "execution info = %s\n",
298-
spawn.getMnemonic(),
299-
spawn.getToolFiles(),
300-
spawn.getExecutionPlatform(),
301-
spawn.getExecutionInfo());
302-
303-
FailureDetail detail =
304-
FailureDetail.newBuilder()
305-
.setMessage(message)
306-
.setDynamicExecution(
307-
DynamicExecution.newBuilder().setCode(Code.XCODE_RELATED_PREREQ_UNMET))
308-
.build();
309-
throw new EnvironmentalExecException(detail);
310-
}
311-
}
312-
}
313-
314270
/**
315271
* Checks if this action should be executed dynamically, and if not executes it locally or
316272
* remotely as applicable, or throws an exception if it cannot be executed at all.

0 commit comments

Comments
 (0)