[PR #1939] fix(rust): Fix 32-bit build failures (i686, armv7l) #2742

Open
opened 2026-01-29 17:23:42 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/CCExtractor/ccextractor/pull/1939

State: closed
Merged: Yes


Summary

Fix two build failures on 32-bit architectures reported by Void Linux maintainer.

Fix 1: i686 build failure (#1937)

The code was importing std::arch::x86_64::* even when compiled for 32-bit x86:

#[cfg(any(target_arch = "x86", target_arch = "x86_64"))]
use std::arch::x86_64::*;  // ERROR: x86_64 module doesn't exist on i686

Fix: Use separate conditional imports for each architecture.

Fix 2: armv7l build failure (#1938)

The literal 0xcdcdcdcdcdcdcdcd is a 64-bit value that doesn't fit in 32-bit usize:

error: literal out of range for `usize`
   --> src/libccxr_exports/demuxer.rs:269:63
    |
269 |             if buffer_ptr.is_null() || buffer_ptr as usize == 0xcdcdcdcdcdcdcdcd {
    |                                                               ^^^^^^^^^^^^^^^^^^

Fix: Define a platform-appropriate constant (64-bit: 0xcdcdcdcdcdcdcdcd, 32-bit: 0xcdcdcdcd).

Test plan

  • Verified cargo check passes on x86_64
  • Void Linux maintainer to verify i686 build works
  • Void Linux maintainer to verify armv7l build works

Fixes #1937
Fixes #1938

🤖 Generated with Claude Code

**Original Pull Request:** https://github.com/CCExtractor/ccextractor/pull/1939 **State:** closed **Merged:** Yes --- ## Summary Fix two build failures on 32-bit architectures reported by Void Linux maintainer. ### Fix 1: i686 build failure (#1937) The code was importing `std::arch::x86_64::*` even when compiled for 32-bit x86: ```rust #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] use std::arch::x86_64::*; // ERROR: x86_64 module doesn't exist on i686 ``` **Fix:** Use separate conditional imports for each architecture. ### Fix 2: armv7l build failure (#1938) The literal `0xcdcdcdcdcdcdcdcd` is a 64-bit value that doesn't fit in 32-bit `usize`: ``` error: literal out of range for `usize` --> src/libccxr_exports/demuxer.rs:269:63 | 269 | if buffer_ptr.is_null() || buffer_ptr as usize == 0xcdcdcdcdcdcdcdcd { | ^^^^^^^^^^^^^^^^^^ ``` **Fix:** Define a platform-appropriate constant (64-bit: `0xcdcdcdcdcdcdcdcd`, 32-bit: `0xcdcdcdcd`). ## Test plan - [x] Verified `cargo check` passes on x86_64 - [ ] Void Linux maintainer to verify i686 build works - [ ] Void Linux maintainer to verify armv7l build works Fixes #1937 Fixes #1938 🤖 Generated with [Claude Code](https://claude.com/claude-code)
claunia added the pull-request label 2026-01-29 17:23:42 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/ccextractor#2742