diff options
author | kotlaja <kotlaja.nevena@gmail.com> | 2023-09-04 16:52:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-09-04 16:52:18 +0200 |
commit | 0a1e587d96c612d93615743c12e9ea22863da574 (patch) | |
tree | 5c482c07852fd2afbe66a2a8979e1b6fead7feee | |
parent | 719461ac4da5a05ff0dfbab1917a0c3692bf6417 (diff) | |
download | bazelbuild-rules_rust-0a1e587d96c612d93615743c12e9ea22863da574.tar.gz |
Remove usage of grep_includes (#2072)
-rw-r--r-- | rust/private/rust.bzl | 21 | ||||
-rw-r--r-- | rust/private/rustc.bzl | 4 |
2 files changed, 4 insertions, 21 deletions
diff --git a/rust/private/rust.bzl b/rust/private/rust.bzl index df5095e0..dacffb50 100644 --- a/rust/private/rust.bzl +++ b/rust/private/rust.bzl @@ -828,12 +828,7 @@ _rust_test_attrs = dict({ E.g. `bazel test //src:rust_test --test_arg=foo::test::test_fn`. """), ), - "_grep_includes": attr.label( - allow_single_file = True, - cfg = "exec", - default = Label("@bazel_tools//tools/cpp:grep-includes"), - executable = True, - ), + "_use_grep_includes": attr.bool(default = True), }.items() + _coverage_attrs.items() + _experimental_use_cc_common_link_attrs.items()) _common_providers = [ @@ -955,12 +950,7 @@ rust_shared_library = rule( implementation = _rust_shared_library_impl, attrs = dict( _common_attrs.items() + _experimental_use_cc_common_link_attrs.items() + { - "_grep_includes": attr.label( - allow_single_file = True, - cfg = "exec", - default = Label("@bazel_tools//tools/cpp:grep-includes"), - executable = True, - ), + "_use_grep_includes": attr.bool(default = True), }.items(), ), fragments = ["cpp"], @@ -1052,12 +1042,7 @@ _rust_binary_attrs = dict({ default = False, ), "stamp": _stamp_attribute(default_value = -1), - "_grep_includes": attr.label( - allow_single_file = True, - cfg = "exec", - default = Label("@bazel_tools//tools/cpp:grep-includes"), - executable = True, - ), + "_use_grep_includes": attr.bool(default = True), }.items() + _experimental_use_cc_common_link_attrs.items()) rust_binary = rule( diff --git a/rust/private/rustc.bzl b/rust/private/rustc.bzl index 01838f84..f02c0beb 100644 --- a/rust/private/rustc.bzl +++ b/rust/private/rustc.bzl @@ -735,7 +735,6 @@ def collect_inputs( actions = ctx.actions, cc_toolchain = cc_toolchain, feature_configuration = feature_configuration, - grep_includes = ctx.file._grep_includes, source_file = linkstamp.file(), output_file = linkstamp_out, compilation_inputs = linkstamp.hdrs(), @@ -1125,7 +1124,7 @@ def rustc_compile_action( aliases = crate_info.aliases, are_linkstamps_supported = _are_linkstamps_supported( feature_configuration = feature_configuration, - has_grep_includes = hasattr(ctx.attr, "_grep_includes"), + has_grep_includes = hasattr(ctx.attr, "_use_grep_includes"), ), ) @@ -1369,7 +1368,6 @@ def rustc_compile_action( linking_contexts = linking_contexts, compilation_outputs = compilation_outputs, name = output_relative_to_package, - grep_includes = ctx.file._grep_includes, stamp = ctx.attr.stamp, output_type = "executable" if crate_info.type == "bin" else "dynamic_library", ) |