From 523a69698b976e468a2f6b0a280c560246b88d7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois?= Date: Sat, 30 May 2026 10:56:16 +0200 Subject: [PATCH] build_all --ram: exclude flatpak from tmpfs (rofiles-fuse can't mount /dev/shm) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit flatpak-builder mounts its state dir via rofiles-fuse; FUSE mounts fail on /dev/shm ('fusermount: Permission denied'). So --ram no longer redirects the flatpak dirs — it builds on disk as before. PyInstaller workpath, AppImage AppDir and TMPDIR/PIP_CACHE_DIR still go to tmpfs. Co-Authored-By: Claude Opus 4.8 --- build_all.sh | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/build_all.sh b/build_all.sh index b0231d3..ae390f4 100755 --- a/build_all.sh +++ b/build_all.sh @@ -21,9 +21,10 @@ # log of any failing step is printed at the end. # # Pass --ram to redirect the per-channel build scratch (PyInstaller workpath, -# Flatpak build dir + ostree repo, AppImage AppDir) and TMPDIR/PIP_CACHE_DIR to -# /dev/shm, and skip UPX. Big speedup on slow/flash storage. On a RAM-limited -# machine combine with --serial (e.g. ./build_all.sh --ram --serial). +# AppImage AppDir) and TMPDIR/PIP_CACHE_DIR to /dev/shm, and skip UPX. Big +# speedup on slow/flash storage. Flatpak is excluded (its rofiles-fuse can't +# mount on /dev/shm), so it still builds on disk. On a RAM-limited machine +# combine with --serial (e.g. ./build_all.sh --ram --serial). # # All artifacts are collected (copied) under /dist/. Original outputs in # src/dist/, package/*/dist/, doc/manual/ are left in place. Wheel and AppImage @@ -83,24 +84,22 @@ source "$SCRIPT_DIR/scripts/set_env.sh" # ---------- RAM mode: put build scratch on tmpfs (--ram) ---------------------- # On slow storage (USB stick, SD card) the per-channel build dirs and temp -# churn dominate. --ram redirects them to /dev/shm and skips UPX. The whole -# Flatpak working set (build dir + .flatpak-builder + repo) goes to tmpfs -# because flatpak-builder requires its state dir on the same filesystem as the -# build dir — so its download cache doesn't persist across --ram runs. The -# tmpfs scratch is freed on exit. +# churn dominate. --ram redirects the PyInstaller workpath, the AppImage AppDir +# and TMPDIR/PIP_CACHE_DIR to /dev/shm, and skips UPX. Flatpak is intentionally +# NOT moved: flatpak-builder mounts its state dir with rofiles-fuse, and FUSE +# can't mount on /dev/shm (fusermount: Permission denied) — so it builds on +# disk. The tmpfs scratch is freed on exit. if [ "$RAM" -eq 1 ]; then RAMROOT="/dev/shm/testium-build-${VERSION}" echo "-- RAM mode: build scratch under $RAMROOT (tmpfs), freed on exit" + echo " (flatpak builds on disk — rofiles-fuse can't mount on /dev/shm)" rm -rf "$RAMROOT" - mkdir -p "$RAMROOT"/{tmp,pip,pyi-work,flatpak-build,flatpak-state,flatpak-repo,appdir} + mkdir -p "$RAMROOT"/{tmp,pip,pyi-work,appdir} export TMPDIR="$RAMROOT/tmp" export PIP_CACHE_DIR="$RAMROOT/pip" export PYI_WORKPATH="$RAMROOT/pyi-work" # pyinstaller --workpath - export FLATPAK_BUILDDIR="$RAMROOT/flatpak-build" # flatpak-builder build dir - export FLATPAK_STATEDIR="$RAMROOT/flatpak-state" # .flatpak-builder (same fs as build dir, required) - export FLATPAK_REPODIR="$RAMROOT/flatpak-repo" # ostree repo - export APPIMAGE_APPDIR_TMPFS="$RAMROOT/appdir" # AppDir bind-mount - export TESTIUM_NO_UPX=1 # skip slow UPX in the spec + export APPIMAGE_APPDIR_TMPFS="$RAMROOT/appdir" # AppDir bind-mount + export TESTIUM_NO_UPX=1 # skip slow UPX in the spec trap 'rm -rf "$RAMROOT"' EXIT if [ "$SERIAL" -ne 1 ]; then echo " note: with --ram, prefer adding --serial so each step gets the"