Repository navigation
fix(updater): don't fail AppImage installs when the temp dir is another mount of the same file system - #3688
Merged
lucasfernog merged 2 commits intoOct 10, 2026
Conversation
Two mounts of one file system share st_dev, so install_appimage could pick a bind-mounted or private temp dir and then fail every install with EXDEV. Move on to the next location instead; the last one is the AppImage's own directory.
followdarko
force-pushed
the
fix/updater-appimage-cross-mount
branch
from
October 10, 2026 16:23
90a1daa to
7e77005
Compare
lucasfernog
reviewed
Oct 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On Linux, an AppImage update can fail on every attempt with
Invalid cross-device link (os error 18).install_appimagepicks the first of temp dir / cache dir / the AppImage's own directory whosest_devmatches the AppImage, and renames the running AppImage into it as a backup. Matchingst_devdoesn't mean the rename can work, though: two mounts of the same file system (a bind-mounted/tmp, systemd'sPrivateTmp) report the samest_dev, andrename(2)still refuses to cross them withEXDEV. The function returns that error straight away, so it never gets to the AppImage's own directory, which is the one location that is always on the same mount. Retrying picks the same temp dir and fails the same way.We hit this with a user on NixOS: five failed installs in a row, all
Io(CrossesDevices).The fix: when the backup rename fails with
ErrorKind::CrossesDevices, try the next location instead of returning. Nothing has been touched yet at that point (the rename failed, theTempDiris dropped), and the last location is the AppImage's own directory, so the loop now always ends on a mount the rename can use.ErrorKind::CrossesDevicesis stable since 1.85, MSRV is 1.90.Testing: I didn't find a way to make
EXDEVhappen in a unit test without mounting something, so I checked it in a privileged Docker container (Debian, rust 1.90)./data/tmpsrcis bind-mounted at/tmp2, the AppImage is/data/apps/Any.AppImage, run withTMPDIR=/tmp2and a cache dir that is another bind mount:st_dev64install_appimagefromv2copied into a small binary:Io(Os { code: 18, kind: CrossesDevices, message: "Invalid cross-device link" }), AppImage left as it wasOk(()), the AppImage has the new contents, nothing is left behind in the directorycargo fmt --checkis clean. I could not run clippy for the crate on Linux locally (the gtk build runs out of memory in my container), so CI gets the first word there.