Repository navigation
Build bindgen without its prettyplease feature - #148
Open
sabzanotto7 wants to merge 2 commits into
Open
sabzanotto7 wants to merge 2 commits into
sabzanotto7 wants to merge 2 commits into
Conversation
build.rs never selects a formatter, so bindgen formats the bindings with its default, rustfmt. The prettyplease feature, on by default, is compiled and never called. bindgen 0.73.2 accepts syn 2 or 3 and prettyplease 0.2 or 0.3 independently, and prettyplease 0.3 needs syn 3. In a dependent's lock file that holds both syn majors, an unrelated `cargo update` can leave bindgen on syn 2 beside prettyplease 0.3, and bindgen then fails to compile (rust-lang/rust-bindgen#3448, rust-lang/rust-bindgen#3551). The failing code sits behind the prettyplease feature, so without the feature the pair cannot break the build. The generated bindings are byte-identical before and after. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
uklotzde
previously approved these changes
Nov 23, 2026
Contributor
|
@sabzanotto7 Can you fix the auto-formatting in the changelog? See the failing pre-commit check. |
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
uklotzde
reviewed
Nov 24, 2026
|
|
||
| ## [Unreleased] | ||
|
|
||
| ### Changed |
Collaborator
There was a problem hiding this comment.
@sgoll Do really need a changelog entry? There are no user facing changes, just an internal build optimization.
IMHO only adds noise and could be removed. The Git history is appropriate to store this info.
Contributor
There was a problem hiding this comment.
I'm unsure. From the PR description, the change does read like something that affects consumers of the crate, resulting in possible bindgen compilation errors without it.
@sabzanotto7 Care to weigh in? Would you say we should reword the changelog message slightly, so it better explains the consequences of the change, instead of purely describing what it does?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
build.rsnever selects a formatter, so bindgen formats the bindings with its default,Formatter::Rustfmt. bindgen'sprettypleasefeature is on by default, soprettypleaseiscompiled into the build script and never called. This turns that feature off and keeps the other
two defaults,
loggingandruntime.Why
bindgen 0.73.2 accepts
syn2 or 3 andprettyplease0.2 or 0.3 independently, whileprettyplease0.3 needssyn3. In a dependent's lock file that holds bothsynmajors (mostlarger workspaces do), an unrelated
cargo updatecan leave bindgen onsyn2 besideprettyplease0.3, and bindgen then fails to compile with theParseQuoteerror reported inrust-lang/rust-bindgen#3448 and rust-lang/rust-bindgen#3551. The fix proposed there
(rust-lang/rust-bindgen#3506) is not released.
The failing
syn::parse_quote!sits behind bindgen'sprettypleasefeature. Without the featurethe pair cannot break the build of this crate, whichever
synthe resolver picks, and there is onecrate fewer to compile.
Checked
bindings.rsis byte-identical before and after (x86_64 Linux, same sha256), since rustfmtstays the formatter.
cargo test --lockedpasses.Cargo.locklosesprettypleaseand nothing else moves.🤖 Generated with Claude Code