Feature Request: local_includes for cc_library, making an easy path for good cross-platform hygiene #16472
Labels
P3
We're not considering working on this, but happy to review a PR. (No assignee)
team-Rules-CPP
Issues for C++ rules
type: feature request
Hi wonderful Bazelers,
This is a small-scope cc feature request.
As background: cc_library lets you specify include directories for its headers, automatically handling the package. This is very nice for interface headers but bad problematic for implementation headers you don't want to propagate to dependents. The docs steer you to add
-I
flags to copts to handle that case.The problem is that this leads people to write code that won't work with toolchains where the flags are different. And needing to figure out that you have to use package_name() (which doesn't handle the external workspace case) tends to lead users to just make all includes public, propagating them to all dependencies. Bad times.
A fairly simple new parameter, local_includes could solve this well, I'd propose. What do you think?
Thanks,
Chris
(ex-Googler)
P.S. Edited from the template for clarity, brevity, and friendliness.
The text was updated successfully, but these errors were encountered: