Docs: building with mingw-w64 on macOS and running under CrossOver #2432

Open
Ahmet-Dedeler wants to merge 2 commits from upstream-pr/2442 into main
Ahmet-Dedeler commented 2026-11-25 19:04:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Ahmet-Dedeler on 2026-11-25T19:04:21Z.


The first piece of the macOS work in #258, as asked there: the mingw cross-build. main builds for x86_64-pc-windows-gnu with no source change, so this is documentation only: a page on building xcl.exe with mingw-w64 on a Mac, running it under CrossOver with D3DMetal, running the tests and scripts/smoke.ps1 there, and what works on main today. Part of #258.

The CI side (a macOS runner that cross-builds) is #783; this page does not depend on it.

What is in it

  • docs/macos.md: state on main, what the host does differently (adapter name, no commit charge, no system XGameRuntime, Wine's debugger holding a crashed process), requirements, build, a bottle, running a title, running the tests under Wine through a cargo runner, scripts/smoke.ps1 through a small -Xcl wrapper, cleaning up a bottle.
  • README.md: one bullet under Building and usage pointing to the page, saying macOS is not a supported platform.

Tested

  • MacBook Pro, Apple M5 Max, 64 GB, macOS 27.3. CrossOver 26.3 (Wine) with D3DMetal as the D3D12, Rosetta 2. The adapter reports itself as AMD Compatibility Mode (32-lane waves). Rust 1.100.0, target x86_64-pc-windows-gnu (mingw-w64 14.0.0), DXC 1.9.2609.5. Debug build.
  • The repository's CI workflow (Windows runner, no GPU) on this head, run on my fork because it waits for approval here: Build and test passed on the second attempt. The first failed in sparse::tests::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight ("completed unmap batch should drain after fence completion"), a timing test; this PR changes no code.
  • cargo build --workspace --target x86_64-pc-windows-gnu on main 3ceb550: builds, no source change.
  • cargo test --workspace -- --test-threads=4 on main 3ceb550 under Wine (debug; a binary with no output for 240 s ended and its remaining tests run one process each, 120 s limit): 1280 passed, 59 failed, 46 ignored, 6 hung, 2 ended without a result. SKIPPED GPU tests: the wave64 ones (no wave64), no WARP, no GPU UMA, no heap windows, no D3D12 debug layer, and the driver-cache one (needs Windows Developer Mode). This PR changes no code, so these are main's counts on this host, which the page quotes.
  • xcl inspect on the workspace's test title, under Wine, on 3ceb550: reads it as on Windows.
  • The build, run, smoke-wrapper and cleanup commands on the page were the ones used for #666's runs (on 508a0c7).

Regression run

  • None: no runtime file changes.

Not tested

  • Windows: nothing here changes what Windows builds or runs.
  • Intel Macs, and CrossOver older than 26.3.
  • The retail title on 3ceb550: the page's Titles line is from 508a0c7 and says so.
  • The commands on the page were run on one Mac only.

AI use

  • Claude Code. Claude Mythos 5.2 wrote the page and ran its commands on 508a0c7; Claude Opus 5.5 brought it up to 3ceb550, ran the build, the suite and xcl inspect there, and wrote this description.
<!-- greyfinch-sync:ivall/xcl:issue:5497417903 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442). Originally posted by [Ahmet-Dedeler](https://github.com/Ahmet-Dedeler) on 2026-11-25T19:04:21Z. --- The first piece of the macOS work in #258, as asked there: the mingw cross-build. `main` builds for `x86_64-pc-windows-gnu` with no source change, so this is documentation only: a page on building `xcl.exe` with mingw-w64 on a Mac, running it under CrossOver with D3DMetal, running the tests and `scripts/smoke.ps1` there, and what works on `main` today. Part of #258. The CI side (a macOS runner that cross-builds) is #783; this page does not depend on it. **What is in it** - `docs/macos.md`: state on `main`, what the host does differently (adapter name, no commit charge, no system XGameRuntime, Wine's debugger holding a crashed process), requirements, build, a bottle, running a title, running the tests under Wine through a cargo runner, `scripts/smoke.ps1` through a small `-Xcl` wrapper, cleaning up a bottle. - `README.md`: one bullet under **Building and usage** pointing to the page, saying macOS is not a supported platform. **Tested** - MacBook Pro, Apple M5 Max, 64 GB, macOS 27.3. CrossOver 26.3 (Wine) with D3DMetal as the D3D12, Rosetta 2. The adapter reports itself as `AMD Compatibility Mode` (32-lane waves). Rust 1.100.0, target `x86_64-pc-windows-gnu` (mingw-w64 14.0.0), DXC 1.9.2609.5. Debug build. - The repository's `CI` workflow (Windows runner, no GPU) on this head, run on my fork because it waits for approval here: [Build and test passed](https://github.com/Ahmet-Dedeler/xcl/actions/runs/45683613791) on the second attempt. The first failed in `sparse::tests::flush_parked_does_not_free_or_reuse_tiles_while_unmap_is_in_flight` ("completed unmap batch should drain after fence completion"), a timing test; this PR changes no code. - `cargo build --workspace --target x86_64-pc-windows-gnu` on `main` `3ceb550`: builds, no source change. - `cargo test --workspace -- --test-threads=4` on `main` `3ceb550` under Wine (debug; a binary with no output for 240 s ended and its remaining tests run one process each, 120 s limit): 1280 passed, 59 failed, 46 ignored, 6 hung, 2 ended without a result. SKIPPED GPU tests: the wave64 ones (`no wave64`), `no WARP`, `no GPU UMA`, `no heap windows`, `no D3D12 debug layer`, and the driver-cache one (needs Windows Developer Mode). This PR changes no code, so these are `main`'s counts on this host, which the page quotes. - `xcl inspect` on the workspace's test title, under Wine, on `3ceb550`: reads it as on Windows. - The build, run, smoke-wrapper and cleanup commands on the page were the ones used for #666's runs (on `508a0c7`). **Regression run** - None: no runtime file changes. **Not tested** - Windows: nothing here changes what Windows builds or runs. - Intel Macs, and CrossOver older than 26.3. - The retail title on `3ceb550`: the page's **Titles** line is from `508a0c7` and says so. - The commands on the page were run on one Mac only. **AI use** - Claude Code. Claude Mythos 5.2 wrote the page and ran its commands on `508a0c7`; Claude Opus 5.5 brought it up to `3ceb550`, ran the build, the suite and `xcl inspect` there, and wrote this description.
DavidM1911 commented 2026-11-25 21:05:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T20:15:56Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 1 real failure, deterministic (also fails --test-threads=1, 1219/1):
gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier
  assertion failed: group barriers in the program (lower_dxil.rs:1155)

The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge.

— Devin

<!-- greyfinch-sync:ivall/xcl:comment:7173415543 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7173415543). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-25T20:15:56Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: **1 real failure**, deterministic (also fails `--test-threads=1`, 1219/1): ``` gpu::recomp::lower_dxil::tests::a_bridged_mask_write_where_one_half_is_elsewhere_meets_no_barrier assertion failed: group barriers in the program (lower_dxil.rs:1155) ``` The lowered program is missing an expected group barrier (or emits one where none is expected). Needs a fix before merge. — Devin
Lucasyudi commented 2026-11-25 23:09:19 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Lucasyudi on 2026-11-25T22:51:41Z.


