ci: pin cbindgen v0.29.2 - #383
Merged
Merged
Conversation
cbindgen v0.29.3 added support for C23 fixed-type enum syntax unconditionally (mozilla/cbindgen#1156) -- it is gated with #if guards but Python's cffi cannot handle those and so our Python bindings would not build. So, pin the newest release without this feature to make our CI green again (we did not pin the cbindgen version used in our CI so the new update also broke our CI). Signed-off-by: Aleksa Sarai <aleksa@amutable.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
martinpitt
added a commit
to martinpitt/libpathrs
that referenced
this pull request
Aug 3, 2026
cbindgen v0.29.3 emits the C23 fixed-type enum syntax for sized enums[1], so in C23 mode pathrs_proc_base_t names the enum rather than uint64_t. CGo maps a C enum to a *signed* Go type, so none of the open-coded ProcBase constants fit in it any more and the package stops compiling: > internal/libpathrs/libpathrs_linux.go:228:22: cannot use > 0xFFFF_FFFE_7072_6F63 (untyped int constant 18446744067006164835) as > ProcBase value in constant declaration (overflows) Our own tree does not show this, because CI is pinned to cbindgen v0.29.2[2], so the checked-in header and the release tarball still typedef uint64_t. Fedora (and presumably other distros) do hit it, because they build the crate with `cargo-c`, which generates the header with its own cbindgen. Fedora rawhide has cbindgen v0.29.4 and gcc 16, which defaults to C23, so libpathrs-devel-0.2.5-2.fc45 ships the C23 spelling and every Go consumer of it fails to build. The workaround there is to force the older language version with `CGO_CFLAGS=-std=gnu17`. Declare the type as plain uint64 instead, which is what the docstring already promises. That also holds up under the direction discussed in [1], where the #if guards would be dropped in favour of an opt-out and the enum spelling would become unconditional. Nothing else has to change: the values were already converted with C.pathrs_proc_base_t() at each call site, and init() already reads the C constants through int64 temporaries because CGo signs those too. [1]: mozilla/cbindgen#1156 [2]: cyphar#383 Signed-off-by: Martin Pitt <martin@amutable.com>
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.
cbindgen v0.29.3 added support for C23 fixed-type enum syntax
unconditionally (mozilla/cbindgen#1156) -- it is gated with
#ifguardsbut Python's cffi cannot handle those and so our Python bindings would
not build.
So, pin the newest release without this feature to make our CI green
again (we did not pin the cbindgen version used in our CI so the new
update also broke our CI).
Signed-off-by: Aleksa Sarai aleksa@amutable.com