Open neilisaac opened 3 months ago
I worked around this by generating an empty .cc file and creating a dummy cc_library target that depends on it + the headers, which is passed to cc_lib, then I wrap rust_bindgen with a rust_library that adds the real shared object to deps.
rust_bindgen
currently asserts that the cc_lib has an associated static library to link: https://github.com/bazelbuild/rules_rust/blob/main/bindgen/private/bindgen.bzl#L140. This is problematic for use cases where this cannot be satisfied.Example use cases:
Ideally rust_bindgen should just be a code generator that does not impose any additional requirements not needed by bindgen itself, or a separate un-opinionated interoperable code generation rule should be provided.