feat(devcontainer): the whole toolchain in a container, nothing on the host #407
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/lobomfz--VIctory-xmem!407
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-407"
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?
@Luxuride on GitHub · 2026-12-04 00:53 UTC · original
Luxuride:pr/devcontainer→main· +1007 −0 · 10 files · 7 commits · openWhy
docs/BUILD.mdasks for clang-cl, lld-link, llvm-lib, mingw-w64 (withwidl), ninja, glslang, flex, bison,unshare, libdrm ≥ 2.4.133 and wayland-protocols ≥ 1.49. On a distribution that ships older ones, every step ofsetup.shis a package manager away, and most of those want root.What it changes
No
sudo. Just podman or docker, as your own user.setup.shandbuild.share unchanged and run asdocs/BUILD.mddescribes.deps/msvc,deps/mesa-inst,deps/vkd3d/build,target/x86_64-pc-windows-msvc/release/victory.exe../run.sh playstill runs on the host unchanged;.devcontainer/play.shis what runs it in a container over Wayland, and what it can and cannot do is spelled out below.What it is not
title pipelines knownand then blocks with no CPU and no error of its own; on the host the same binary reaches its device and presents frames, so the difference is inside the container and is still being chased.setup.sh wine|prefix|fsr4are not supported inside it.systemd-run --user(the scope only caps memory) andwinedo not exist in a container..devcontainer/standinscarries a marked stand-in for each: the first runs the command it was given, the second answerscommand -vand explains if a step that needs Wine is asked for. Neither touches the checkout.The one line outside
.devcontainerxtask/src/policy.rsallows a file by name or extension andDockerfileis neither, so it is added toALLOWED_NAMES, with an assertion in the same file's tests. The stand-ins are.shand the image copies them into place under their real names, so nothing else needs an entry.Since the first version
Three things were added to this branch after using it to carry real work:
.devcontainer/env.sh— the Windows target's sysroot in one place. It wasfour exports per command (
CARGO_TARGET_…_LINKER,CC_…,AR_…, and the/winsysroot:flag), and the one that gets forgotten is the one that fails tenminutes later, in a crate's build script, with
failed to find tool "ml64.exe":The caches — the target,
lld-link,clang-cl,llvm-liband/targetare in
containerEnv, and four named volumes keep the cargo registry, cargo'sgit checkouts,
/targetandsccachebetween containers.sccacheis in theimage, pinned and checksummed.
hostRequirementsmakes a small machine fail atuprather than at Mesa.post-create.shtakes the volumes as its user, runscargo fetch --locked, and says so whendevcontainer.json's Rust pin andrust-toolchain.tomldisagree — the feature'sversionis the same numbersaid twice.
.devcontainer/play.sh— a Wayland play run, which is the one thing thefirst version said it could not do. The host's compositor socket,
/dev/dri,/dev/input(pads), PipeWire's pulse socket and a read-only Proton go in;--memorytakes over the caprun.shgets fromsystemd-run. The image gainsthe client libraries playing needs — xkbcommon, PulseAudio, ALSA, freetype,
fontconfig, gnutls — and no build touches them.
The README gained the parts that only show up in use: podman and
userns=keep-id, the render node's permissions,:zversus--security-opt=label=disable, the caches, and what the Wayland path leaves towatch.
Verified
Inside the container, from an image built after
podman rmi:./setup.sh sdk dlls mesa vkd3d victory— all pass; Mesa 26.3.1 builds in 1 m 03 s,victoryin 1 m 07 s, the whole sequence in 14 s once the trees are present.deps/mesa-inst/lib/x86_64-linux-gnu/libvulkan_radeon.so21,630,216 B;deps/vkd3d/build/libs/d3d12core/d3d12core.dll8,878,384 B;target/x86_64-pc-windows-msvc/release/victory.exe13,596,160 B.cargo xtask policy— 0 violations under.devcontainer;cargo test -p xtask accepts_sourcepasses../.devcontainer/env.sh cargo check -p victory-pe --tests— Finished in 8 s,against
deps/msvcfromsetup.sh sdk.A play image built from this Dockerfile:
vulkaninfo --summaryenumerates thecards through
deps/mesa-inst'sradeon_icd.x86_64.json(RX 7900 XTX,RX 6700 XT, the 9950X3D's iGPU), and
VK_KHR_wayland_surfacesurfaces arecreated on the host's compositor.
Proton 11.0/files/bin/wine --version→wine-11.0inside the container,against this image's glibc, with no Steam Linux Runtime around it.
bash .devcontainer/post-create.sh→ exit 0: toolchain, tools, Mesa'spkg-config dependencies, the stand-in notices, and the crates fetched.
A real
./.devcontainer/play.shrun against the title:victory.exestartsunder the host's Proton Experimental, the loader finds the dump through
winepath'sZ:\mapping, and the pipeline cache is read(
title pipelines known from earlier runs pipelines=94203 shaders=25761).It stops there: no device is created and no frame is presented, so nothing
here claims playback.
Two defects that run found and this PR fixes: the image shipped no Vulkan
ICD at all (
/usr/share/vulkan/icd.ddid not exist,vkCreateInstance: Found no drivers!), which is why the title sat at that line silently; it nowinstalls Mesa's RADV for both architectures, and
vulkaninfo --summaryinsidethe image enumerates the host's card. And the 32-bit loader, the missing
Proton path and the unmounted dump described below.
Two defects that only a real run finds, both fixed here:
run.shsourcesrun.conf, so aPROTON=there cannot be overridden by the environment andProton has to be mounted at the path it names; and Proton's 32-bit side needs
libc6:i386, without which wine stops at/lib/ld-linux.so.2: could not openbefore printing its own banner.Three things a fresh Ubuntu 24.04 does not have, and what the image does about them:
meson(apt),widl(mingw-w64-tools ships onlyx86_64-w64-mingw32-widl, so it is linked), and mingw-w64 headers 13 — vkd3d-proton needsPATHCCH_NONE, which the distribution's 11 lacks.Still red elsewhere
cargo test -p xtaskon this branch is 9 passed, 1 failed:switches::documented_switches_are_read. That is a documentation/switch defectunrelated to the container and already being handled elsewhere; this branch does
not touch it. The asset-policy half that used to be red here now passes —
cargo test -p xtask policy→ 7 passed,cargo xtask policy→asset policy: 366 files ok— which is also why theDockerfilename thischange adds to
ALLOWED_NAMESis still the only line it needs there.devcontainer: the whole toolchain in a container, nothing on the hostto feat(devcontainer): the whole toolchain in a container, nothing on the host9d76d806d0toc664837a07c664837a07tobc6f984bf2@Luxuride on GitHub · 2026-12-04 13:54 UTC · original
A question for the maintainer and for anyone who builds this regularly — it decides what this PR should become, so better asked now than after a review round.
Three places this could land:
docs/BUILD.mdgains the container as the recommended path, and a CI job runscargo check/xtask policyinside it. Cost: the project then owns an image (base image bumps, LLVM and mingw versions, the glibc 2.39 floor because the host loads the Mesa it builds). Benefit: one reproducible toolchain, and a Windows-target check that runs on Linux runners.docs/BUILD.mdgets one sentence pointing at them, nothing else depends on it. Cost: it drifts unless someone uses it. Benefit: no maintenance obligation, and nobody who already has a working MSVC setup has to care.My own reading, for what it is worth: the honest value here is not convenience but verifiability — this repo is
x86_64-pc-windows-msvconly, so on Linux the choice today is "install the SDK by hand" or "do not compile the parts that matter". The container makescargo check --target x86_64-pc-windows-msvc -p victory-loadera one-liner, and that is what most of my fixes here were validated with.What I would like to hear:
/dev/dri)?Measured on this machine, so the cost side is concrete: image ~6 GB, first build a few minutes on cached layers,
post-create~30 s warm, thencargo check -p victory-pe --testsfinishes in 8 s. Playback inside the container is not verified yet — that part is honest in the description above, and I would not ask anyone to adopt this for playing until it is.@Luxuride on GitHub · 2026-12-04 20:41 UTC · original · edited 2026-12-04 20:43 UTC
Marked ready for review — ready to merge when you are!
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.