Skip to content

ci: pin cbindgen v0.29.2 - #383

Merged
cyphar merged 1 commit into
mainfrom
cbindgen-0.29.2
May 30, 2026
Merged

ci: pin cbindgen v0.29.2#383
cyphar merged 1 commit into
mainfrom
cbindgen-0.29.2

Conversation

@cyphar

@cyphar cyphar commented May 30, 2026

Copy link
Copy Markdown
Owner

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

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

codecov Bot commented May 30, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@cyphar
cyphar merged commit f3e6df4 into main May 30, 2026
119 checks passed
@cyphar
cyphar deleted the cbindgen-0.29.2 branch May 30, 2026 14:21
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant