From 5bb057cb71a8b64745f1520c476e48ba839533aa Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 11 Aug 2026 11:12:12 +0700 Subject: [PATCH] fedora: version the compat Provides at COSMIC's version, not at ours `Provides: cosmic-comp = %{version}-%{release}` reads as the obvious thing to write and is wrong in a way that only shows up at the next boot. cosmic-greeter requires `cosmic-comp >= 1.5.0`. A Provides of 0.1.0 does not satisfy that, so dnf's resolution of `install hyprcosmic` is to remove cosmic-greeter -- which on a stock Fedora COSMIC is the display manager. The transaction succeeds, nothing warns, and the machine comes back to a text console. Verified against the installed set on a Fedora 44 COSMIC machine, where the same transaction removed cosmic-greeter (`>= 1.5.0`) and cosmic-config-fedora (`>= 1.0.0~alpha.3`) while leaving cosmic-workspaces alone. Workspaces depends on a bare `cosmic-comp` with no version, so it is the control: the Provides mechanism works, only the comparison was failing. Arch and Debian are not affected and are left alone. Arch's cosmic-greeter depends on a bare `cosmic-comp` with no constraint, so its provides at $pkgver resolves; Debian has no cosmic-comp package at all, so its Conflicts and Provides are precautionary and have nothing to compare against. Separately, and not a packaging matter: cosmic-session is listed in /etc/dnf/protected.d/fedora-cosmic.conf on a Fedora COSMIC install. Protected packages are locked in the solver, so the transaction is unsolvable and --allowerasing has no effect on it. Installing over a stock COSMIC needs `--setopt=protected_packages=` on the command line. That is the distribution declining to let its desktop be removed by accident, which is reasonable, and overriding it is the operator's call to make explicitly. --- packaging/fedora/hyprcosmic.spec | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/packaging/fedora/hyprcosmic.spec b/packaging/fedora/hyprcosmic.spec index 6905805..5e99675 100644 --- a/packaging/fedora/hyprcosmic.spec +++ b/packaging/fedora/hyprcosmic.spec @@ -59,8 +59,20 @@ Conflicts: cosmic-comp Conflicts: cosmic-session # What it stands in for, so anything depending on a COSMIC session is satisfied. -Provides: cosmic-comp = %{version}-%{release} -Provides: cosmic-session = %{version}-%{release} +# +# Versioned at the COSMIC release this fork stands in for, not at this package's +# own version, and that distinction is the whole point. cosmic-greeter requires +# `cosmic-comp >= 1.5.0`; a Provides of 0.1.0 does not satisfy it, so dnf +# resolves the swap by removing the greeter -- which on a stock Fedora COSMIC is +# the display manager, and the machine comes back to a text console. The failure +# is silent, in that the transaction succeeds and you find out at the next boot. +# +# Bump this when rebasing on a newer COSMIC. It has to be at least the version +# the target distribution ships, because the packages that stay behind pin it. +%global cosmic_compat_version 1.5.0 + +Provides: cosmic-comp = %{cosmic_compat_version} +Provides: cosmic-session = %{cosmic_compat_version} # The HyDE shell. These are separate programs this fork drives rather than # builds, and without them the session starts to a blank screen with no bar and