fix(ci): unbreak the self-hosted A1 runner (libmoq clippy + ffmpeg bindgen headers)#1782
Conversation
On arm64 Linux `c_char` is `u8`, so `cstr as *const u8` is a no-op that clippy's `unnecessary_cast` rejects under `-D warnings`, breaking the Check job on the self-hosted A1 runner. On x86/macOS `c_char` is `i8`, where the cast is required, so it can't simply be removed. `.cast::<u8>()` works on both platforms and isn't flagged by the lint. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (1)
WalkthroughIn In 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
…1 runner ffmpeg-sys-next runs bindgen, whose libclang doesn't inherit the nix cc wrapper's libc include paths. On the self-hosted A1 runner there are no system headers in /usr/include, so a clean build fails with "'errno.h' file not found". GitHub-hosted Ubuntu has system glibc headers, which masked this; the failure only surfaces when ffmpeg-sys-next rebuilds from a cold cache on the headerless runner. Export BINDGEN_EXTRA_CLANG_ARGS from the cc wrapper's libc-cflags (Linux only; macOS resolves headers via the SDK). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Same arm64 unnecessary_cast lint as the lib fix, in the test target: `<*const c_char> as *const u8` is a no-op on arm64 (c_char = u8). .cast() works on both platforms and isn't flagged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Replaces the manual LIBCLANG_PATH + BINDGEN_EXTRA_CLANG_ARGS exports with the maintained bindgenHook, which sets both correctly (libc cflags + clang resource dir) cross-platform. Fixes "'errno.h' file not found" when ffmpeg-sys-next's bindgen runs on a host without system headers in /usr/include, e.g. the self-hosted A1 runner. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Two independent failures break the
Checkjob on the self-hosted A1 (arm64) runner introduced in #1775. Both are masked on GitHub-hosted Ubuntu and block trusted PRs (e.g. #1781).1. libmoq clippy: platform-dependent cast
cstris*const c_char.c_charisu8on arm64 Linux (no-op cast →unnecessary_castunder-D warnings) buti8on x86/macOS (cast required, can't be removed). Fix:cstr.cast::<u8>()works on both and isn't flagged.2. ffmpeg-sys-next bindgen can't find
<errno.h>The devshell exports
LIBCLANG_PATHbut notBINDGEN_EXTRA_CLANG_ARGS, so bindgen's libclang has no path to libc headers. GitHub-hosted Ubuntu has system glibc headers in/usr/include, which hid this; the A1 runner is headerless, so any cold-cacheffmpeg-sys-nextbuild fails (a warm cache passes, which is why it looked intermittent). Fix: exportBINDGEN_EXTRA_CLANG_ARGSfrom the cc wrapper'slibc-cflags(Linux only; macOS uses the SDK).Test plan
cargo clippy -p libmoq --all-targetsclean on macOS (c_char = i8)nix evalof both devShellshellHooks succeeds; Linux branch emits theBINDGEN_EXTRA_CLANG_ARGSexport, Darwin branch unchangedCheckgreen on the A1 runner (the real verification — neither issue reproduces on macOS)(Written by Claude)