Skip to content

Commit

Permalink
BEGIN_PUBLIC
Browse files Browse the repository at this point in the history
Clean grep_includes
END_PUBLIC

grep_includes is moved to a cc_toolchain and there is no need anymore to specify it as a rule's attribute.

PiperOrigin-RevId: 562592157
Change-Id: I24415282639a6a51d3269fd8056c1b556c728456
  • Loading branch information
kotlaja authored and copybara-github committed Sep 4, 2023
1 parent 290fc80 commit ca8b398
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 42 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ cc_binary_attrs_with_aspects = {
"licenses": attr.license() if hasattr(attr, "license") else attr.string_list(),
"_cc_binary": attr.bool(),
"_is_test": attr.bool(default = False),
"_grep_includes": semantics.get_grep_includes(),
"_stl": semantics.get_stl(),
"_cc_toolchain": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
"_cc_toolchain_type": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:toolchain_type"),
Expand Down
4 changes: 1 addition & 3 deletions src/main/starlark/builtins_bzl/common/cc/cc_common.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -669,8 +669,7 @@ def _register_linkstamp_compile_action(
compilation_inputs,
inputs_for_validation,
label_replacement,
output_replacement,
grep_includes = None):
output_replacement):
cc_common_internal.check_private_api(allowlist = _PRIVATE_STARLARKIFICATION_ALLOWLIST)
return cc_common_internal.register_linkstamp_compile_action(
actions = actions,
Expand Down Expand Up @@ -864,7 +863,6 @@ def _create_compile_action(
action_name,
compilation_context,
additional_inputs = None,
grep_includes = None,
additional_outputs = []):
cc_common_internal.check_private_api(allowlist = _CREATE_COMPILE_ACTION_API_ALLOWLISTED_PACKAGES)
return cc_common_internal.create_compile_action(
Expand Down
6 changes: 0 additions & 6 deletions src/main/starlark/builtins_bzl/common/cc/cc_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -199,12 +199,6 @@ cc_import = rule(
allow_files = True,
flags = ["SKIP_CONSTRAINTS_OVERRIDE"],
),
"_grep_includes": attr.label(
allow_files = True,
executable = True,
cfg = "exec",
default = Label("@" + semantics.get_repo() + "//tools/cpp:grep-includes"),
),
"_cc_toolchain": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
"_use_auto_exec_groups": attr.bool(default = True),
},
Expand Down
6 changes: 0 additions & 6 deletions src/main/starlark/builtins_bzl/common/cc/cc_library.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -600,12 +600,6 @@ attrs = {
flags = ["ORDER_INDEPENDENT", "DIRECT_COMPILE_TIME_INPUT"],
),
"_stl": semantics.get_stl(),
"_grep_includes": attr.label(
allow_files = True,
executable = True,
cfg = "exec",
default = Label("@" + semantics.get_repo() + "//tools/cpp:grep-includes"),
),
"_def_parser": semantics.get_def_parser(),
"_cc_toolchain": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
"_use_auto_exec_groups": attr.bool(default = True),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ def _aspect_impl(target, ctx):

# shouldProcessHeaders is set to true everytime, however java implementation of
# compile gets this value from cc_toolchain.
# Missing grep_includes, should not be necessary.
# Missing stl compilation context, should not be necessary.

outputs = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -832,12 +832,6 @@ cc_shared_library = rule(
"user_link_flags": attr.string_list(),
"_def_parser": semantics.get_def_parser(),
"_cc_toolchain": attr.label(default = "@" + semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
"_grep_includes": attr.label(
allow_files = True,
executable = True,
cfg = "exec",
default = Label("@" + semantics.get_repo() + "//tools/cpp:grep-includes"),
),
},
toolchains = cc_helper.use_cpp_toolchain(),
fragments = ["cpp"] + semantics.additional_fragments(),
Expand Down
1 change: 0 additions & 1 deletion src/main/starlark/builtins_bzl/common/java/java_binary.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,6 @@ BASIC_JAVA_BINARY_ATTRIBUTES = merge_attrs(
allow_single_file = True,
),
"_cc_toolchain": attr.label(default = "@" + cc_semantics.get_repo() + "//tools/cpp:current_cc_toolchain"),
"_grep_includes": cc_semantics.get_grep_includes(),
"_java_toolchain_type": attr.label(default = semantics.JAVA_TOOLCHAIN_TYPE),
},
)
Expand Down
10 changes: 0 additions & 10 deletions src/main/starlark/builtins_bzl/common/objc/attrs.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -62,15 +62,6 @@ _COMPILE_DEPENDENCY_RULE = {
),
}

_INCLUDE_SCANNING_RULE = {
"_grep_includes": attr.label(
allow_single_file = True,
cfg = "exec",
default = "@" + semantics.get_repo() + "//tools/cpp:grep-includes",
executable = True,
),
}

_SDK_FRAMEWORK_DEPENDER_RULE = {
"sdk_frameworks": attr.string_list(),
"weak_sdk_frameworks": attr.string_list(),
Expand Down Expand Up @@ -98,7 +89,6 @@ common_attrs = struct(
COMPILING_RULE = _COMPILING_RULE,
COMPILE_DEPENDENCY_RULE = _COMPILE_DEPENDENCY_RULE,
COPTS_RULE = _COPTS_RULE,
INCLUDE_SCANNING_RULE = _INCLUDE_SCANNING_RULE,
LICENSES = semantics.get_licenses_attr(),
SDK_FRAMEWORK_DEPENDER_RULE = _SDK_FRAMEWORK_DEPENDER_RULE,
)
1 change: 0 additions & 1 deletion src/main/starlark/builtins_bzl/common/objc/objc_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,6 @@ objc_import = rule(
common_attrs.ALWAYSLINK_RULE,
common_attrs.CC_TOOLCHAIN_RULE,
common_attrs.COMPILE_DEPENDENCY_RULE,
common_attrs.INCLUDE_SCANNING_RULE,
common_attrs.LICENSES,
common_attrs.SDK_FRAMEWORK_DEPENDER_RULE,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ objc_library = rule(
common_attrs.COMPILING_RULE,
common_attrs.COMPILE_DEPENDENCY_RULE,
common_attrs.COPTS_RULE,
common_attrs.INCLUDE_SCANNING_RULE,
common_attrs.LICENSES,
common_attrs.SDK_FRAMEWORK_DEPENDER_RULE,
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -641,12 +641,6 @@ protected static void addAppleBinaryStarlarkRule(Scratch scratch) throws Excepti
" default=Label('" + toolsRepo + "//tools/cpp:current_cc_toolchain'),),",
" '_dummy_lib': attr.label(",
" default = Label('" + toolsLoc + "/dummy:dummy_lib'),),",
" '_grep_includes': attr.label(",
" cfg = 'exec',",
" allow_single_file = True,",
" executable = True,",
" default = Label('" + toolsRepo + "//tools/cpp:grep-includes'),",
" ),",
" '_j2objc_dead_code_pruner': attr.label(",
" executable = True,",
" allow_files=True,",
Expand Down

0 comments on commit ca8b398

Please sign in to comment.