|
14 | 14 |
|
15 | 15 | """Rust rule implementations"""
|
16 | 16 |
|
| 17 | +load("@aspect_bazel_lib//lib:resource_sets.bzl", "resource_set_attr") |
17 | 18 | load("@bazel_skylib//lib:paths.bzl", "paths")
|
18 | 19 | load("@rules_cc//cc/common:cc_info.bzl", "CcInfo")
|
19 | 20 | load("//rust/private:common.bzl", "COMMON_PROVIDERS", "rust_common")
|
@@ -817,7 +818,7 @@ _rust_test_attrs = {
|
817 | 818 | rust_library = rule(
|
818 | 819 | implementation = _rust_library_impl,
|
819 | 820 | provides = COMMON_PROVIDERS,
|
820 |
| - attrs = _common_attrs | { |
| 821 | + attrs = _common_attrs | resource_set_attr | { |
821 | 822 | "disable_pipelining": attr.bool(
|
822 | 823 | default = False,
|
823 | 824 | doc = dedent("""\
|
@@ -915,7 +916,7 @@ _rust_static_library_transition = transition(
|
915 | 916 |
|
916 | 917 | rust_static_library = rule(
|
917 | 918 | implementation = _rust_static_library_impl,
|
918 |
| - attrs = _common_attrs | { |
| 919 | + attrs = _common_attrs | resource_set_attr | { |
919 | 920 | "platform": attr.label(
|
920 | 921 | doc = "Optional platform to transition the static library to.",
|
921 | 922 | default = None,
|
@@ -964,7 +965,7 @@ _rust_shared_library_transition = transition(
|
964 | 965 |
|
965 | 966 | rust_shared_library = rule(
|
966 | 967 | implementation = _rust_shared_library_impl,
|
967 |
| - attrs = _common_attrs | _experimental_use_cc_common_link_attrs | { |
| 968 | + attrs = _common_attrs | _experimental_use_cc_common_link_attrs | resource_set_attr | { |
968 | 969 | "platform": attr.label(
|
969 | 970 | doc = "Optional platform to transition the shared library to.",
|
970 | 971 | default = None,
|
@@ -1017,7 +1018,7 @@ rust_proc_macro = rule(
|
1017 | 1018 | # need to declare `_allowlist_function_transition`, see
|
1018 | 1019 | # https://docs.bazel.build/versions/main/skylark/config.html#user-defined-transitions.
|
1019 | 1020 | attrs = dict(
|
1020 |
| - _common_attrs.items(), |
| 1021 | + (_common_attrs | resource_set_attr).items(), |
1021 | 1022 | _allowlist_function_transition = attr.label(
|
1022 | 1023 | default = Label("//tools/allowlists/function_transition_allowlist"),
|
1023 | 1024 | ),
|
@@ -1105,7 +1106,7 @@ _rust_binary_transition = transition(
|
1105 | 1106 | rust_binary = rule(
|
1106 | 1107 | implementation = _rust_binary_impl,
|
1107 | 1108 | provides = COMMON_PROVIDERS,
|
1108 |
| - attrs = _common_attrs | _rust_binary_attrs | { |
| 1109 | + attrs = _common_attrs | _rust_binary_attrs | resource_set_attr | { |
1109 | 1110 | "platform": attr.label(
|
1110 | 1111 | doc = "Optional platform to transition the binary to.",
|
1111 | 1112 | default = None,
|
@@ -1294,7 +1295,7 @@ _rust_test_transition = transition(
|
1294 | 1295 | rust_test = rule(
|
1295 | 1296 | implementation = _rust_test_impl,
|
1296 | 1297 | provides = COMMON_PROVIDERS,
|
1297 |
| - attrs = _common_attrs | _rust_test_attrs | { |
| 1298 | + attrs = _common_attrs | _rust_test_attrs | resource_set_attr | { |
1298 | 1299 | "platform": attr.label(
|
1299 | 1300 | doc = "Optional platform to transition the test to.",
|
1300 | 1301 | default = None,
|
|
0 commit comments