Build the portable loader library on non-Windows hosts #599

Open
shiaho777 wants to merge 2 commits from upstream-pr/599 into main
shiaho777 commented 2026-12-04 13:10:05 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by shiaho777 on 2026-12-04T13:10:05Z.


Building victory-loader on macOS fails in crash.rs because the module imports Windows-only dependencies. This prevents consumers from building the portable image-preparation and import-resolution APIs. Compile the crash handler under the same Windows condition as its exports. Compile the private image publisher for Windows and unit tests, where it has callers.

On Apple Silicon, the crate builds with all features, passes Clippy with warnings denied, and passes the six frame-rate and publication tests. Three preparation tests read the running executable as a PE image and therefore fail against the native Mach-O test binary. All three pass with a Windows test binary under Wine.

Also checked all features and tests for x86_64-pc-windows-msvc. The Windows GNU/LLVM library suite under Wine passed 60 of 61 tests. I reproduced the same failing write_sites::tests::changed_moves_and_vector_stores_do_what_they_did assertion on the unmodified base. cargo xtask policy passed.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:issue:5647083416 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/599). Originally posted by [shiaho777](https://github.com/shiaho777) on 2026-12-04T13:10:05Z. --- Building `victory-loader` on macOS fails in `crash.rs` because the module imports Windows-only dependencies. This prevents consumers from building the portable image-preparation and import-resolution APIs. Compile the crash handler under the same Windows condition as its exports. Compile the private image publisher for Windows and unit tests, where it has callers. On Apple Silicon, the crate builds with all features, passes Clippy with warnings denied, and passes the six frame-rate and publication tests. Three preparation tests read the running executable as a PE image and therefore fail against the native Mach-O test binary. All three pass with a Windows test binary under Wine. Also checked all features and tests for `x86_64-pc-windows-msvc`. The Windows GNU/LLVM library suite under Wine passed 60 of 61 tests. I reproduced the same failing `write_sites::tests::changed_moves_and_vector_stores_do_what_they_did` assertion on the unmodified base. `cargo xtask policy` passed.
fromthemoonx commented 2026-12-04 16:20:52 +00:00 (Migrated from github.com)

Imported from readmet3xt-lab/foxhound. Originally posted by fromthemoonx on 2026-12-04T16:20:52Z.


No change on native Windows, and the test that failed for you under Wine passes here.

Tested at 394ae3fa, directly on current main (5e44415b). Windows 11 Pro, Ryzen 7 5700X, x86_64-pc-windows-msvc, Rust 1.98.1.

  • cargo test --locked -p victory-loader --lib: 61 passed, 0 failed. With --all-features: 64 passed, 0 failed.
  • write_sites::tests::changed_moves_and_vector_stores_do_what_they_did: passed 40 of 40 runs alone, and in 40 of 40 runs of the whole library suite. So I could not reproduce that failure on native Windows with the MSVC build.
  • Both CI Clippy commands (default and --all-features) and cargo xtask policy: clean.
  • From reading: everything that uses crash (profile, stacks, the exports) is already Windows-only, and the only caller of publish outside its tests is windows.rs. Both modules are still compiled on Windows as before.

Not tested: the macOS or Linux build this PR is for (no such target here), the rest of the workspace's tests, starting a title.

AI use: Claude Code (Claude Opus 5.5) ran the tests, read the diff and wrote this report.

<!-- greyfinch-sync:readmet3xt-lab/foxhound:comment:7417270775 --> Imported from [readmet3xt-lab/foxhound](https://github.com/readmet3xt-lab/foxhound/pull/599#issuecomment-7417270775). Originally posted by [fromthemoonx](https://github.com/fromthemoonx) on 2026-12-04T16:20:52Z. --- No change on native Windows, and the test that failed for you under Wine passes here. **Tested** at `394ae3fa`, directly on current `main` (`5e44415b`). Windows 11 Pro, Ryzen 7 5700X, `x86_64-pc-windows-msvc`, Rust 1.98.1. - `cargo test --locked -p victory-loader --lib`: 61 passed, 0 failed. With `--all-features`: 64 passed, 0 failed. - `write_sites::tests::changed_moves_and_vector_stores_do_what_they_did`: passed 40 of 40 runs alone, and in 40 of 40 runs of the whole library suite. So I could not reproduce that failure on native Windows with the MSVC build. - Both CI Clippy commands (default and `--all-features`) and `cargo xtask policy`: clean. - From reading: everything that uses `crash` (`profile`, `stacks`, the exports) is already Windows-only, and the only caller of `publish` outside its tests is `windows.rs`. Both modules are still compiled on Windows as before. **Not tested:** the macOS or Linux build this PR is for (no such target here), the rest of the workspace's tests, starting a title. **AI use:** Claude Code (Claude Opus 5.5) ran the tests, read the diff and wrote this report.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/599:upstream-pr/599'
git switch 'upstream-pr/599'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/599'
git switch 'upstream-pr/599'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/599'
git switch 'upstream-pr/599'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/599'
git switch 'main'
git merge --squash 'upstream-pr/599'
git switch 'main'
git merge --ff-only 'upstream-pr/599'
git switch 'main'
git merge 'upstream-pr/599'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
readmet3xt-lab/foxhound!599
No description provided.