rules_rust icon indicating copy to clipboard operation
rules_rust copied to clipboard

rust_bindgen should not require a static library

Open neilisaac opened this issue 8 months ago • 1 comments

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:

  • 3rd party vendor provides a pre-compiled shared object and header only (used via cc_library + cc_import)
  • generating rust constants from a header file without any code to link to

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.

neilisaac avatar Jun 18 '24 17:06 neilisaac