inherit_attrs attribute of macro

8 views
Skip to first unread message

Eric Stoces

unread,
2:54 AM (7 hours ago) 2:54 AM
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, }, ... )

Reply all
Reply to author
Forward
0 new messages