Thanks, I see. The solution in this example is to return a CcInfo with the merged output of the libraries.
My example was a bit too simplified. Our rule builds some libraries but also links some binaries. The libraries will be used by some rules, but the binaries will be used by other rules. I suppose that we cannot return one single CcInfo. Is is possible to return multiple CcInfo instances and later filter out which CcInfo to use where?
def _custom_rule_that_builds_two_libs_with_cc_common_compile_impl(...):
...
return [CcInfo(library_output), CcInfo(binary_output)]
cc_binary(
name = "rule_that_needs_libs",
deps = ??? # Use the library CcInfo from above rule
)
some_other_rule(
name = "rule_that_needs_bins",
deps = ??? # Use the binary CcInfo from above rule
)
BR,
Magnus