Linux: build the runtime in a container and run it under Wine (tools/linux) #52
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!52
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/52/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@realkodr on GitHub · 2026-11-21 21:34 UTC · original
realkodr:linux/wine→main· +36 −1 · 2 files · 92 commits · closed without mergingLibrary / area: build tooling (new
tools/linux/), xmem / xbthunk / compat-common (three imports looked up at run time), tombox-xshader (four Windows-only programs gated), xreplay test harnessExports changed (exports.txt rows): none
Source of the behaviour: no console behaviour is added or changed. Which imports Wine lacks comes from Wine's own export lists (
dlls/*/*.specat tagwine-11.21).What this is
A way to build the runtime and run its tests on Linux, without a Windows machine. A container cross-compiles for
x86_64-pc-windows-msvcwith LLVM's MSVC-compatible tools and runs the results under Wine, with vkd3d-proton translating Direct3D 12 to Vulkan.tools/linux/README.txthas the details. Four commits, each usable on its own:tools/linux/: the container, the SDK set-up script, the runner, andmsvc-lib.py. The image holds no Microsoft files: the Windows SDK and CRT libraries are fetched bysetup-sdk.shwith xwin, into a cache outside the repository, and only after--accept-license. The test harness (xreplay/src/d3d.rs) falls back from feature level 12_1 to lower levels, because vkd3d-proton reports less than 12_0 for Mesa's llvmpipe.xprecompileand thefma_bench/fma_gpu_diff/compile_benchexamples import Windows-only modules (dxc,shader_cache,fma_probe) unconditionally, socargo test -p tombox-xshaderdoes not compile on a Linux or macOS host. They now followxpso: cfg(windows) for the real program, a stubmainelsewhere.ntdll!NtOpenPartition,ntdll!NtManagePartitionandiphlpapi!GetNetworkConnectivityHint. Wine loads a missing import as a stub that aborts the process when called, so xhost died in xmem right after loading the DLLs. They are now resolved withGetProcAddresson first use, and when absent the caller takes the failure path it already had (partition "not openable", no connectivity hint). On Windows the functions are found and called as before.run.shpasses an NVIDIA GPU into the container through the NVIDIA Container Toolkit (--gpus all, all driver capabilities) when the host has one. I have no NVIDIA machine, so this is written from the toolkit's documentation and has not been run.TOMBOX_LINUX_GPU=dri|nvidia|noneoverrides the detection. Hosts withoutnvidia-smibehave as before.The lib.exe stand-in
Fourteen build scripts run
lib.exe /DEF:x.def /OUT:x.liband link thex.expit leaves behind.llvm-libwrites no.exp.msvc-lib.pyturns each row of the.definto an/EXPORT:directive and compiles them into an object file of that name, whichlld-linkreads like directives on the command line. No build script changes. The container puts it on PATH aslib.exe.Results
Measured at
1159c96; rebased since onto838f43f, where the build, the xhost run and the tombox-xshader unit tests were repeated with the same results (lib is now 25 under Wine and 15 natively) on an Intel i7-1165G7 (Iris Xe), Mesa 26.2.7, Wine 11.21, vkd3d-proton 3.1.xhost.exefrom a clean checkoutxhost --no-epicunder Wine, before commit 3NtOpenPartitionxhost --no-epicunder Wine, with commit 3cargo test -p tombox-xshader --lib --test opcodes --test syntheticunder Winecargo test -p xbthunkunder Winecargo test -p xmem -- --test-threads=1under Winetombox-xshader --test execon the Iris XeThe two xhost failures are the built-in online backend, which needs the private
backend_dataat build time. The skips need Gaming Services.What does not work
shaderFloat64) and on llvmpipe. The translator's exactv_fma_f32path and the f64 instructions use them. That is 13 of the 19execfailures. Of the rest, 2 need a wider wave than the device has and 4 are wrong results (vop2_basic,vopc_f16,scalar_smem_loads,ds_gds_append_consume). I have no Windows baseline at this commit to say which of those four are Wine-specific.stats::tests::working_set_versions_fill_their_sizes,transfer_memory_follows_console_flow) read working set figures that Wine reports as zero. Run in parallel, the xmem tests hang under Wine; one at a time they finish.Overlap
Draft #12 mentions checking DLL loads under Wine but adds no Linux tooling. Its cfg gates for
xscanandopcodesare already onmain; commit 2 covers the four programs added since (compile_bencharrived withe843998and broke the native build again).cargo test -p <crate>results are in the table above, including the failuresmissingwith a note🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-22 13:12 UTC · original
Main's history was rewritten, which auto-closed this PR (sorry for the noise). Please split this: the Rust part (runtime lookup of GetNetworkConnectivityHint/NtOpenPartition/NtManagePartition, non-Windows example stubs) as its own PR. The container tooling that downloads SDKs needs a separate licence/policy decision. Remove the absolute /home paths and comment lines. To resubmit:
git fetchthis repo, branch from the currentmain, cherry-pick only your own commits (the old branch is based on the previous history and cannot be merged), and open a new PR.Pull request closed