Build requirement on clang ≥ 23: patched rust-bindgen
With clang 23.x, stock rust-bindgen 0.73.2 turns libc size_t (e.g. strlen, memcpy) into __BindgenOpaqueArray8, which breaks the KRAID Rust bindings — rust-bindgen#3509. The fix, PR #3510, is merged upstream but not in a release yet.
prepare() checks for this and stops with an error before the build starts.
To fix it, rebuild rust-bindgen with the fix commit applied:
git clone https://gitlab.archlinux.org/archlinux/packaging/packages/rust-bindgen.git && cd rust-bindgen
curl -fsSL https://github.com/rust-lang/rust-bindgen/commit/296449e41098847039e091e304404436d9b2144a.patch -o bindgen-pr3510.patch
In the PKGBUILD:
- add 'bindgen-pr3510.patch' to source=() and run updpkgsums
- in prepare(), right after cd $pkgname-$pkgver, add patch -Np1 -i ../bindgen-pr3510.patch
- set pkgrel=1.1
Then run makepkg -si.
Check it worked (should print 0):
printf '#include <string.h>\n' > /tmp/p.h && bindgen /tmp/p.h --allowlist-function strlen | grep -c __BindgenOpaque
This comment will be removed once a rust-bindgen release containing #3510 reaches the repos.
Pinned Comments
Grimish commented on 2026-10-07 03:02 (UTC) (edited on 2026-10-07 03:07 (UTC) by Grimish)
Build requirement on clang ≥ 23: patched rust-bindgen
With clang 23.x, stock
rust-bindgen0.73.2 turns libcsize_t(e.g.strlen,memcpy) into__BindgenOpaqueArray8, which breaks the KRAID Rust bindings — rust-bindgen#3509. The fix, PR #3510, is merged upstream but not in a release yet.prepare()checks for this and stops with an error before the build starts.To fix it, rebuild rust-bindgen with the fix commit applied:
In the PKGBUILD: - add
'bindgen-pr3510.patch'tosource=()and runupdpkgsums- inprepare(), right aftercd $pkgname-$pkgver, addpatch -Np1 -i ../bindgen-pr3510.patch- setpkgrel=1.1Then run
makepkg -si.Check it worked (should print
0):This comment will be removed once a rust-bindgen release containing #3510 reaches the repos.