rules_cc
rules_cc copied to clipboard
cc_shared_library publishes CcInfo
The core mechanism of cc_shared_library is nice in that it decouples the libraries you actually depend on from the linking and library structure. However I run into several cases where I'd really just like cc_shared_library to behave like a fancy cc_library:
- Passing to rulesets not aware of dynamic_deps such as rules_foreign_cc
- A package wanting to expose its cc_shared_library transparently for consumers to pick up, without having to edit the definition of every downstream cc_binary to have both the cc_library in deps and cc_shared_library in dynamic_deps.
This adds a CcInfo provider to cc_shared_library so it can be used anywhere an existing cc_library can. Separately, I'll PR to bazel to detect a CcSharedLibraryInfo provider in deps and automatically add it to dynamic_deps.
The CcInfo provider was omitted on purpose. cc_shared_library is a very heavy rule that flattens nested sets, we wanted to avoid people adding a cc_shared_libraries in the middle of a huge dependency graph. Perhaps this design decision will be revisited in the future but not now.
The CcInfo provider was omitted on purpose. cc_shared_library is a very heavy rule that flattens nested sets, we wanted to avoid people adding a cc_shared_libraries in the middle of a huge dependency graph. Perhaps this design decision will be revisited in the future but not now.
Closed for this reason.