rules_cc icon indicating copy to clipboard operation
rules_cc copied to clipboard

Add a `cc_inputs` attribute to include arbitrary files in compilation actions and support location expansion

Open jschear opened this issue 4 months ago • 6 comments

rules_swift's swift_library has a swiftc_inputs attribute, which serves as a way to pass labels that are used in $(location) expansion in other attributes.

There are a few places in rules_swift and rules_apple where the headers field of CcInfo is being used/abused for this purpose:

  • https://github.com/bazelbuild/rules_apple/blob/master/apple/internal/header_map.bzl#L98
  • https://github.com/bazelbuild/rules_swift/blob/646d6d229edc0b22ea3b9dc891062de519d27d4c/mixed_language/internal/library.bzl#L154

It would be nice if there was a dedicated attribute. I'd be happy to contribute if this request makes sense.

jschear avatar Aug 22 '25 19:08 jschear