Skip to content

fix(ci): unbreak the self-hosted A1 runner (libmoq clippy + ffmpeg bindgen headers)#1782

Merged
kixelated merged 4 commits into
mainfrom
fix/libmoq-cchar-cast
Jun 18, 2026
Merged

fix(ci): unbreak the self-hosted A1 runner (libmoq clippy + ffmpeg bindgen headers)#1782
kixelated merged 4 commits into
mainfrom
fix/libmoq-cchar-cast

Conversation

@kixelated

@kixelated kixelated commented Jun 18, 2026

Copy link
Copy Markdown
Collaborator

Two independent failures break the Check job 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

error: casting raw pointers to the same type and constness is unnecessary (`*const u8` -> `*const u8`)
   --> rs/libmoq/src/ffi.rs:231:35

cstr is *const c_char. c_char is u8 on arm64 Linux (no-op cast → unnecessary_cast under -D warnings) but i8 on 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>

.../ffmpeg-8.1-dev/include/libavutil/common.h:33:10: fatal error: 'errno.h' file not found
Unable to generate bindings: ClangDiagnostic(...)

The devshell exports LIBCLANG_PATH but not BINDGEN_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-cache ffmpeg-sys-next build fails (a warm cache passes, which is why it looked intermittent). Fix: export BINDGEN_EXTRA_CLANG_ARGS from the cc wrapper's libc-cflags (Linux only; macOS uses the SDK).

Test plan

  • cargo clippy -p libmoq --all-targets clean on macOS (c_char = i8)
  • nix eval of both devShell shellHooks succeeds; Linux branch emits the BINDGEN_EXTRA_CLANG_ARGS export, Darwin branch unchanged
  • Check green on the A1 runner (the real verification — neither issue reproduces on macOS)

(Written by Claude)

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>
@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 2c53df80-af12-4210-b1a8-449a7f818941

📥 Commits

Reviewing files that changed from the base of the PR and between e848e78 and deb0feb.

📒 Files selected for processing (2)
  • flake.nix
  • rs/libmoq/src/test.rs
✅ Files skipped from review due to trivial changes (1)
  • rs/libmoq/src/test.rs

Walkthrough

In rs/libmoq/src/ffi.rs, the parse_str function is updated to replace the pointer cast expression cstr as *const u8 with the equivalent method call cstr.cast::<u8>() when passing the input pointer to parse_slice. The same pointer cast idiom is updated across multiple test functions in rs/libmoq/src/test.rs for codec and path decoding.

In flake.nix, the devShells.default development shell configuration is updated to use Nix's built-in rustPlatform.bindgenHook instead of a manual shellHook. The bindgenHook automatically configures LIBCLANG_PATH and BINDGEN_EXTRA_CLANG_ARGS for bindgen header discovery, replacing the prior explicit shellHook definition.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main changes: fixing two CI failures on the self-hosted A1 runner related to libmoq clippy warnings and ffmpeg bindgen headers.
Description check ✅ Passed The description is well-related to the changeset, providing detailed context about both issues, platform-specific explanations, and test verification plans.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch fix/libmoq-cchar-cast

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@kixelated kixelated enabled auto-merge (squash) June 18, 2026 20:20
…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>
@kixelated kixelated changed the title fix(libmoq): use .cast() for c_char pointer to fix arm64 clippy fix(ci): unbreak the self-hosted A1 runner (libmoq clippy + ffmpeg bindgen headers) Jun 18, 2026
kixelated and others added 2 commits June 18, 2026 13:26
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>
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