Matoking / protontricks

A wrapper that does winetricks things for Proton enabled games, requires Winetricks.
GNU General Public License v3.0
1.66k stars 36 forks source link

Proton Tricks Hangs On: `Executing mkdir -p ...` #116

Closed TheFloatingBrain closed 2 years ago

TheFloatingBrain commented 3 years ago

Describe the bug Protontricks hangs every time I try to use it, also pip reports it as not installed

To Reproduce Steps to reproduce the behavior:

  1. protontricks 244850 --force -q dotnet472 vcrun2015 faudio d3dcompiler_47 (attempting steps from here) or protontricks --gui then navigate to 244850 and ask to install dotnet
  2. Hangs on Executing mkdir -p /home/chris/.steam/steam/steamapps/compatdata/244850 then instillation gets corrupted when I try ^C, then I cant start protontricks

Expected behavior Install needed packages in the correct prefix

System (please complete the following information):

Additional context

When hanging, I tried to ^C (Ctrl+C) it, killed the script but corrupted the install (same result when killing it from System Monitor when running from desktop shortcut: no terminal in that case, so cant be sure, but I think its hanging on the same thing). Tried multiple times with multiple installs, pip says that the package is not installed, have tried to clean and re-install multiple times.

UPDATE: It doesent corrupt if I close the terminal window, but did say it could no longer find the steam install directory

If the error happens when trying to run a Protontricks command, run the command again using the -v flag and copy the output!

protontricks -v
usage: protontricks [-h] [--verbose] [--no-term] [-s SEARCH [SEARCH ...]]
                    [-c COMMAND] [--gui] [--no-runtime] [--no-bwrap] [-V]
                    [appid] ...

Wrapper for running Winetricks commands for Steam Play/Proton games.

Usage:

Run winetricks for game with APPID. COMMAND is passed directly to winetricks as-is. Any options specific to Protontricks need to be provided *before* APPID.
$ protontricks APPID COMMAND

Search installed games to find the APPID
$ protontricks -s GAME_NAME

Use Protontricks GUI to select the game
$ protontricks --gui

Environment variables:

PROTON_VERSION: name of the preferred Proton installation
STEAM_DIR: path to custom Steam installation
WINETRICKS: path to a custom 'winetricks' executable
WINE: path to a custom 'wine' executable
WINESERVER: path to a custom 'wineserver' executable
STEAM_RUNTIME: 1 = enable Steam Runtime, 0 = disable Steam Runtime, valid path = custom Steam Runtime path, empty = enable automatically (default)
PROTONTRICKS_GUI: GUI provider to use, accepts either 'yad' or 'zenity'

positional arguments:
  appid
  winetricks_command

optional arguments:
  -h, --help            show this help message and exit
  --verbose, -v         Print debug information
  --no-term             Program was launched from desktop. This is used automatically when lauching Protontricks from desktop and no user-visible terminal is available.
  -s SEARCH [SEARCH ...], --search SEARCH [SEARCH ...]
                        Search for game(s) with the given name
  -c COMMAND, --command COMMAND
                        Run a command in the game's installation directory with Wine-related environment variables set. The command is passed to the shell as-is without being escaped.
  --gui                 Launch the Protontricks GUI.
  --no-runtime          Disable Steam Runtime
  --no-bwrap            Disable bwrap containerization when using Steam Runtime
  -V, --version         show program's version number and exit
Velnbur commented 3 years ago

The same issue GNU/Linux: Pop_OS! Game: Space Engineers

TobsenD commented 3 years ago

Same issue: GNU/Linux: Manjaro Game: No Man's Sky

Here is the log, with extra output after cancle

SSL_INIT
Executing mkdir -p /home/tobsend/.steam/steam/steamapps/compatdata/275850
^C/usr/bin/winetricks: Zeile 3455: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
/usr/bin/winetricks: Zeile 3455: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
/usr/bin/winetricks: Zeile 3455: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
/usr/bin/winetricks: Zeile 3455: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
/usr/bin/winetricks: Zeile 3455: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
------------------------------------------------------
WINEPREFIX INFO:
Drive C: insgesamt 36
drwxr-xr-x  9 tobsend tobsend 4096 25. Sep 12:26 .
drwxr-xr-x  4 tobsend tobsend 4096 25. Sep 12:51 ..
drwxr-xr-x  2 tobsend tobsend 4096 25. Sep 12:26 openxr
drwxr-xr-x  4 tobsend tobsend 4096 25. Sep 12:26 ProgramData
drwxr-xr-x  6 tobsend tobsend 4096 25. Sep 12:26 Program Files
drwxr-xr-x  7 tobsend tobsend 4096 25. Sep 12:26 Program Files (x86)
drwxr-xr-x  4 tobsend tobsend 4096 25. Sep 12:26 users
drwxr-xr-x  3 tobsend tobsend 4096 25. Sep 12:26 vrclient
drwxr-xr-x 18 tobsend tobsend 4096 25. Sep 12:26 windows