Followed docs/macos.md at 754cc9e on a second Mac. Everything I ran worked as written; two notes for the page.

Tested

  • MacBook Pro, Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, Rosetta 2. Rust 1.100.0, x86_64-pc-windows-gnu with mingw-w64 (GCC 16.2.0, Homebrew), DXC 1.9.2609. An existing D3DMetal bottle.
  • Build: cargo build --release -p xcl --target x86_64-pc-windows-gnu as written, no change needed. cargo build --workspace too.
  • Tools: xcl inspect on the test title's exe through wine --bottle … "Z:…/xcl.exe" prints its header as on Windows.
  • Run: the Run command with XCL_DATA_ROOT as a Z:\ path and stdin at /dev/null: the log and report.json land in <data>/<title>/logs/, and XCL_RUN_SECONDS reaches XCL.
  • Tests: the runner script from Tests, saved as written (#!/bin/sh with "${@:2}" works, since /bin/sh is bash on macOS), with XCL_DATA_ROOT unset and XCL_DXC_DIR as a Z:\ path: cargo test -p xcl --lib -- util:: gpu_ldexp_f32 --test-threads=4 gives 7 passed, 0 failed, the GPU one included.

Notes

  1. ROSETTA_ADVERTISE_AVX: CrossOver 26.3's bin/wine sets it to 1 itself unless it is set to 0 or empty (it is a Perl script; the comment there reads "Advertise AVX under Rosetta, unless the user has explicitly disabled it"). My bottle has no such line, and a CPUID probe under wine --bottle sees AVX, AVX2, FMA and BMI2; with ROSETTA_ADVERTISE_AVX=0 in the shell it sees none of them. So the cxbottle.conf line is harmless but not needed with CrossOver's wine; something like "CrossOver's wine sets it to 1 unless you set it to 0" might save someone a search when XCL's CPU check fails.
  2. The test title on main: running the e2e test title (tests/data/testgame + xcl_testtitle.exe + testgame_mw.dll) with the Run command ends at 0.96 s with exit 5: unhandled exception 0xc0000005 in ntdll.dll+0x38d55 (write at address 0x0), under the title's first CreateGraphicsPipelineState. That is the D3DMetal crash on a pipeline with a console shader that #750 handles (@vakaobr checked it on a Mac above in that PR). Since State lists what works on main, one line saying the e2e test fails that way on main would match what a reader sees when they run Tests.

Not tested: the smoke.ps1 wrapper (no PowerShell here), the whole cargo test --workspace count, a retail title.

AI use: Claude Code with Claude Opus 5.5 (claude-opus-5-5) followed the page, ran the commands and drafted this report.

<!-- greyfinch-sync:ivall/xcl:comment:7176871626 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7176871626). Originally posted by [Lucasyudi](https://github.com/Lucasyudi) on 2026-11-25T22:51:41Z. --- Followed `docs/macos.md` at `754cc9e` on a second Mac. Everything I ran worked as written; two notes for the page. **Tested** - MacBook Pro, Apple M4 Pro, macOS 27.2.1, CrossOver 26.3, Rosetta 2. Rust 1.100.0, `x86_64-pc-windows-gnu` with mingw-w64 (GCC 16.2.0, Homebrew), DXC 1.9.2609. An existing D3DMetal bottle. - **Build:** `cargo build --release -p xcl --target x86_64-pc-windows-gnu` as written, no change needed. `cargo build --workspace` too. - **Tools:** `xcl inspect` on the test title's exe through `wine --bottle … "Z:…/xcl.exe"` prints its header as on Windows. - **Run:** the **Run** command with `XCL_DATA_ROOT` as a `Z:\` path and stdin at `/dev/null`: the log and `report.json` land in `<data>/<title>/logs/`, and `XCL_RUN_SECONDS` reaches XCL. - **Tests:** the runner script from **Tests**, saved as written (`#!/bin/sh` with `"${@:2}"` works, since `/bin/sh` is bash on macOS), with `XCL_DATA_ROOT` unset and `XCL_DXC_DIR` as a `Z:\` path: `cargo test -p xcl --lib -- util:: gpu_ldexp_f32 --test-threads=4` gives 7 passed, 0 failed, the GPU one included. **Notes** 1. **`ROSETTA_ADVERTISE_AVX`**: CrossOver 26.3's `bin/wine` sets it to `1` itself unless it is set to `0` or empty (it is a Perl script; the comment there reads "Advertise AVX under Rosetta, unless the user has explicitly disabled it"). My bottle has no such line, and a CPUID probe under `wine --bottle` sees AVX, AVX2, FMA and BMI2; with `ROSETTA_ADVERTISE_AVX=0` in the shell it sees none of them. So the `cxbottle.conf` line is harmless but not needed with CrossOver's `wine`; something like "CrossOver's `wine` sets it to 1 unless you set it to 0" might save someone a search when XCL's CPU check fails. 2. **The test title on `main`**: running the e2e test title (`tests/data/testgame` + `xcl_testtitle.exe` + `testgame_mw.dll`) with the **Run** command ends at 0.96 s with exit 5: `unhandled exception 0xc0000005 in ntdll.dll+0x38d55 (write at address 0x0)`, under the title's first `CreateGraphicsPipelineState`. That is the D3DMetal crash on a pipeline with a console shader that #750 handles (@vakaobr checked it on a Mac above in that PR). Since **State** lists what works on `main`, one line saying the e2e test fails that way on `main` would match what a reader sees when they run **Tests**. **Not tested:** the `smoke.ps1` wrapper (no PowerShell here), the whole `cargo test --workspace` count, a retail title. AI use: Claude Code with Claude Opus 5.5 (`claude-opus-5-5`) followed the page, ran the commands and drafted this report.
RavenCurseBurg commented 2026-11-26 05:05:35 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by RavenCurseBurg on 2026-11-26T04:31:31Z.


Tested the Cargo runner in docs/macos.md at 754cc9ee8f760d0fdb3c12a040ee728f0dc0a14c. I extracted the shell snippet, supplied a quoted bottle name and installation path, and invoked it with Git for Windows sh and a local argv recorder in place of Wine. Absolute executable paths forwarded correctly. For relative inputs, the original produced Z:target/…, a drive-relative Windows path.

Documentation candidate uses the working directory for relative inputs, quotes the shared bottle setting, and forwards trailing arguments with POSIX shift and "$@". Four runner cases preserved a spaced bottle name and executable path, a Unicode path, empty and literal wildcard arguments, closed stdin and exit codes 0, 7 and 23. Both relative inputs reached the recorder as absolute Z:/… paths.

I also replayed the Run command with the recorder. For the cleanup example, a separate stand-in received the selected bottle prefix and -k. With an empty bottle name it was never called. Windows build 26100, i7-13700. OpenAI Codex (GPT-6) edited the examples and ran the shell checks. macOS, Cargo, CrossOver/Wine, D3DMetal and the smoke wrapper were not executed in this test.

<!-- greyfinch-sync:ivall/xcl:comment:7182670133 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7182670133). Originally posted by [RavenCurseBurg](https://github.com/RavenCurseBurg) on 2026-11-26T04:31:31Z. --- Tested the Cargo runner in `docs/macos.md` at `754cc9ee8f760d0fdb3c12a040ee728f0dc0a14c`. I extracted the shell snippet, supplied a quoted bottle name and installation path, and invoked it with Git for Windows `sh` and a local argv recorder in place of Wine. Absolute executable paths forwarded correctly. For relative inputs, the original produced `Z:target/…`, a drive-relative Windows path. [Documentation candidate](https://github.com/RavenCurseBurg/xcl/commit/a2035e2256b1dd705e8770d59a5a07897bcc2956) uses the working directory for relative inputs, quotes the shared bottle setting, and forwards trailing arguments with POSIX `shift` and `"$@"`. Four runner cases preserved a spaced bottle name and executable path, a Unicode path, empty and literal wildcard arguments, closed stdin and exit codes 0, 7 and 23. Both relative inputs reached the recorder as absolute `Z:/…` paths. I also replayed the **Run** command with the recorder. For the cleanup example, a separate stand-in received the selected bottle prefix and `-k`. With an empty bottle name it was never called. Windows build 26100, i7-13700. OpenAI Codex (GPT-6) edited the examples and ran the shell checks. macOS, Cargo, CrossOver/Wine, D3DMetal and the smoke wrapper were not executed in this test.
Ahmet-Dedeler commented 2026-11-26 05:05:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Ahmet-Dedeler on 2026-11-26T05:00:06Z.


@RavenCurseBurg good catch, thanks. Anyone who runs the runner by hand with a relative path, or gets one from Cargo, would have hit that Z:target/…. Pulled your commit in as is (a2035e2).

Ran your runner on the Mac side too, macOS 27.3, with a stand-in wine that prints its argv: /bin/sh and zsh both give Z:/<cwd>/… for relative paths and Z:/… for absolute ones, keep a spaced bottle name, empty, * and Unicode arguments, close stdin and pass exit code 7 through. Real Wine and Cargo weren't part of that check.

<!-- greyfinch-sync:ivall/xcl:comment:7183089576 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7183089576). Originally posted by [Ahmet-Dedeler](https://github.com/Ahmet-Dedeler) on 2026-11-26T05:00:06Z. --- @RavenCurseBurg good catch, thanks. Anyone who runs the runner by hand with a relative path, or gets one from Cargo, would have hit that `Z:target/…`. Pulled your commit in as is (`a2035e2`). Ran your runner on the Mac side too, macOS 27.3, with a stand-in `wine` that prints its argv: `/bin/sh` and zsh both give `Z:/<cwd>/…` for relative paths and `Z:/…` for absolute ones, keep a spaced bottle name, empty, `*` and Unicode arguments, close stdin and pass exit code 7 through. Real Wine and Cargo weren't part of that check.
github-actions[bot] commented 2026-12-01 02:31:52 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:31:52Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7298715800 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7298715800). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-12-01T02:31:52Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 08:05:59 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T08:05:59Z.


