Skip to content

Commit 1ed9a07

Browse files
laurentlbcopybara-github
authored andcommitted
Delete obsolete flag --incompatible_disable_deprecated_attr_params
It is enable by default since Bazel 0.27 #5818 RELNOTES: None. PiperOrigin-RevId: 317876348
1 parent 3a3f5a8 commit 1ed9a07

9 files changed

Lines changed: 5 additions & 192 deletions

File tree

src/main/java/com/google/devtools/build/lib/analysis/starlark/StarlarkAttrModule.java

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -157,19 +157,6 @@ private static Attribute.Builder<?> createAttribute(
157157
builder.setPropertyFlag("MANDATORY");
158158
}
159159

160-
if (containsNonNoneKey(arguments, NON_EMPTY_ARG)
161-
&& (Boolean) arguments.get(NON_EMPTY_ARG)) {
162-
if (thread.getSemantics().incompatibleDisableDeprecatedAttrParams()) {
163-
throw new EvalException(
164-
null,
165-
"'non_empty' is no longer supported. use allow_empty instead. You can use "
166-
+ "--incompatible_disable_deprecated_attr_params=false to temporarily disable this "
167-
+ "check.");
168-
}
169-
170-
builder.setPropertyFlag("NON_EMPTY");
171-
}
172-
173160
if (containsNonNoneKey(arguments, ALLOW_EMPTY_ARG)
174161
&& !(Boolean) arguments.get(ALLOW_EMPTY_ARG)) {
175162
builder.setPropertyFlag("NON_EMPTY");
@@ -186,23 +173,6 @@ private static Attribute.Builder<?> createAttribute(
186173
}
187174
}
188175

