fix(build): let Proton's Wine create non-ASCII file names under Steam

Steam starts games with LC_ALL=C, and Wine reads the C locale as ASCII
for every Unix file name it makes, so a name like '• drum loop.webm'
could not be created at all. Sheepy, an NW.js game, unpacks its app from
a zip at start, stopped at that file, and showed NW.js's empty window.

Proton is now patched before it builds (patches/proton/<submodule>/), and
the first patch reads an ASCII locale as UTF-8. The image name gains -nN
for our patch level, so a patched build never takes the plain tag's name.
This commit is contained in:
Wanjohi
2026-10-15 10:56:29 +03:00
parent a73c0c4cfc
commit 6770684e5c
3 changed files with 32 additions and 1 deletions
+12
View File
@@ -110,6 +110,18 @@ RUN pacman -Syu --noconfirm --needed \
libsm libtheora xz \
&& pacman -Scc --noconfirm
# Our own patches, one directory per submodule they apply to: patches/proton/
# wine/ applies in wine/. Its own layer, after the fetch and the dependencies,
# so a patch change costs the build and nothing before it. A patch that no
# longer applies to a new tag stops here, before the hours of building.
COPY patches/proton /build/patches/proton
RUN set -e; cd /build/patches/proton; \
for dir in */; do \
for p in "${dir}"*.patch; do \
echo "applying ${p}"; \
patch -d "/build/proton-cachyos/${dir%/}" -p1 --forward < "${p}"; \
done; \
done
COPY scripts/proton-build.sh /build/proton-build.sh
RUN GECKO_VER="${GECKO_VER}" MONO_VER="${MONO_VER}" JOBS="${JOBS}" \
bash /build/proton-build.sh
+6 -1
View File
@@ -38,8 +38,13 @@ IMAGE_NAME := ghcr.io/nestrilabs/nestri/base
# number in two spellings and an image whose name does not say which Proton is
# inside it is worse than no image at all. Changing the tag by hand and
# forgetting the version is exactly the mistake this removes.
#
# `PROTON_PATCHES` counts our own changes on top of that tag (patches/proton/).
# Bump it whenever they change, so a patched build never takes the name of the
# one before it; reset it to 0 when the tag moves.
PROTON_TAG ?= cachyos-11.0-20261005-native
PROTON_VERSION := $(PROTON_TAG:cachyos-%-native=%)
PROTON_PATCHES ?= 1
PROTON_VERSION := $(PROTON_TAG:cachyos-%-native=%)-n$(PROTON_PATCHES)
PROTON_IMAGE ?= ghcr.io/nestrilabs/proton-cachyos-native-wow64
PROTON_REF := $(PROTON_IMAGE):$(PROTON_VERSION)
OUTPUT_DIR := output
@@ -0,0 +1,14 @@
--- a/dlls/ntdll/unix/env.c
+++ b/dlls/ntdll/unix/env.c
@@ -286,6 +286,11 @@
if (!(ctype = setlocale( LC_CTYPE, "" ))) name = "UTF-8";
else if (!(name = nl_langinfo( CODESET ))) return;
+ /* The C and POSIX locales name plain ASCII, in which a non-ASCII file
+ * name cannot be created at all. Steam starts games with LC_ALL=C, so
+ * under it every such name failed; ASCII is a subset of UTF-8, so
+ * reading it as UTF-8 changes nothing that worked before. */
+ if (!strcmp( name, "ANSI_X3.4-1968" )) name = "UTF-8";
TRACE_(nls)( "Unix LC_CTYPE %s, using %s codeset\n", debugstr_a(ctype), debugstr_a(name) );
/* remove punctuation characters from charset name */