[FIX] docker build on ARM/Apple Silicon#2267
Merged
cfsmp3 merged 1 commit intoCCExtractor:masterfrom Apr 18, 2026
Merged
Conversation
When building with Docker on an Apple Silicon Mac (M4), the Rust build fails with type mismatch errors in common.rs and ctorust.rs. The lang field in CapInfo is hardcoded as [i8; 4], which only matches the bindgen-generated c_char on x86 (where c_char = i8). On ARM platforms like Apple Silicon, c_char = u8, so the types don't match and compilation fails with: error[E0308]: mismatched types - expected `[u8; 4]`, found `[i8; 4]`... Change to [c_char; 4] which resolves to the correct type on both architectures.
5aa617a to
85fe183
Compare
Collaborator
CCExtractor CI platform finished running the test files on linux. Below is a summary of the test results, when compared to test for commit ad4886e...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
Collaborator
CCExtractor CI platform finished running the test files on windows. Below is a summary of the test results, when compared to test for commit ad4886e...:
Your PR breaks these cases:
NOTE: The following tests have been failing on the master branch as well as the PR:
Congratulations: Merging this PR would fix the following tests:
It seems that not all tests were passed completely. This is an indication that the output of some files is not as expected (but might be according to you). Check the result page for more info. |
10 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In raising this pull request, I confirm the following (please check boxes):
Reason for this PR:
Sanity check:
Repro instructions:
try to build CCExtractor using Docker on any ARM/AArch64 machine (e.g., a Mac with Apple Silicon):
docker build --build-arg USE_LOCAL_SOURCE=1 -f docker/Dockerfile -t ccextractor .and the Rust compilation step fails with the following error:
error[E0308]: mismatched types --> src/common.rs:1040:19 | 1040 | lang: self.lang, | ^^^^^^^^^ expected `[u8; 4]`, found `[i8; 4]` error[E0308]: mismatched types --> src/ctorust.rs:571:19 | 571 | lang: info.lang, | ^^^^^^^^^ expected `[i8; 4]`, found `[u8; 4]`You can also reproduce on an x86 machine by targeting the ARM64 platform in Docker:
docker build --platform linux/arm64 --build-arg USE_LOCAL_SOURCE=1 -f docker/Dockerfile -t ccextractor .I ran into this while building locally with Docker on my M4 Mac. The Rust build was failing because the
langfield inCapInfo(src/rust/src/demuxer/common_types.rs) was hardcoded as[i8; 4].on ARM,
c_charisu8instead ofi8, so it didn’t match the bindgen-generated C bindings and caused the build to fail.so, I changed it to
[c_char; 4], which works on both x86 and ARM.How can we test this
try to build on ARM (or simulate it from x86) and confirm it compiles: