xtask package tests leak /tmp/appimage_extracted_* (150 MB per CI run) and filled /tmp #983

Open
opened 2026-11-20 00:51:58 +00:00 by charles · 1 comment
Owner

cargo xtask ci on Linux leaves a /tmp/appimage_extracted_<hash> directory of about 150 MB behind on every run (one per distinct AppImage build). On this machine 171 of them had accumulated (about 25 GB), which filled the 31 GB /tmp tmpfs: the gate's xtask/tests/package.rs tests (appimage_bundles_ffmpeg_under_usr_lib_flaxative, appimage_has_flaxative_desktop_icon_and_binary, package_writes_the_asset_fragment, …) then failed with "No space left on device", and other tools using /tmp stopped working.

Where they come from: xtask/src/package.rs runs appimagetool and the AppImage itself with APPIMAGE_EXTRACT_AND_RUN=1 (lines ~887 and ~907); the type-2 runtime extracts into $TMPDIR/appimage_extracted_<md5 of the image> and the directories are not removed. xtask/tests/package.rs also leaks a tempfile::tempdir().keep() scratch home per run (lines ~299, ~644).

Steps to reproduce: run FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci on Linux a few times with different commits; ls -d /tmp/appimage_extracted_* | wc -l grows by one per build.

Seen on commit 23e834ec8 (branch camera-10-capture-camera-on-linux, base origin/camera db2b18607). Workaround used there: running the gate with TMPDIR on a disk volume. Nothing was deleted; the leftover directories under /tmp are still there for Charles to clear.

Expected: the package tests and xtask package point the AppImage runtime at a scratch directory under CARGO_TARGET_TMPDIR (or the package's own staging dir) via TMPDIR, and remove it afterwards; or set the runtime's cleanup so nothing stays behind.

`cargo xtask ci` on Linux leaves a `/tmp/appimage_extracted_<hash>` directory of about 150 MB behind on every run (one per distinct AppImage build). On this machine 171 of them had accumulated (about 25 GB), which filled the 31 GB `/tmp` tmpfs: the gate's `xtask/tests/package.rs` tests (`appimage_bundles_ffmpeg_under_usr_lib_flaxative`, `appimage_has_flaxative_desktop_icon_and_binary`, `package_writes_the_asset_fragment`, …) then failed with "No space left on device", and other tools using `/tmp` stopped working. Where they come from: `xtask/src/package.rs` runs `appimagetool` and the AppImage itself with `APPIMAGE_EXTRACT_AND_RUN=1` (lines ~887 and ~907); the type-2 runtime extracts into `$TMPDIR/appimage_extracted_<md5 of the image>` and the directories are not removed. `xtask/tests/package.rs` also leaks a `tempfile::tempdir().keep()` scratch home per run (lines ~299, ~644). Steps to reproduce: run `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` on Linux a few times with different commits; `ls -d /tmp/appimage_extracted_* | wc -l` grows by one per build. Seen on commit 23e834ec8 (branch camera-10-capture-camera-on-linux, base origin/camera db2b18607). Workaround used there: running the gate with `TMPDIR` on a disk volume. Nothing was deleted; the leftover directories under `/tmp` are still there for Charles to clear. Expected: the package tests and `xtask package` point the AppImage runtime at a scratch directory under `CARGO_TARGET_TMPDIR` (or the package's own staging dir) via `TMPDIR`, and remove it afterwards; or set the runtime's cleanup so nothing stays behind.
Author
Owner

Fixed on the camera branch (reaches textchat with the Camera merge): both AppImage runs in xtask package get a TMPDIR beside the package and remove it. The packaging tests pass and leave nothing in /tmp. The 178 leaked folders on the workstation were removed (none in use). Leaving this open until it is on textchat.

Fixed on the `camera` branch (reaches textchat with the Camera merge): both AppImage runs in `xtask package` get a TMPDIR beside the package and remove it. The packaging tests pass and leave nothing in /tmp. The 178 leaked folders on the workstation were removed (none in use). Leaving this open until it is on textchat.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#983
No description provided.