rust-lang / rust-lang/rust-bindgen

Bundle libclang with bindgen

Open
#918 14 comments 23 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Goal: make it super easy for people to use bindgen (and crates to depend on bindgen without inflicting downstream pain), no installing libclang manually, no configuring LIBCLANG_PATH, no making sure your libclang is the right version.

Previously, we have speculated about getting rustup to distribute libclang for us. I talked with @alexcrichton and he pointed out that we don't even need to do that to get what we want. We can bundle libclang.{so,dll,dylib} into our crate directly and then have build.rs setup LIBCLANG_PATH as needed.

To be clear, this functionality would be behind a new feature, on by default. One could always turn this feature off to get the current behavior, and for targets for which we don't have a bundled libclang available, we will also have the current behavior.

There are still some open questions:

  • Should we put the bundled libclang into this repository? A different bindgen-libclangs repository?

  • Should we use git lfs?

  • Should the libclangs be literally bundled in the crate, and downloaded with the rest of the crate's source, or should we fetch only the target's libclang inside build.rs?

  • What targets should we bundle libclang for? Tier-1 platforms? Start with one or two and then add more as we go?

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 by reading the existing build.rs flow and how bindgen currently locates libclang. Resolve the repository, packaging, download, and target-support questions listed in the issue, then define the default feature, opt-out behavior, and fallback for unsupported targets.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, tooling
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.