Repository navigation
fix(unrar_sys): add iOS/tvOS/watchOS cross-compilation support - #74
Open
darktasevski wants to merge 9 commits into
Open
darktasevski wants to merge 9 commits into
darktasevski wants to merge 9 commits into
Conversation
darktasevski
force-pushed
the
fork-extensions
branch
3 times, most recently
from
April 6, 2026 06:26
1910b1b to
31732f2
Compare
Add StreamingEntry type implementing std::io::Read that bridges the C library's push-based UCM_PROCESSDATA callbacks with pull-based Rust Read via a bounded sync_channel(4) and per-entry producer thread. This closes the transient OOM window where crafted RAR archives with spoofed unpacked_size headers could cause unbounded memory allocation. All four archive formats (CBZ, CB7, CBT, CBR) now use the same .take(limit) pattern for bounded reads. Key changes in unrar crate: - StreamingEntry with impl Read, finish(), set_discard() - Streaming callback with p2 bounds validation and discard mode - unsafe impl Send for Handle (TLS audit passed for unrar v7.1) - Drop with mandatory 5s timeout and mem::forget fallback - Shared volume-change handler extracted from existing callback - Backported p2 bounds validation to existing callback - 9 unit tests covering streaming, solid archives, abort, discard Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
darktasevski
force-pushed
the
fork-extensions
branch
from
April 6, 2026 06:55
31732f2 to
04e4a2d
Compare
Formatting only — no semantic change in any hunk. HEAD did not satisfy cargo fmt --check; this is exactly the diff it produces.
…gerprint-cancellation Join streaming producers on drop and format the streaming tests
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.
Cross-compiling for Apple mobile targets fails with linker errors:
Phase 1 - Missing C++ symbols:
Phase 2 - After adding
-lc++workaround:Two issues in
unrar_sys/build.rs:Line 65:
.cpp_link_stdlib(None)disables C++ stdlib linking globally, but iOS requireslibc++No iOS SDK configuration: The
cccrate compiles with default macOS SDK settings, producing object files with mismatched iOS version metadataSolution
CARGO_CFG_TARGET_OSenvironment variablelibc++explicitly for iOS/tvOS/watchOS-mios-version-min=12.0, etc.) to match Rust's expectationscpp_link_stdlibon Windows GNU where it was originally neededAll iOS/tvOS/watchOS targets:
aarch64-apple-iosaarch64-apple-ios-simx86_64-apple-iosaarch64-apple-ios-macabi(Mac Catalyst)x86_64-apple-ios-macabiaarch64-apple-tvos/aarch64-apple-tvos-simaarch64-apple-watchos/aarch64-apple-watchos-simI verified successful compilation for:
aarch64-apple-ios(device)aarch64-apple-ios-sim(simulator)Closes #73 - Unable to cross-compile for iOS (aarch64-apple-ios)