Registry info:
/home/tobsend/.steam/steam/steamapps/compatdata/275850/pfx/system.reg:#arch=win64
/home/tobsend/.steam/steam/steamapps/compatdata/275850/pfx/userdef.reg:#arch=win64
/home/tobsend/.steam/steam/steamapps/compatdata/275850/pfx/user.reg:#arch=win64
------------------------------------------------------
cat: /tmp/winetricks.cFvPkc9B/early_wine.err.txt: Datei oder Verzeichnis nicht gefunden
------------------------------------------------------
warning: /home/tobsend/.cache/protontricks/proton/Proton Experimental/bin/wine cmd.exe /c echo '%AppData%' returned empty string, error message "" 
------------------------------------------------------
Traceback (most recent call last):
  File "/usr/bin/protontricks", line 33, in <module>
    sys.exit(load_entry_point('protontricks==1.6.0', 'console_scripts', 'protontricks')())
  File "/usr/lib/python3.9/site-packages/protontricks/cli/main.py", line 28, in cli
    main(args)
  File "/usr/lib/python3.9/site-packages/protontricks/cli/util.py", line 143, in wrapper
    return cli_func(self, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/protontricks/cli/main.py", line 284, in main
    run_command(
  File "/usr/lib/python3.9/site-packages/protontricks/util.py", line 404, in run_command
    run(command, **kwargs)
  File "/usr/lib/python3.9/subprocess.py", line 507, in run
    stdout, stderr = process.communicate(input, timeout=timeout)
  File "/usr/lib/python3.9/subprocess.py", line 1126, in communicate
    self.wait()
  File "/usr/lib/python3.9/subprocess.py", line 1189, in wait
    return self._wait(timeout=timeout)
  File "/usr/lib/python3.9/subprocess.py", line 1917, in _wait
    (pid, sts) = self._try_wait(0)
  File "/usr/lib/python3.9/subprocess.py", line 1875, in _try_wait
    (pid, sts) = os.waitpid(self.pid, wait_flags)
KeyboardInterrupt
Matoking commented 3 years ago

Steam Runtime was updated two days ago, and that seems to have broken something that seemingly causes Wine to freeze.

I'll have to investigate this further, but for the time being you can use --no-bwrap as a workaround. Add it immediately after the protontricks executable like this:

$ protontricks --no-bwrap 244850 --force -q dotnet472 vcrun2015 faudio d3dcompiler_47
TobsenD commented 3 years ago

Workaround has worked. Thanks

Matoking commented 3 years ago

Upon closer inspection, this seems to be a bug with new versions of Proton Experimental rather than Steam Runtime; can you check whether changing the Proton version to 6.3 fixes the hang?

The reason why Steam Runtime causes a hang but --no-bwrap works is because Steam Runtime waits for all Wine processes to exit, while with --no-bwrap only the initial command needs to exit for Winetricks to continue. The side effect is that --no-bwrap causes Wine processes to remain in the background, taking up system resources and potentially causing side effects with later commands.

I've submitted an upstream bug report with more details at ValveSoftware/wine#126.

TobsenD commented 3 years ago

I can confirm that the problem does not occur with Proton 6.3-6. So this is clearly the error in the Experimental.

Matoking commented 3 years ago

@TobsenD This appears to have been fixed in one of the newer versions of Proton Experimental. Could you check if it works again?

TobsenD commented 3 years ago

Error does not occur with version 6.3-7 and also not in Experimental. However, one must have patience, until it goes off from the first MKDIR, pass times already 30-40 seconds.

protontricks 275850 win7 -v                                                                                                                             ✔ 
SSL_INIT
Executing mkdir -p /home/tobsend/.local/share/Steam/steamapps/compatdata/275850
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Using winetricks 20210206-next - sha256sum: 0769bbcdbd92c407f4eacaa85acc1339f607dbeafe2febd1be0912034c7af3a1 with wine-6.3 and WINEARCH=win64
Executing w_do_call win7
Executing mkdir -p /home/tobsend/.local/share/Steam/steamapps/compatdata/275850
------------------------------------------------------
warning: You are using a 64-bit WINEPREFIX. Note that many verbs only install 32-bit versions of packages. If you encounter problems, please retest in a clean 32-bit WINEPREFIX before reporting a bug.
------------------------------------------------------
Executing load_win7 
Executing /home/tobsend/.cache/protontricks/proton/Proton Experimental/bin/wine winecfg -v win7
wineserver: using server-side synchronization.
wine: RLIMIT_NICE is <= 20, unable to use setpriority safely
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000017
0080:fixme:plugplay:pdo_pnp_dispatch Unhandled function 00000002
------------------------------------------------------
warning: Running /home/tobsend/.cache/protontricks/proton/Proton Experimental/bin/wineserver -w. This will hang until all wine processes in prefix=/home/tobsend/.local/share/Steam/steamapps/compatdata/275850/pfx terminate
------------------------------------------------------
+ return 0
+ winetricks_stats_report
+ winetricks_download_setup
+ case "${WINETRICKS_DOWNLOADER}" in
++ command -v aria2c
+ '[' -x '' ']'
++ command -v wget
+ '[' -x /usr/bin/wget ']'
+ WINETRICKS_DOWNLOADER=wget
+ WINETRICKS_DOWNLOADER_RETRIES=3
+ WINETRICKS_DOWNLOADER_TIMEOUT=15
+ case "${WINETRICKS_OPT_TORIFY}" in
+ torify=
+ aria2c_torify_opts=
+ case "${WINETRICKS_STATS_REPORT}" in
+ return
+ winetricks_cleanup
+ test ''
+ set +e
+ test -f /tmp/winetricks.IfOD5MxH/w.tobsend.25611/dd-pid
+ test /home/tobsend/.local/share/Steam/steamapps/compatdata/275850/pfx/dosdevices/y:
+ rm -f /home/tobsend/.local/share/Steam/steamapps/compatdata/275850/pfx/dosdevices/y:
+ test '' = 1
+ rm -rf /tmp/winetricks.IfOD5MxH/w.tobsend.25611
+ test '' = 1
+ rm -rf /tmp/winetricks.IfOD5MxH
+ test '' = 1
+ rm -rf /home/tobsend/.local/share/Steam/steamapps/compatdata/275850/pfx/wrapper.cfg