Repository navigation
fix(unrar): use the stdcall ("system") ABI so 32-bit Windows links - #128
Open
bodencrouch wants to merge 1 commit into
Open
bodencrouch wants to merge 1 commit into
bodencrouch wants to merge 1 commit into
Conversation
UnRAR's dll.hpp declares the API PASCAL and callbacks CALLBACK, both __stdcall on Windows. unrar_sys declared them extern "C", so the i686-pc-windows-msvc link looked for undecorated _RAR* symbols and failed. - vendor/unrar_sys: FFI block and ChangeVolProc/ProcessDataProc/Callback types are now extern "system" (stdcall on 32-bit x86 Windows, identical to "C" everywhere else). - vendor/unrar: vendor unrar 0.5.8 (production sources only) with its RARSetCallback callback changed to extern "system" so it matches the corrected type; wired through [patch.crates-io]. Cargo.lock only drops the registry source/checksum for the patched unrar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq
Owner
Author
|
The install lanes failing here (k2, cli and gui, holo-patcher and mod-packaged) all stop at Recover and verify the lane-local game baseline. That's the cross-filesystem (EXDEV) baseline bug that #122 fixes. This branch doesn't contain that fix yet, and #125 and #126 fail at the same step. This PR's own change (the i686 unrar stdcall fix) isn't the cause: the 🤖 Generated with Claude Code https://claude.ai/code/session_01QDKiomK3BZE8fScCAGRfuq Generated by Claude Code |
This branch has not been deployed
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.
Why
package (windows-2025, i686-pc-windows-msvc, windows)fails at link with 7 unresolved externals (_RARCloseArchive,_RAROpenArchiveEx,_RARReadHeaderEx,_RARProcessFile,_RARProcessFileW,_RARSetCallback,_RARSetPassword). Analysis: #125 (comment)UnRAR's
dll.hppdeclares its APIPASCALand its callbacksCALLBACK. Both are__stdcallon Windows; they are defined empty only under_UNIX. The bindings declared themextern "C". That matches on x64 and Unix, but on 32-bit Windows stdcall decorates names (_RARCloseArchive@4), so nothing resolves. This target has never linked.What
vendor/unrar_sys/src/lib.rs: the FFI block and theChangeVolProc,ProcessDataProcandCallbacktypes are nowextern "system". That is stdcall on 32-bit Windows and C on every other target, so behavior elsewhere is unchanged.vendor/unrar/:unrar0.5.8 vendored likeunrar_sys, wired through[patch.crates-io]. The only code change isextern "system" fn callback(src/open_archive.rs:504), the one Rust function handed toRARSetCallback. Changing only the declarations would link but corrupt the stack on 32-bit Windows, because UnRAR calls the callback as stdcall. Upstream#[cfg(test)]modules, tests and examples are left out, as inunrar_sys. Provenance and the exact patch are invendor/unrar/README.md.Cargo.lock: onlyunrar's registrysource/checksumlines are removed, with no version changes.Verification
cargo buildandcargo build --no-default-features: Finished.cargo clippy --locked --lib --bin modsync -j2 -- -D warnings, with and without--no-default-features, on CI's pinned 1.95.0: clean.cargo fmt --all -- --check: exit 0.cargo tree -i unrarresolves tovendor/unrar.unrar/srcvs the registry crate: the only non-test difference is the callback ABI.package-manualdispatch on this branch is the proof.Generated by Claude Code