Eric Stoces
unread,2:54 AM (7 hours ago) 2:54 AMSign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to bazel-discuss
In the help, there is an example of using native.cc_library for inherited attributes. This does not seem to work... Bazel is complaining that native.cc_library is a function. Should this work or is the documentation wrong?
# macro/macro.bzl
my_macro = macro(
inherit_attrs = native.cc_library,
ERROR: Traceback (most recent call last):
File "/workspaces/joint/build/macros/cc_service_library.bzl", line 49, column 20, in <toplevel>
cc_service_library = macro(
Error in macro: in call to macro(), parameter 'inherit_attrs' got value of type 'function', want 'rule, macro, string, or NoneType'# macro/macro.bzl
my_macro = macro(
inherit_attrs = native.cc_library,
attrs = {
# override native.cc_library's `local_defines` attribute
"local_defines": attr.string_list(default = ["FOO"]),
# do not inherit native.cc_library's `defines` attribute
"defines": None,
},
...
)
# macro/macro.bzl
my_macro = macro(
inherit_attrs = native.cc_library,
attrs = {
# override native.cc_library's `local_defines` attribute
"local_defines": attr.string_list(default = ["FOO"]),
# do not inherit native.cc_library's `defines` attribute
"defines": None,
},
...
)