Skip to content

Commit 7e8f86d

Browse files
susinmotioncopybara-github
authored andcommitted
Remove --local_resources.
This has been deprecated for a while, and has been removed via --incompatible_remove_local_resources, which defaulted to true in the last major release. RELNOTES: --local_resources and --incompatible_remove_local_resources have been removed. If you've been setting --local resources or --incompatible_remove_local_resources=false, you must migrate to using --local_ram_resources and --local_cpu_resources instead. PiperOrigin-RevId: 341852479
1 parent 7e608b5 commit 7e8f86d

File tree

2 files changed

+1
-53
lines changed

2 files changed

+1
-53
lines changed

src/main/java/com/google/devtools/build/lib/buildtool/ExecutionTool.java

+1-23
Original file line numberDiff line numberDiff line change
@@ -196,20 +196,6 @@ public class ExecutionTool {
196196

197197
this.actionContextRegistry = moduleActionContextRegistry;
198198
this.spawnStrategyRegistry = spawnStrategyRegistry;
199-
200-
if (options.availableResources != null && options.removeLocalResources) {
201-
throw new AbruptExitException(
202-
DetailedExitCode.of(
203-
FailureDetail.newBuilder()
204-
.setMessage(
205-
"--local_resources is deprecated. Please use --local_ram_resources and/or"
206-
+ " --local_cpu_resources")
207-
.setExecutionOptions(
208-
FailureDetails.ExecutionOptions.newBuilder()
209-
.setCode(
210-
FailureDetails.ExecutionOptions.Code.DEPRECATED_LOCAL_RESOURCES_USED))
211-
.build()));
212-
}
213199
}
214200

215201
Executor getExecutor() throws AbruptExitException {
@@ -811,15 +797,7 @@ private Builder createBuilder(
811797
public static void configureResourceManager(ResourceManager resourceMgr, BuildRequest request) {
812798
ExecutionOptions options = request.getOptions(ExecutionOptions.class);
813799
ResourceSet resources;
814-
if (options.availableResources != null && !options.removeLocalResources) {
815-
logger.atWarning().log(
816-
"--local_resources will be deprecated. Please use --local_ram_resources "
817-
+ "and/or --local_cpu_resources.");
818-
resources = options.availableResources;
819-
} else {
820-
resources =
821-
ResourceSet.createWithRamCpu(options.localRamResources, options.localCpuResources);
822-
}
800+
resources = ResourceSet.createWithRamCpu(options.localRamResources, options.localCpuResources);
823801
resourceMgr.setUseLocalMemoryEstimate(options.localMemoryEstimate);
824802

825803
resourceMgr.setAvailableResources(

src/main/java/com/google/devtools/build/lib/exec/ExecutionOptions.java

-30
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@
1818
import com.google.devtools.build.lib.actions.ActionExecutionContext;
1919
import com.google.devtools.build.lib.actions.ActionExecutionContext.ShowSubcommands;
2020
import com.google.devtools.build.lib.actions.LocalHostCapacity;
21-
import com.google.devtools.build.lib.actions.ResourceSet;
2221
import com.google.devtools.build.lib.analysis.config.PerLabelOptions;
2322
import com.google.devtools.build.lib.util.OptionsUtils;
2423
import com.google.devtools.build.lib.util.RegexFilter;
@@ -31,7 +30,6 @@
3130
import com.google.devtools.common.options.Option;
3231
import com.google.devtools.common.options.OptionDocumentationCategory;
3332
import com.google.devtools.common.options.OptionEffectTag;
34-
import com.google.devtools.common.options.OptionMetadataTag;
3533
import com.google.devtools.common.options.Options;
3634
import com.google.devtools.common.options.OptionsBase;
3735
import com.google.devtools.common.options.OptionsParsingException;
@@ -293,34 +291,6 @@ public boolean shouldMaterializeParamFiles() {
293291
help = "This flag has no effect, and is deprecated")
294292
public boolean useResourceAutoSense;
295293

296-
@Option(
297-
name = "local_resources",
298-
defaultValue = "null",
299-
documentationCategory = OptionDocumentationCategory.UNCATEGORIZED,
300-
effectTags = {OptionEffectTag.UNKNOWN},
301-
help =
302-
"Deprecated by '--incompatible_remove_local_resources'. Please use "
303-
+ "'--local_ram_resources' and '--local_cpu_resources'",
304-
deprecationWarning =
305-
"--local_resources is deprecated. Please use"
306-
+ " --local_ram_resources and --local_cpu_resources instead.",
307-
converter = ResourceSet.ResourceSetConverter.class)
308-
public ResourceSet availableResources;
309-
310-
@Option(
311-
name = "incompatible_remove_local_resources",
312-
defaultValue = "true",
313-
documentationCategory = OptionDocumentationCategory.EXECUTION_STRATEGY,
314-
effectTags = {OptionEffectTag.EXECUTION},
315-
metadataTags = {
316-
OptionMetadataTag.INCOMPATIBLE_CHANGE,
317-
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
318-
},
319-
help =
320-
"Deprecate local_resources in favor of --local_ram_resources and "
321-
+ "--local_cpu_resources.")
322-
public boolean removeLocalResources;
323-
324294
@Option(
325295
name = "local_cpu_resources",
326296
defaultValue = "HOST_CPUS",

0 commit comments

Comments
 (0)