bazelbuild / bazelbuild/rules_rust

rust_bindgen should not require a static library

Open
#2,704 1 comment 0 reactions 1 assignee Claimed by @scentini View on GitHub
bindgen needs-triage
Dominant language
Starlark
Stars
843
Forks
651
Avg merge
2d 18h
Merged PRs (30d)
15

Description

`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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.