From 5467e210668eb24de9a4429ef0ddcbc6442e8932 Mon Sep 17 00:00:00 2001 From: SulfurNitride Date: Thu, 19 Feb 2026 17:25:48 -0600 Subject: Add Python init diagnostics, AppImage build system, misc Linux fixes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - python: switch Py_InitializeEx → Py_InitializeFromConfig for explicit error reporting; add dladdr + fprintf diagnostics to trace which DSO Python symbols resolve to and whether Py_IsInitialized succeeds - python: log RTLD_NOLOAD vs fresh-load outcome when promoting libpython to RTLD_GLOBAL - build: add Docker-based AppImage build script (build.sh), update Dockerfile and build-inner.sh for AppImage-only workflow - build: remove Flatpak support entirely; move AppImage metadata (desktop/metainfo/icon) from flatpak/ to data/ - Add Monster Hunter Wilds basic_games plugin - .gitignore: exclude squashfs-root, build-source, flatpak-repo, __pycache__, fomod-plus-settings.ini - Various Linux port fixes across wineprefix, processrunner, proton launcher, FUSE connector, instance manager, download manager, sanitychecks, and NaK Rust paths/runtime_wrap Co-Authored-By: Claude Sonnet 4.6 --- src/plugins/rootbuilder.py | 52 ++++------------------------------------------ 1 file changed, 4 insertions(+), 48 deletions(-) (limited to 'src/plugins/rootbuilder.py') diff --git a/src/plugins/rootbuilder.py b/src/plugins/rootbuilder.py index dcc6706..342e1a0 100644 --- a/src/plugins/rootbuilder.py +++ b/src/plugins/rootbuilder.py @@ -57,18 +57,6 @@ def _walk_files(root_dir: str): yield os.path.join(dirpath, name) -def _host_cp(src: str, dst: str) -> bool: - """Copy a file via the host OS (bypasses Flatpak sandbox restrictions).""" - try: - result = subprocess.run( - ["flatpak-spawn", "--host", "cp", "-f", "--reflink=auto", "--", src, dst], - capture_output=True, timeout=30, - ) - return result.returncode == 0 - except (subprocess.SubprocessError, OSError): - return False - - def _ensure_readable(path: str): """Ensure a file has owner-read permission (mod archives sometimes strip it).""" try: @@ -99,8 +87,6 @@ def _reflink_copy(src: str, dst: str): return except OSError as e: last_err = f"{e.strerror} (errno {e.errno})" - if _IN_FLATPAK and _host_cp(src, dst): - return raise OSError(f"Root Builder: failed to copy {src} -> {dst}: {last_err}") @@ -113,33 +99,6 @@ def _ensure_writable(path: str): pass -_IN_FLATPAK = os.path.exists("/.flatpak-info") - - -def _host_rm(path: str) -> bool: - """Remove a file via the host OS (bypasses Flatpak sandbox restrictions).""" - try: - result = subprocess.run( - ["flatpak-spawn", "--host", "rm", "-f", "--", path], - capture_output=True, timeout=10, - ) - return result.returncode == 0 - except (subprocess.SubprocessError, OSError): - return False - - -def _host_mv(src: str, dst: str) -> bool: - """Move a file via the host OS (bypasses Flatpak sandbox restrictions).""" - try: - result = subprocess.run( - ["flatpak-spawn", "--host", "mv", "-f", "--", src, dst], - capture_output=True, timeout=10, - ) - return result.returncode == 0 - except (subprocess.SubprocessError, OSError): - return False - - def _force_remove(path: str) -> bool: """Remove a file, fixing permissions if needed. Returns True on success.""" try: @@ -154,8 +113,6 @@ def _force_remove(path: str) -> bool: return True except OSError: pass - if _IN_FLATPAK and _host_rm(path): - return True qWarning(f"Root Builder: could not remove {path}") return False @@ -556,11 +513,10 @@ class RootBuilder(mobase.IPluginTool): _force_remove(dst) shutil.move(bak, dst) except OSError: - if not (_IN_FLATPAK and _host_mv(bak, dst)): - qWarning( - f"Root Builder: could not restore backup " - f"{bak} -> {dst}" - ) + qWarning( + f"Root Builder: could not restore backup " + f"{bak} -> {dst}" + ) # Clean up backup dir backup_dir = os.path.join(storage, _BACKUP_SUBDIR) -- cgit v1.3.1