rust-lang / rust-lang/rust-bindgen

Dump bound symbols for use in downstream bindgen blocklist

Open
#3,326 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
5.3k
Forks
829
Avg merge
1d 1h
Merged PRs (30d)
15

Description

I have with N C libraries and N -sys crates. Let's say N=2 call them foo, bar, foo-sys, and bar-sys. Bar drepends on foo, and I want likewise for bar-sys to depend on foo-sys.

To do this, I need bar-sys to blocklist everything that ended up in foo-sys, so it doesn't make fresh, competing bindings for it.

I can write that by hand, but it's not very maintainable. Can i instead dump the symbols when building foo-sys and import that into bar-sys's blacklist?

The importing part is just a little bit of build.rs elbow grease. It's the exporting part that I think will require a new in bindgen itself.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the build.rs workflow described in the issue and trace how bindgen collects symbols and applies blocklists. Determine the interface for exporting symbols from foo-sys and importing them into bar-sys. Done means downstream bindings can consume the exported list so bar-sys does not generate competing bindings for foo-sys symbols.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, rust
Domain
tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.