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

Running wine command in game prefix fails #95

Closed codicodi closed 3 years ago

codicodi commented 3 years ago

Describe the bug I'm used to running stuff within game prefixes like this protontricks -c 'wine /path/to/mod/manager/or/whatever.exe' 489830 This doesn't work anymore after updating protontricks to 1.5.0.

To Reproduce Run protontricks -c 'wine --version' 489830

Expected behavior wine command executes correctly

System (please complete the following information):

Additional context

Full output:

$ protontricks -c 'wine --version' -v 489830
protontricks (INFO): Found Steam directory at /home/robertc/.steam/steam. You can also define Steam directory manually using $STEAM_DIR
protontricks (INFO): Using default Steam Runtime at /home/robertc/.steam/root/ubuntu12_32/steam-runtime
protontricks (INFO): WINETRICKS environment variable is not available. Searching from $PATH.
protontricks (INFO): Found 1 Steam library folders
protontricks (INFO): Currently logged-in Steam user: emperor600
protontricks (INFO): Couldn't find custom shortcuts. Maybe none have been created yet?
protontricks (INFO): Found active Proton installation: Proton 6.3
protontricks (INFO): WINE environment variable is not available. Setting WINE environment variable to Proton bundled version
protontricks (INFO): WINESERVER environment variable is not available. Setting WINESERVER environment variable to Proton bundled version
protontricks (INFO): Using separately installed Steam Runtime: Steam Linux Runtime - Soldier
protontricks (WARNING): Running Steam Runtime using bwrap containerization. This is an experimental feature and it may still be incompatible in some situations.
If any problems arise, please try running the command again using the `--no-bwrap` flag and make an issue report if the problem only occurs when bwrap is in use.
protontricks (INFO): Created Steam Runtime Wine binary directory at /home/robertc/.cache/protontricks/proton/Proton 6.3/bin
protontricks (INFO): Attempting to run command wine --version
/home/robertc/.cache/protontricks/proton/Proton 6.3/bin/wine: line 8: /srv/steam/steamapps/common/Proton 6.3/dist/bin/wine: No such file or directory

Unlike the error message suggests, /srv/steam/steamapps/common/Proton 6.3/dist/bin/wine exists. Note that my Steam library is mounted to /srv/steam.

The following workarounds seem to work fine protontricks --no-bwrap -c 'wine --version' 489830 protontricks -c '"$PROTON_DIST_PATH"/bin/wine --version' 489830

Matoking commented 3 years ago

/srv wasn't in the hardcoded list of mount points, meaning Wine running inside a mount namespace wasn't able to find it; this is part of the bwrap containerization that is meant to improve compatibility.

I've pushed a fix to improve_bwrap_mounts that tries to more exhaustively mount all root directories, except for those that may cause conflicts with Steam Runtime. There is also a special case for Wine prefix and Proton installation directory, where those mounts are added separately only if they're not covered by one of the allowed root directories; this should improve performance a bit since each additional mount point increases startup time when running a Wine executable.

Can you test if the improve_bwrap_mounts branch fixes the issue? You can install the bug fix using pipx like this (you'll have to uninstall your current Protontricks installation and install python-pipx from the Arch repo first):

pipx install git+https://github.com/Matoking/protontricks.git@improve_bwrap_mounts
codicodi commented 3 years ago

Yep, your branch works for me

Matoking commented 3 years ago

Thanks for the help, I've merged the fix into master.