Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollforward of https://github.com/bazelbuild/bazel/commit/10a46b1e85f… #19809

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ private void checkVisibilityAttributeContents(
// TODO(plf): Add the PackageSpecificationProvider to the 'visibility' attribute.
if (!attrName.equals("visibility")
&& !attrName.equals(FunctionSplitTransitionAllowlist.ATTRIBUTE_NAME)
&& !attrName.equals(FunctionSplitTransitionAllowlist.LEGACY_ATTRIBUTE_NAME)
&& !containsPackageSpecificationProvider) {
context.attributeError(
attrName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -521,8 +521,7 @@ public static StarlarkRuleFunction createRule(
}
// Check for existence of the function transition allowlist attribute.
// TODO(b/121385274): remove when we stop allowlisting starlark transitions
if (name.equals(FunctionSplitTransitionAllowlist.ATTRIBUTE_NAME)
|| name.equals(FunctionSplitTransitionAllowlist.LEGACY_ATTRIBUTE_NAME)) {
if (name.equals(FunctionSplitTransitionAllowlist.ATTRIBUTE_NAME)) {
if (!BuildType.isLabelType(attr.getType())) {
throw Starlark.errorf("_allowlist_function_transition attribute must be a label type");
}
Expand All @@ -536,13 +535,7 @@ public static StarlarkRuleFunction createRule(
if (!(defaultLabel
.getPackageName()
.equals(FunctionSplitTransitionAllowlist.LABEL.getPackageName())
&& defaultLabel.getName().equals(FunctionSplitTransitionAllowlist.LABEL.getName()))
&& !(defaultLabel
.getPackageName()
.equals(FunctionSplitTransitionAllowlist.LEGACY_LABEL.getPackageName())
&& defaultLabel
.getName()
.equals(FunctionSplitTransitionAllowlist.LEGACY_LABEL.getName()))) {
&& defaultLabel.getName().equals(FunctionSplitTransitionAllowlist.LABEL.getName()))) {
throw Starlark.errorf(
"_allowlist_function_transition attribute (%s) does not have the expected value %s",
defaultLabel, FunctionSplitTransitionAllowlist.LABEL);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,8 @@
public class FunctionSplitTransitionAllowlist {
public static final String NAME = "function_transition";
public static final String ATTRIBUTE_NAME = "$allowlist_function_transition";
public static final String LEGACY_ATTRIBUTE_NAME = "$whitelist_function_transition";
public static final Label LABEL =
Label.parseCanonicalUnchecked("//tools/allowlists/function_transition_allowlist");
public static final Label LEGACY_LABEL =
Label.parseCanonicalUnchecked("//tools/whitelists/function_transition_whitelist");

private FunctionSplitTransitionAllowlist() {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ public void testCcImportWithSharedLibraryWithTransitionAddsRpathEntry() throws E
"apply_custom_transition = rule(",
" implementation = _apply_custom_transition_impl,",
" attrs = {",
" '_whitelist_function_transition': attr.label(",
" '_allowlist_function_transition': attr.label(",
" default = '//tools/allowlists/function_transition_allowlist',",
" ),",
" 'deps': attr.label_list(cfg = custom_transition),",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1739,7 +1739,7 @@ private void prepareCustomTransition() throws Exception {
"apply_custom_transition = rule(",
" implementation = _apply_custom_transition_impl,",
" attrs = {",
" '_whitelist_function_transition': attr.label(",
" '_allowlist_function_transition': attr.label(",
" default = '//tools/allowlists/function_transition_allowlist',",
" ),",
" 'deps': attr.label_list(cfg = custom_transition),",
Expand Down
2 changes: 1 addition & 1 deletion src/test/shell/integration/cpp_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ outer = rule(
"${TOOLS_REPOSITORY}//tools/cpp:current_cc_toolchain",
),
),
"_whitelist_function_transition": attr.label(default = "${TOOLS_REPOSITORY}//tools/whitelists/function_transition_whitelist"),
"_allowlist_function_transition": attr.label(default = "${TOOLS_REPOSITORY}//tools/allowlists/function_transition_allowlist"),
},
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,8 @@ rule_with_transition = rule(
cfg = my_transition,
attrs = {
"src": attr.label(allow_files = True),
"_whitelist_function_transition":
attr.label(default = "@bazel_tools//tools/whitelists/function_transition_whitelist"),
"_allowlist_function_transition":
attr.label(default = "@bazel_tools//tools/allowlists/function_transition_allowlist"),
},
)
EOF
Expand Down
Loading