189-
if (containsNonNoneKey(arguments, SINGLE_FILE_ARG)
190-
&& (Boolean) arguments.get(SINGLE_FILE_ARG)) {
191-
if (thread.getSemantics().incompatibleDisableDeprecatedAttrParams()) {
192-
throw new EvalException(
193-
null,
194-
"'single_file' is no longer supported. use allow_single_file instead. You can use "
195-
+ "--incompatible_disable_deprecated_attr_params=false to temporarily disable this "
196-
+ "check.");
197-
}
198-
if (containsNonNoneKey(arguments, ALLOW_SINGLE_FILE_ARG)) {
199-
throw new EvalException(
200-
null, "Cannot specify both single_file (deprecated) and allow_single_file");
201-
}
202-
203-
builder.setPropertyFlag("SINGLE_ARTIFACT");
204-
}
205-
206176
if (containsNonNoneKey(arguments, ALLOW_FILES_ARG)
207177
&& containsNonNoneKey(arguments, ALLOW_SINGLE_FILE_ARG)) {
208178
throw new EvalException(null, "Cannot specify both allow_files and allow_single_file");
@@ -472,7 +442,6 @@ public Descriptor labelAttribute(
472442
Boolean mandatory,
473443
Sequence<?> providers,
474444
Object allowRules,
475-
Boolean singleFile,
476445
Object cfg,
477446
Sequence<?> aspects,
478447
StarlarkThread thread)
@@ -498,8 +467,6 @@ public Descriptor labelAttribute(
498467
providers,
499468
ALLOW_RULES_ARG,
500469
allowRules,
501-
SINGLE_FILE_ARG,
502-
singleFile,
503470
CONFIGURATION_ARG,
504471
cfg,
505472
ASPECTS_ARG,
@@ -515,7 +482,6 @@ public Descriptor labelAttribute(
515482
@Override
516483
public Descriptor stringListAttribute(
517484
Boolean mandatory,
518-
Boolean nonEmpty,
519485
Boolean allowEmpty,
520486
Sequence<?> defaultValue,
521487
String doc,
@@ -529,8 +495,6 @@ public Descriptor stringListAttribute(
529495
defaultValue,
530496
MANDATORY_ARG,
531497
mandatory,
532-
NON_EMPTY_ARG,
533-
nonEmpty,
534498
ALLOW_EMPTY_ARG,
535499
allowEmpty),
536500
Type.STRING_LIST,
@@ -540,7 +504,6 @@ public Descriptor stringListAttribute(
540504
@Override
541505
public Descriptor intListAttribute(
542506
Boolean mandatory,
543-
Boolean nonEmpty,
544507
Boolean allowEmpty,
545508
Sequence<?> defaultValue,
546509
String doc,
@@ -554,8 +517,6 @@ public Descriptor intListAttribute(
554517
defaultValue,
555518
MANDATORY_ARG,
556519
mandatory,
557-
NON_EMPTY_ARG,
558-
nonEmpty,
559520
ALLOW_EMPTY_ARG,
560521
allowEmpty),
561522
Type.INTEGER_LIST,
@@ -572,7 +533,6 @@ public Descriptor labelListAttribute(
572533
Sequence<?> providers,
573534
Sequence<?> flags,
574535
Boolean mandatory,
575-
Boolean nonEmpty,
576536
Object cfg,
577537
Sequence<?> aspects,
578538
StarlarkThread thread)
@@ -592,8 +552,6 @@ public Descriptor labelListAttribute(
592552
flags,
593553
MANDATORY_ARG,
594554
mandatory,
595-
NON_EMPTY_ARG,
596-
nonEmpty,
597555
ALLOW_EMPTY_ARG,
598556
allowEmpty,
599557
CONFIGURATION_ARG,
@@ -619,7 +577,6 @@ public Descriptor labelKeyedStringDictAttribute(
619577
Sequence<?> providers,
620578
Sequence<?> flags,
621579
Boolean mandatory,
622-
Boolean nonEmpty,
623580
Object cfg,
624581
Sequence<?> aspects,
625582
StarlarkThread thread)
@@ -639,8 +596,6 @@ public Descriptor labelKeyedStringDictAttribute(
639596
flags,
640597
MANDATORY_ARG,
641598
mandatory,
642-
NON_EMPTY_ARG,
643-
nonEmpty,
644599
ALLOW_EMPTY_ARG,
645600
allowEmpty,
646601
CONFIGURATION_ARG,
@@ -690,7 +645,6 @@ public Descriptor outputListAttribute(
690645
Boolean allowEmpty,
691646
String doc,
692647
Boolean mandatory,
693-
Boolean nonEmpty,
694648
StarlarkThread thread)
695649
throws EvalException {
696650
BazelStarlarkContext.from(thread).checkLoadingOrWorkspacePhase("attr.output_list");
@@ -700,8 +654,6 @@ public Descriptor outputListAttribute(
700654
optionMap(
701655
MANDATORY_ARG,
702656
mandatory,
703-
NON_EMPTY_ARG,
704-
nonEmpty,
705657
ALLOW_EMPTY_ARG,
706658
allowEmpty),
707659
BuildType.OUTPUT_LIST,
@@ -714,7 +666,6 @@ public Descriptor stringDictAttribute(
714666
Dict<?, ?> defaultValue,
715667
String doc,
716668
Boolean mandatory,
717-
Boolean nonEmpty,
718669
StarlarkThread thread)
719670
throws EvalException {
720671
BazelStarlarkContext.from(thread).checkLoadingOrWorkspacePhase("attr.string_dict");
@@ -725,8 +676,6 @@ public Descriptor stringDictAttribute(
725676
defaultValue,
726677
MANDATORY_ARG,
727678
mandatory,
728-
NON_EMPTY_ARG,
729-
nonEmpty,
730679
ALLOW_EMPTY_ARG,
731680
allowEmpty),
732681
Type.STRING_DICT,
@@ -739,7 +688,6 @@ public Descriptor stringListDictAttribute(
739688
Dict<?, ?> defaultValue,
740689
String doc,
741690
Boolean mandatory,
742-
Boolean nonEmpty,
743691
StarlarkThread thread)
744692
throws EvalException {
745693
BazelStarlarkContext.from(thread).checkLoadingOrWorkspacePhase("attr.string_list_dict");
@@ -750,8 +698,6 @@ public Descriptor stringListDictAttribute(
750698
defaultValue,
751699
MANDATORY_ARG,
752700
mandatory,
753-
NON_EMPTY_ARG,
754-
nonEmpty,
755701
ALLOW_EMPTY_ARG,
756702
allowEmpty),
757703
Type.STRING_LIST_DICT,

src/main/java/com/google/devtools/build/lib/packages/StarlarkSemanticsOptions.java

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -320,20 +320,6 @@ public class StarlarkSemanticsOptions extends OptionsBase implements Serializabl
320320
+ "https://github.com/bazelbuild/bazel/issues/9014 for details.")
321321
public boolean incompatibleDisableTargetProviderFields;
322322

323-
@Option(
324-
name = "incompatible_disable_deprecated_attr_params",
325-
defaultValue = "true",
326-
documentationCategory = OptionDocumentationCategory.STARLARK_SEMANTICS,
327-
effectTags = {OptionEffectTag.BUILD_FILE_SEMANTICS},
328-
metadataTags = {
329-
OptionMetadataTag.INCOMPATIBLE_CHANGE,
330-
OptionMetadataTag.TRIGGERED_BY_ALL_INCOMPATIBLE_CHANGES
331-
},
332-
help =
333-
"If set to true, disable the deprecated parameters 'single_file' and 'non_empty' on "
334-
+ "attribute definition methods, such as attr.label().")
335-
public boolean incompatibleDisableDeprecatedAttrParams;
336-
337323
@Option(
338324
name = "incompatible_disable_depset_items",
339325
defaultValue = "false",
@@ -674,7 +660,6 @@ public StarlarkSemantics toStarlarkSemantics() {
674660
.incompatibleDisableTargetProviderFields(incompatibleDisableTargetProviderFields)
675661
.incompatibleDisableThirdPartyLicenseChecking(
676662
incompatibleDisableThirdPartyLicenseChecking)
677-
.incompatibleDisableDeprecatedAttrParams(incompatibleDisableDeprecatedAttrParams)
678663
.incompatibleAlwaysCheckDepsetElements(incompatibleAlwaysCheckDepsetElements)
679664
.incompatibleDisableDepsetItems(incompatibleDisableDepsetItems)
680665
.incompatibleDisallowEmptyGlob(incompatibleDisallowEmptyGlob)

0 commit comments

Comments
 (0)