Added bubblewrap / apparmor fixes and diagnostic tools for troubleshooting it on related distros.

This commit is contained in:
2026-09-03 22:16:43 +02:00
parent ecdea827ac
commit 5be4ace6c2
9 changed files with 1039 additions and 9 deletions

View File

@@ -16,6 +16,7 @@ import sys
from typing import Mapping, Sequence
from .command import CommandOutcome, CommandRunner, OutputLineFilter
from .container_host import container_host_error, inspect_container_host
from .depot import DEFAULT_DEPOT_START_OPTION, DepotStartOption
from .gamebox import build_gamebox_command
from .paths import AppPaths
@@ -255,6 +256,7 @@ def prepare_game_runtime(
selection: RuntimeSelection,
runner: CommandRunner,
) -> list[CommandOutcome]:
_require_container_host(selection, runner)
if not runner.dry_run:
paths.create_base_directories()
results: list[CommandOutcome] = []
@@ -388,6 +390,7 @@ def run_game(
extra_environment: Mapping[str, str] | None = None,
output_line_filter: OutputLineFilter | None = None,
) -> CommandOutcome:
_require_container_host(selection, runner)
if not paths.runtime_view.is_dir() and not runner.dry_run:
raise RuntimeErrorPT("runtime view is missing; prepare the game first")
native_executable, windows_executable, game_arguments = _game_start_command(
@@ -520,6 +523,7 @@ def run_runtime_prefix_command(
if not arguments:
raise ValueError("runtime-prefix command arguments cannot be empty")
_require_container_host(selection, runner)
if selection.kind == "umu":
command = [selection.executable, *arguments]
environment = _umu_environment(paths, selection)
@@ -550,6 +554,17 @@ def run_runtime_prefix_command(
)
def _require_container_host(
selection: RuntimeSelection,
runner: CommandRunner,
) -> None:
if runner.dry_run or selection.kind not in {"umu", "proton7-container"}:
return
report = inspect_container_host()
if not report.ready:
raise RuntimeErrorPT(container_host_error(report))
def _runtime_python_path(existing: str | None) -> str:
"""Make the installed package importable after changing into runtime_view."""
package_root = str(Path(__file__).resolve().parent.parent)