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

Open
github-bot wants to merge 2 commits from github-bot/gh-2442 into main AGit
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-25 19:04 UTC · original
Ahmet-Dedeler:docs/macos-build → main · +173 −0 · 2 files · 2 commits · open

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.
**@⁠Ahmet-Dedeler** on GitHub · 2026-11-25 19:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/2442) `Ahmet-Dedeler:docs/macos-build` → `main` · +173 −0 · 2 files · 2 commits · open 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.
main builds for x86_64-pc-windows-gnu without a change. docs/macos.md says how to build xcl.exe
on an Apple Silicon Mac, run it under CrossOver with D3DMetal, run the tests and
scripts/smoke.ps1 there, and what works on main today; README points to it under Building and
usage. Part of #258.

Co-Authored-By: Claude Mythos 5.2 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:31:01 +00:00
Author
Owner

@⁠DavidM1911 on GitHub · 2026-11-25 20:15 UTC · original

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

**@⁠DavidM1911** on GitHub · 2026-11-25 20:15 UTC · [original](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7173415543) 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
Author
Owner

@⁠Lucasyudi on GitHub · 2026-11-25 22:51 UTC · original

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.

**@⁠Lucasyudi** on GitHub · 2026-11-25 22:51 UTC · [original](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7176871626) 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.
Set the CrossOver bin directory and bottle name once for the shell examples. Build an absolute Wine path for the test executable and forward remaining Cargo arguments with POSIX shell syntax.

Assisted-by: OpenAI Codex (GPT-6)
Author
Owner

@⁠RavenCurseBurg on GitHub · 2026-11-26 04:31 UTC · original · edited 2026-11-26 04:38 UTC

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.

**@⁠RavenCurseBurg** on GitHub · 2026-11-26 04:31 UTC · [original](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7182670133) · edited 2026-11-26 04:38 UTC 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.
Author
Owner

@⁠Ahmet-Dedeler on GitHub · 2026-11-26 05:00 UTC · original

@⁠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.

**@⁠Ahmet-Dedeler** on GitHub · 2026-11-26 05:00 UTC · [original](https://github.com/xcl-dev/xcl/pull/2442#issuecomment-7183089576) @⁠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.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2442/head:github-bot/gh-2442'
git switch 'github-bot/gh-2442'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2442'
git switch 'github-bot/gh-2442'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2442'
git switch 'github-bot/gh-2442'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2442'
git switch 'main'
git merge --squash 'github-bot/gh-2442'
git switch 'main'
git merge --ff-only 'github-bot/gh-2442'
git switch 'main'
git merge 'github-bot/gh-2442'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.