Triage (#1607) – head a2035e2

No open or merged PR adds macOS / CrossOver build docs. Main has nothing on it outside the design spec's non-goals. The other macOS PRs in #258 (#2361, #2363, #2402, #2492, #783) change code or CI, not docs.
The page says plainly that macOS is unsupported and lists what fails (59 test failures, no OpenExistingHeapFromAddress, no frames in the retail title), measured at a named commit. No problems found in the diff.
Recommendation: keep open.

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7304872375 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7304872375). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T08:05:59Z. --- **Triage (#1607)** – head a2035e2 No open or merged PR adds macOS / CrossOver build docs. Main has nothing on it outside the design spec's non-goals. The other macOS PRs in #258 (#2361, #2363, #2402, #2492, #783) change code or CI, not docs. The page says plainly that macOS is unsupported and lists what fails (59 test failures, no `OpenExistingHeapFromAddress`, no frames in the retail title), measured at a named commit. No problems found in the diff. Recommendation: keep open. AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/2442:upstream-pr/2442'
git switch 'upstream-pr/2442'

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/2442'
git switch 'upstream-pr/2442'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2442'
git switch 'upstream-pr/2442'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2442'
git switch 'main'
git merge --squash 'upstream-pr/2442'
git switch 'main'
git merge --ff-only 'upstream-pr/2442'
git switch 'main'
git merge 'upstream-pr/2442'
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
xcl-dev/xcl!2432
No description provided.