mirror of
https://github.com/CCExtractor/ccextractor.git
synced 2026-02-03 21:23:48 +00:00
Build fails on ARM64/aarch64: u8: From<i8> not satisfied in nal.rs
#846
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @x15sr71 on GitHub (Oct 21, 2025).
Compilation error on aarch64 Linux:
u8: From<i8>not satisfied in ccx_rustEnvironment
Description
I'm hitting a compilation failure when trying to build CCExtractor on my ARM64 Ubuntu machine:
Root Cause
After some digging, I found that
c_charbehaves differently depending on your CPU architecture:c_chartypei8(signed)u8(unsigned)The Rust docs mention this -
c_charmatches whatever C'schartype is on that platform, and the C standard leaves it up to each implementation to decide ifcharis signed or unsigned.So on x86_64,
c_char::from(0i8)works fine becausec_charisi8. But on ARM64,c_charisu8, and Rust doesn't let you converti8tou8automatically (makes sense - negative numbers would be a problem).Steps to Reproduce
src/rust/src/avc/nal.rs:599Build Logs
Full error output (click to expand)
Expected Behavior
Should build cleanly on both x86_64 and ARM64.
Actual Behavior
Builds fine on x86_64, crashes on ARM64 with the trait bound error above.
Comparison Testing
Proposed Solution
The fix is pretty straightforward. In
src/rust/src/avc/nal.rsat line 599, change:to:
I tested this on both my ARM64 VM and x86_64 laptop - builds successfully on both now.
Why this works:
ascast handles bothi8andu8without issuesRelated Issues & References
c_char: https://doc.rust-lang.org/stable/std/os/raw/type.c_char.htmlcharsignedness is implementation-definedAdditional Context
This isn't unique to CCExtractor - it's a common gotcha when writing Rust FFI code. Different architectures treat
chardifferently:This will affect anyone trying to build on ARM64 Linux, not just Ubuntu 25.04.
Impact
Will be submitting a PR shortly with the above fix!