host: bind /tmp/.wine-<uid> to disk when /tmp is tmpfs #502
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/502"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from brcly/TuxBox. Originally posted by smith-3 on 2026-11-29T17:26:42Z.
Fixes #419.
Summary
On Linux systems where
/tmpis mounted astmpfs,wineserverstill creates/tmp/.wine-<uid>under/tmp(it ignoresTMPDIRand rejects symlinks), so deleted-but-opentmpmap-*files remain in RAM (shmem) and can exhaust memory during large allocations.Changes
project_tuxbox/host.py:path_is_tmpfs()to inspect/proc/self/mountsusing longest-prefix mount matching (with octal escape decoding).wrap_wine_server_dir()to wrap Linux launches inbwrap --die-with-parent --dev-bind / / --perms 0700 --dir /tmp/.wine-<uid> --bind <prefix>/wine-server /tmp/.wine-<uid> --whenever/tmp/.wine-<uid>resolves totmpfsandbwrapsucceeds a quicktrueprobe.bwrapis unavailable or restricted, and skips wrapping when/tmp/.wine-<uid>is already on a disk-backed filesystem.docs/PROJECTSCARLETT.md: Documented the automaticbwrapbind-mount behavior and manual mode-0700fallback note.tests/test_host.py: AddedWineServerDiskMountunit tests covering/proc/self/mountslongest-prefix detection,bwrapcommand wrapping with0o700directory creation, and disk/no-bwrapfallback behavior.Verification
python -m unittest tests/test_host.py tests/test_cli.py tests/test_repository_hygiene.py— 55 tests OK.bwrap --die-with-parent --dev-bind / / --perms 0700 --dir /tmp/.wine-<uid> --bind <dir> /tmp/.wine-<uid> --succeeds on Linux (including when nested withunshare --user --map-current-user --net).Imported from brcly/TuxBox. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-29T17:26:52Z.
Review: COMMENTED
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.