bazel icon indicating copy to clipboard operation
bazel copied to clipboard

Unclear or impossible to return new `includes` from a custom rule

Open zrlk opened this issue 11 years ago • 3 comments

(Running under a custom build of Bazel that grants genproto the same powers in C++ as it has in Java; see https://github.com/google/bazel/issues/114 ,) I'm not able to get a depending cc_library to respect the includes that are returned by a custom rule it depends upon. I've added "includes" to the custom rule's providers list.

zrlk avatar Apr 13 '15 17:04 zrlk

As detailed in #114 , you should be generating C++ sources, and bulding a cc_library from that. Does that work for you?

hanwen avatar Apr 15 '15 08:04 hanwen

I ended up writing a macro instead of a custom rule (see genproto_all in https://github.com/google/kythe/blob/master/tools/build_rules/genproto.bzl). With this approach I need to remember to depend on foo_proto_cc instead of foo_proto, but aside from that, things are working now.

zrlk avatar Apr 15 '15 19:04 zrlk

Interoperability with native rules is a bigger topic than this bug.

ulfjack avatar Apr 17 '15 11:04 ulfjack