Skip to content

fix(update): decide from how the app was installed, not from one file's existence - #575

Merged
EVWorth merged 1 commit into
mainfrom
fix/platform-detection
Sep 8, 2026
Merged

EVWorth merged 1 commit into
mainfrom
fix/platform-detection

Conversation

@EVWorth

@EVWorth EVWorth commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Closes #354, #571. Fourth of the update-system work.

The check got the important case backwards

Ok(Path::new("/usr/bin/rpm-ostree").exists())

Inside a Flatpak sandbox the host's /usr is not visible. So a Flatpak on Silverblue sees no rpm-ostree binary, reports itself as an ordinary install, and is offered an auto-update its runtime will not let it apply.

The opposite mistake was available too: plenty of ordinary Fedora systems have the rpm-ostree binary installed without being OSTree-booted, and were sent to a manual command they don't need.

What replaces it

get_platform_info returns how the app was installed and on what architecture:

Format Detected by
Flatpak /.flatpak-info, or FLATPAK_ID
Snap SNAP
AppImage APPIMAGE
RpmOstree /run/ostree-booted — whether the host booted from an OSTree, not whether a binary happens to exist
Standard none of the above

Sandboxes are tested first, deliberately — inside one, the host's markers are either invisible or not ours to act on. That ordering is what makes the Flatpak-on-Silverblue case come out right.

Only Standard and AppImage may self-update. Flatpak, Snap and OSTree each have a runtime that owns the installed files, and each now gets its own command plus a sentence saying why the app isn't doing it itself. The rpm-ostree URL uses the running architecture — an aarch64 machine was previously handed an x86_64 download (#571).

A detection failure means "don't offer to update". That's the safe direction: an update the app can't apply is worse than one it doesn't offer.

On verification

The decision is a pure function over a probe trait, so each packaging is tested without arranging the real thing. I can't produce a Flatpak sandbox or an OSTree host here, and I'd rather say that than imply the detection has been exercised in the wild. What's verified is that the rules are the ones intended — including the Flatpak-on-OSTree case that motivated this.

One thing that would have failed at release time

The Path import was #[cfg(target_os = "linux")], because the old check was Linux-only. The new probe reads paths on every target, so it's unconditional now. Left as it was, this compiles here and on the Lint (Rust) job — and breaks the macOS and Windows release builds, which nothing exercises until a tag is pushed.

Seven Rust tests, six on the channel policy. 1837 unit + 303 browser; clippy/tsc/dprint/eslint clean.

Left in this area

#353 (no preview of what's being installed) is the last one, plus #355 which is mislabelled into this area — it's about the formatter settings dialog, not updates.

🤖 Generated with Claude Code

…'s existence

Closes #354, #571.

The check was `Path::new("/usr/bin/rpm-ostree").exists()`, which answers a
narrower question than the one being asked and gets the important case
backwards.

Inside a Flatpak sandbox the host's /usr is not visible. A Flatpak on
Silverblue therefore sees no rpm-ostree binary, reports itself as an ordinary
install, and is offered an auto-update its runtime will not let it apply. The
opposite mistake is available too: plenty of ordinary Fedora systems have the
rpm-ostree binary installed without being OSTree-booted, and were told to use
a manual command they do not need.

get_platform_info replaces it, returning how the app was installed and on
what architecture:

  Flatpak      /.flatpak-info, or FLATPAK_ID
  Snap         SNAP
  AppImage     APPIMAGE
  RpmOstree    /run/ostree-booted — whether the host booted from an OSTree,
               rather than whether a binary happens to be present
  Standard     none of the above

Sandboxes are tested first and deliberately: inside one, the host's markers
are either invisible or not ours to act on.

Only Standard and AppImage may update themselves. Flatpak, Snap and OSTree
all have a runtime that owns the installed files, and each now gets its own
command and a sentence saying why the app is not doing it. The rpm-ostree URL
uses the running architecture — an aarch64 machine was handed an x86_64
download.

A detection failure means "do not offer to update", which is the safe
direction: an update the app cannot apply is worse than one it does not
offer.

The decision is a pure function over a probe trait, so each packaging is
tested without arranging the real thing — I cannot produce a Flatpak sandbox
or an OSTree host here, and would rather say so than imply the detection has
been exercised in the wild. What is verified is that the rules are the ones
intended, including the Flatpak-on-OSTree case that motivated this.

Seven Rust tests, six on the channel policy. The status bar's diagnostic blob
now reports the install type rather than a yes/no for rpm-ostree.

Also: the Path import was Linux-only, because the old check was. The probe
reads paths on every target, so it is unconditional now — left as it was,
this would have compiled here and failed on the macOS and Windows release
builds.

Co-Authored-By: Claude Opus 5 <[email protected]>
@EVWorth
EVWorth merged commit f492398 into main Sep 8, 2026
10 checks passed
@EVWorth
EVWorth deleted the fix/platform-detection branch September 8, 2026 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[P1/security] is_rpm_ostree is too narrow — doesn't cover Flatpak, NixOS, containerized envs

1 participant