Skip to content

Commit 0a1e587

Browse files
authored
Remove usage of grep_includes (#2072)
1 parent 719461a commit 0a1e587

File tree

2 files changed

+4
-21
lines changed

2 files changed

+4
-21
lines changed

rust/private/rust.bzl

+3-18
Original file line numberDiff line numberDiff line change
@@ -828,12 +828,7 @@ _rust_test_attrs = dict({
828828
E.g. `bazel test //src:rust_test --test_arg=foo::test::test_fn`.
829829
"""),
830830
),
831-
"_grep_includes": attr.label(
832-
allow_single_file = True,
833-
cfg = "exec",
834-
default = Label("@bazel_tools//tools/cpp:grep-includes"),
835-
executable = True,
836-
),
831+
"_use_grep_includes": attr.bool(default = True),
837832
}.items() + _coverage_attrs.items() + _experimental_use_cc_common_link_attrs.items())
838833

839834
_common_providers = [
@@ -955,12 +950,7 @@ rust_shared_library = rule(
955950
implementation = _rust_shared_library_impl,
956951
attrs = dict(
957952
_common_attrs.items() + _experimental_use_cc_common_link_attrs.items() + {
958-
"_grep_includes": attr.label(
959-
allow_single_file = True,
960-
cfg = "exec",
961-
default = Label("@bazel_tools//tools/cpp:grep-includes"),
962-
executable = True,
963-
),
953+
"_use_grep_includes": attr.bool(default = True),
964954
}.items(),
965955
),
966956
fragments = ["cpp"],
@@ -1052,12 +1042,7 @@ _rust_binary_attrs = dict({
10521042
default = False,
10531043
),
10541044
"stamp": _stamp_attribute(default_value = -1),
1055-
"_grep_includes": attr.label(
1056-
allow_single_file = True,
1057-
cfg = "exec",
1058-
default = Label("@bazel_tools//tools/cpp:grep-includes"),
1059-
executable = True,
1060-
),
1045+
"_use_grep_includes": attr.bool(default = True),
10611046
}.items() + _experimental_use_cc_common_link_attrs.items())
10621047

10631048
rust_binary = rule(

rust/private/rustc.bzl

+1-3
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,6 @@ def collect_inputs(
735735
actions = ctx.actions,
736736
cc_toolchain = cc_toolchain,
737737
feature_configuration = feature_configuration,
738-
grep_includes = ctx.file._grep_includes,
739738
source_file = linkstamp.file(),
740739
output_file = linkstamp_out,
741740
compilation_inputs = linkstamp.hdrs(),
@@ -1125,7 +1124,7 @@ def rustc_compile_action(
11251124
aliases = crate_info.aliases,
11261125
are_linkstamps_supported = _are_linkstamps_supported(
11271126
feature_configuration = feature_configuration,
1128-
has_grep_includes = hasattr(ctx.attr, "_grep_includes"),
1127+
has_grep_includes = hasattr(ctx.attr, "_use_grep_includes"),
11291128
),
11301129
)
11311130

@@ -1369,7 +1368,6 @@ def rustc_compile_action(
13691368
linking_contexts = linking_contexts,
13701369
compilation_outputs = compilation_outputs,
13711370
name = output_relative_to_package,
1372-
grep_includes = ctx.file._grep_includes,
13731371
stamp = ctx.attr.stamp,
13741372
output_type = "executable" if crate_info.type == "bin" else "dynamic_library",
13751373
)

0 commit comments

Comments
 (0)