Files
RetroArch/.github/workflows/scripts/wine-server.sh
LibretroAdmin 1d4655730c CI: one Wine server for each Wine step that needs no display
Each program run under Wine started a server that left after it, and a
program started as the last server was leaving was cut off before
main() ("wine client error:0: recvmsg: Connection reset by peer"),
failing the job with nothing wrong in the tree. Steps that run Wine
programs and need no display now source scripts/wine-server.sh, which
keeps one server up for the step and starts Wine's services at once
with no output, so they cannot hold a step's pipe open. Steps that
open windows under Xvfb, start the server themselves or use a prefix
of their own are left as they are: Wine's desktop process, started by
their first window, would hold their output.
2026-10-24 15:45:40 +02:00

19 lines
993 B
Bash

# Sourced by a step that runs Windows programs under Wine, and needs no
# display: one Wine server for the whole step, ended when the step ends.
# Left to itself each program starts a server that leaves after it, and
# a program started as the last one is leaving is cut off before main()
# ("wine client error:0: recvmsg: Connection reset by peer").
# Wine's services start with a server's first program and hold that
# program's output for as long as they live, which is now the step: a
# step piping a test into tee would wait for them. So they are started
# here, with no output to hold. A server already running for the prefix
# is used as it is, and left running. Sets the step's EXIT trap.
if command -v wineserver >/dev/null 2>&1; then
mkdir -p "${WINEPREFIX:-$HOME/.wine}"
if wineserver -p 2>/dev/null; then
trap 'wineserver -k || true' EXIT
WINEDEBUG=-all "$(command -v wine64 || command -v wine)" cmd /c exit \
</dev/null >/dev/null 2>&1 || true
fi
fi