rust-lang / rust-lang/rust-bindgen

Support taking options from a file

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

(This is a feature request.)

Bindgen has a lot of parameters that take regexes. --allowlist-file, in particular, takes a regex with file paths. Because bindgen seems to not properly normalize / and \ on Windows, and instead punts this basic cross-platform operation to the user, those regexes get quite complex. Escaping and quoting such things across build systems and platforms is, sadly, a nightmare. (Many build tools pass their inputs through the shell. It's a huge mess.)

Additionally, projects that need to support multiple build systems have to repeat parameters in multiple ways. Right now, a project's expected bindgen flags needs to be repeated in every build sytem.

bindgen should support some kind of config file that allows passing these options in a more defined manner.

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

No files or tests are named in the issue. Start by locating bindgen’s command-line option entry point and how --allowlist-file is parsed, then review the existing option handling before defining a configuration-file approach. Done should allow projects to express bindgen options without repeating shell-dependent arguments across build systems and platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
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.