rust-lang / rust-lang/rust-bindgen

Publishing self-contained static executable (with bundled libclang.a)

Open
#2,767 3 comments 3 reactions 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

One of the biggest pain points about using bindgen is installing libclang. It's a massive dependency to manage, and adds pain to the development and deployment of Rust apps. It would be nice if you could just run bindgen-cli-installer.sh and be done with it, whether you're compiling in CI or on a laptop.

The downside is that the generated executable is pretty massive (85M on arm64-darwin, compared to 5.4M now).

There's already support for statically linking libclang.a, so I think this is mostly a matter of automating the release process. I have a hacky proof-of-concept here for reference.

I'd be happy to work on making this happen if others would find it useful.

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

Review bindgen-cli-installer.sh, the linked proof of concept, and the existing support for statically linking libclang.a. Determine how release automation can produce self-contained executables with bundled libclang.a across the relevant platforms, while checking the resulting binary sizes. Done means the release process reliably produces installers that no longer require a separate libclang installation.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, release
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.