fix(linux): make the Linux build work on arm64 - #293
Open
zebster-cmd wants to merge 1 commit into
Open
Conversation
`npm run build:linux` could not complete on an aarch64 host. Four independent x86-only assumptions, each fixed here: - fetch-ffmpeg: SHARED_PINNED had no `linux-arm64` entry, so the SDK fetch bailed out. BtbN publishes the asset in the pinned release; only the pin was missing. Digest taken from its checksums.sha256. - build-linux-compositor-addon: `/usr/lib/x86_64-linux-gnu` and `/usr/lib/gcc/x86_64-linux-gnu` were hardcoded, hiding both libclang and gcc's stddef.h on arm64. Derived from `process.arch` instead. - build-linux-pipewire-helper: bindgen failed with "'limits.h' file not found" because Ubuntu ships libclang.so.1 without a resource dir. Now passes BINDGEN_EXTRA_CLANG_ARGS at gcc's includes, the same fallback build-linux-compositor-addon already applied. - audio.rs / ffmpeg.rs: `[0i8; 256]` passed to av_strerror's `*mut c_char`. `c_char` is signed on x86_64 but unsigned on aarch64, so this is a hard type error there. Use `c_char`. No behaviour change on x86_64: the ffmpeg pin is additive, the two path constants resolve to their previous values, and `c_char` *is* `i8` there. Verified by building and packaging on aarch64 (Ubuntu 24.04): the deb reports `Architecture: arm64`, and the app boots and renders under Xvfb. One caveat worth flagging separately: BtbN's linuxarm64 ffmpeg ships no h264_vaapi, so `every_ladder_entry_names_a_codec_this_build_has` fails on arm64. The encoder ladder probes and falls through at runtime, and h264_nvenc / h264_v4l2m2m / libopenh264 are all present, so this is a gap in the test's assumption rather than a broken export path. Left alone here to keep this PR to the build fix.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (5)
📝 WalkthroughWalkthroughThe PR adds Linux ARM64 support for FFmpeg provisioning and bindgen paths. It also replaces hardcoded ChangesLinux ARM64 support
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
zebster-cmd
marked this pull request as ready for review
August 6, 2026 14:25
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.
Summary
npm run build:linuxcannot complete on an aarch64 host. This fixes four independent x86-only assumptions in the Linux build path, so the same command produces a workingarm64deb/AppImage.scripts/fetch-ffmpeg.mjsSHARED_PINNEDhas nolinux-arm64entry, so the SDK fetch bails. BtbN publishes the asset in the already-pinned release — only the pin was missing. Digest taken from that release'schecksums.sha256.scripts/build-linux-compositor-addon.mjs/usr/lib/x86_64-linux-gnuand/usr/lib/gcc/x86_64-linux-gnuare hardcoded, hiding both libclang and gcc'sstddef.hon arm64. Now derived fromprocess.arch.scripts/build-linux-pipewire-helper.mjs'limits.h' file not found— Ubuntu shipslibclang.so.1with no resource dir. Now passesBINDGEN_EXTRA_CLANG_ARGSat gcc's includes, the same fallbackbuild-linux-compositor-addon.mjsalready applies.crates/compositor/src/audio.rs,electron/native/pipewire-capture/src/ffmpeg.rs[0i8; 256]passed toav_strerror's*mut c_char.c_charis signed on x86_64 but unsigned on aarch64, so this is a hard type error there. Usesc_char.No behaviour change on x86_64: the ffmpeg pin is additive, both path constants resolve to their previous values, and
c_charisi8there.Related issue
No existing issue — found while building for an aarch64 machine.
Type of change
Release impact
Desktop impact
Screenshots / video
No visual change. The packaged arm64 build boots and renders its recorder toolbar correctly under Xvfb.
Testing
Ubuntu 24.04, aarch64 (NVIDIA GB10), Rust 1.95, Node 22.22.
Build & package —
npm run build:linuxOpenscreen-Linux-1.9.0.deb→Architecture: arm64;apt-get -s installresolves every dependency with no extras.--no-sandbox), and renders underxvfb-run.Unit —
npm test→ 1677 passed, 1 skipped, 0 failed (140 files).E2E —
npm run test:e2eunderxvfb-run→ 7 passed, 4 skipped, 0 failed. The 4 skips arewindows-native-checklist.spec.ts(test.skip(process.platform !== "win32")).Both export paths pass end-to-end on arm64:
exports an MP4 from a loaded video— softwarelibopenh264exports a GIF from a loaded video— compositor selected the hardware backend:[d3d] adaptateur Vulkan : NVIDIA GB10 (IntegratedGpu, Vulkan) -> backend HardwareThat last line is the useful one: the natively-built compositor addon negotiates a hardware Vulkan backend on arm64, not just a CPU fallback.
Static —
npx tscclean;biome checkclean on the three changed scripts.cargo testinpipewire-capture: 54 passed, 1 failed — see below.Not verified on x86_64 (no host available), though the reasoning for why each change is a no-op there is above.
Note for anyone reproducing the e2e run on Linux
npm run devaborts before serving becausenode_modules/electron/dist/chrome-sandboxisn'troot:root 4755, which takes the Vite server down with it and fails every spec onERR_CONNECTION_REFUSED.NO_ELECTRON=1 npm run devavoids it. Pre-existing and unrelated to arm64 — mentioning it only so the run is reproducible.One caveat, not fixed here
BtbN's
linuxarm64ffmpeg ships noh264_vaapi, soevery_ladder_entry_names_a_codec_this_build_hasfails on arm64. The encoder ladder probes and falls through at runtime, andh264_nvenc,h264_v4l2m2mandlibopenh264are all present — so this looks like a gap in the test's assumption rather than a broken export path. Left alone to keep this PR to the build fix; happy to follow up if you'd like the assertion made arch-aware.🤖 Generated with Claude Code
https://claude.ai/code/session_014iYUHw6DyT4CSBNyvr4zsY
Summary by CodeRabbit
Bug Fixes
New Features