Skip to content

Commit

Permalink
Try creating 'Temp' dir for wine (#1316)
Browse files Browse the repository at this point in the history
* Try creating 'Temp' dir for wine

* Trying again...

* mount order matters...

* black
  • Loading branch information
mkst authored Aug 6, 2024
1 parent f79419e commit 716477c
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions backend/coreapp/sandbox.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import contextlib
import getpass
import logging
import os
import shlex
Expand Down Expand Up @@ -50,6 +51,11 @@ def sandbox_command(self, mounts: List[Path], env: Dict[str, str]) -> List[str]:

assert ":" not in str(self.path)
assert ":" not in str(settings.WINEPREFIX)

# wine-specific hacks
user = getpass.getuser()
(self.path / "Temp").mkdir(parents=True, exist_ok=True)

# fmt: off
wrapper = [
str(settings.SANDBOX_NSJAIL_BIN_PATH),
Expand All @@ -75,6 +81,7 @@ def sandbox_command(self, mounts: List[Path], env: Dict[str, str]) -> List[str]:
"--rlimit_nofile", "soft",
# the following are settings that can be removed once we are done with wine
"--bindmount_ro", f"{settings.WINEPREFIX}:/wine",
"--bindmount", f"{self.path}/Temp:/wine/drive_c/users/{user}/Temp",
"--env", "WINEDEBUG=-all",
"--env", "WINEPREFIX=/wine",
]
Expand Down

0 comments on commit 716477c

Please sign in to comment.