Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/skills/package-contract.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ policy for changing them.
- `[gnome]` — GNOME 51 desktop contract Hummingbird does not ship.
- `[build]` — toolchain needed to build the pinned GNOME extensions
(`scripts/build-gnome-extensions.sh`).
- `[parity]` — what Bluefin inherits from Fedora's base image and Hummingbird
has in its repository but not in its bootable base; CI's package
availability step resolves the real transaction and is the gate on every
name there.
- `[services]` — desktop services Bluefin adds on top of the server base.
- `[unavailable]` — Bluefin contract packages none of Utah's repositories
provide.
Expand Down
70 changes: 70 additions & 0 deletions packages/utah.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#
# Sections:
# [gnome] GNOME 51 desktop contract Hummingbird does not ship
# [parity] what Bluefin gets from Fedora's base image and Hummingbird has
# [build] toolchain needed to build the pinned GNOME extensions
# [unavailable] Bluefin contract packages none of Utah's repositories provide
#
Expand Down Expand Up @@ -59,6 +60,75 @@ packages = [
"glibc-all-langpacks",
]

[parity]
# Packages Bluefin's image carries without naming them in bluefin.toml, because
# Fedora's Silverblue base supplies them, and which Hummingbird's repository
# has but its server-shaped bootable base leaves out. Measured, not guessed:
# the image-level parity report (#117, scripts/check-image-parity.py) listed
# 277 such names against public-hummingbird-x86_64-rpms. CI's "Check package
# availability" step resolves the real transaction against the pinned images,
# and is the gate on every name here; a first-level Requires check is not
# enough, as the three ModemManager-shaped exclusions below proved.
# Aligned with Dakota where it ships the same piece: the connectivity check,
# ALSA use-case profiles, the language pack and the core font set.
#
# Left out, with the dependency the pinned repositories do not carry:
# NetworkManager-wwan requires ModemManager, whose factory build
# needs libmbim, libqmi and libqrtr-glib that
# nothing provides -- a factory gap
# NetworkManager-bluetooth requires libnm-wwan.so from the wwan plugin,
# so it falls with it
# poppler-utils Hummingbird's poppler requires poppler-data,
# which Hummingbird does not ship
# cups, cups-client need cups-filters (utah-packages#144)
# vim-enhanced needs libgpm.so.2 (vim-minimal is in the base)
# default-fonts-core-emoji needs google-noto-emoji-color-fonts
# default-fonts-core-math needs stix-fonts (both utah-packages#147)
# fprintd, fprintd-pam in no repository (utah-packages#145)
# alsa-utils in no repository (utah-packages#146)
#
# NetworkManager-wifi is deliberately not here yet: its supplicant and the
# regulatory database are being built by utah-packages#133, and it joins this
# list when the factory image that carries them is pinned (#126).
#
# unzip is also in [build]; it is listed here because configure-services.sh
# removes the build tooling after the extension build, and Bluefin ships
# unzip to users. The removal line skips it for that reason.
packages = [
# Networking
"NetworkManager-config-connectivity-fedora",
"bind-utils",
"iptables-nft",
# Audio
"alsa-ucm",
# Locale and fonts
"langpacks-en",
"langpacks-fonts-en",
"abattis-cantarell-fonts",
"default-fonts-core-sans",
"default-fonts-core-serif",
"default-fonts-core-mono",
"google-noto-sans-mono-vf-fonts",
"google-noto-serif-vf-fonts",
"google-noto-sans-symbols-2-fonts",
"google-noto-sans-math-fonts",
# Shell and tooling Bluefin users reach for
"bash-completion",
"man-db",
"less",
"which",
"file",
"hostname",
"xxd",
"unzip",
"zip",
"dbus-tools",
"keyutils",
"crypto-policies-scripts",
"python3-pip",
"systemd-container",
]

[build]
# Build dependencies for scripts/build-gnome-extensions.sh.
#
Expand Down
5 changes: 3 additions & 2 deletions scripts/configure-services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ sed -i 's|uupd|& --disable-module-distrobox|' /usr/lib/systemd/system/uupd.servi
sed -i 's@^PrivateTmp=.*@PrivateTmp=no@' /usr/lib/systemd/system/systemd-resolved.service
rm -rf /tmp/uupd

# Build-only extension tooling is not part of the desktop image.
# Build-only extension tooling is not part of the desktop image. unzip stays:
# it is in [parity] as well as [build], because Bluefin ships it to users.
DNF="$(command -v dnf5 || command -v dnf)"
"$DNF" -y remove --no-autoremove dbus-devel glib2-devel meson sassc unzip
"$DNF" -y remove --no-autoremove dbus-devel glib2-devel meson sassc

echo "Utah desktop service configuration complete"
3 changes: 3 additions & 0 deletions scripts/install-packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def contract(base: Path, overlay: Path, major: str | None) -> list[str]:
if major:
packages += section(base, f"fedora_v{major}")
packages += section(overlay, "gnome")
# Parity with what Bluefin inherits from Fedora's base image and Hummingbird
# has in its repository but not in its bootable base.
packages += section(overlay, "parity")
# Service packages are part of the desktop contract as well: 40-services.sh
# cannot enable what the server base never installed.
packages += section(overlay, "services")
Expand Down
9 changes: 7 additions & 2 deletions scripts/verify-rpm-contract.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,24 @@ def main() -> int:
if resolved.exists():
contract = [line for line in resolved.read_text().split() if line]
gnome_names = set(section(overlay, "gnome"))
parity_names = set(section(overlay, "parity"))
service_names = set(section(overlay, "services"))
bluefin = [p for p in contract if p not in gnome_names and p not in service_names]
overlay_names = gnome_names | parity_names | service_names
bluefin = [p for p in contract if p not in overlay_names]
gnome = [p for p in contract if p in gnome_names]
parity = [p for p in contract if p in parity_names]
services = [p for p in contract if p in service_names]
else:
bluefin = [p for p in section(args.manifest, "fedora") if p not in unavailable]
gnome = section(overlay, "gnome")
parity = section(overlay, "parity")
services = section(overlay, "services")
nvidia = list(NVIDIA_PACKAGES) if "nvidia" in flavor else []
expected = [*bluefin, *gnome, *services, *nvidia]
expected = [*bluefin, *gnome, *parity, *services, *nvidia]

print(
f"Verifying {len(bluefin)} Bluefin packages, {len(gnome)} GNOME desktop packages,"
f" {len(parity)} parity packages,"
f" {len(services)} desktop service packages, and {len(nvidia)} NVIDIA packages",
flush=True,
)
Expand Down
37 changes: 36 additions & 1 deletion tests/test_package_resolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ def resolve(self, output, code=1):
base.write_text('[fedora]\npackages=["base", "unavailable"]\n'
'[fedora_v44]\npackages=["release-specific"]\n')
overlay.write_text('[gnome]\npackages=["shell"]\n'
'[parity]\npackages=["manpages"]\n'
'[services]\npackages=["resolver"]\n'
'[build]\npackages=["compiler"]\n'
'[unavailable]\npackages=["unavailable"]\n')
Expand All @@ -92,7 +93,8 @@ def test_valid_declined_transaction_includes_every_install_section(self):
rc, command = self.resolve("Transaction Summary:\nInstall 12 Packages\nOperation aborted.\n")
self.assertEqual(rc, 0)
self.assertEqual(command[command.index("install") + 1:],
["base", "release-specific", "shell", "resolver", "compiler"])
["base", "release-specific", "shell", "manpages", "resolver",
"compiler"])
self.assertIn("--assumeno", command)
self.assertIn("--disablerepo=*", command)
for repo in installer.REPOS:
Expand Down Expand Up @@ -125,5 +127,38 @@ def test_pins_come_from_containerfile(self):
checker.pinned_inputs(path)


class ParityContractTests(unittest.TestCase):
OVERLAY = ROOT / "packages/utah.toml"

def test_parity_section_reaches_the_install_set(self):
contract = installer.contract(ROOT / "packages/bluefin.toml", self.OVERLAY, "44")
for pkg in installer.section(self.OVERLAY, "parity"):
with self.subTest(package=pkg):
self.assertIn(pkg, contract)

def test_parity_section_duplicates_nothing_but_the_build_tooling_it_keeps(self):
# A name both in [parity] and in bluefin.toml or another overlay section
# is a duplicate claim the verifier rejects. unzip is the one deliberate
# overlap with [build]: configure-services.sh removes the build tooling
# after the extension build and has to keep unzip for the same reason
# it is listed here.
parity = installer.section(self.OVERLAY, "parity")
self.assertEqual(len(set(parity)), len(parity))
others = set(installer.section(ROOT / "packages/bluefin.toml", "fedora"))
for name in ("gnome", "services", "unavailable"):
others |= set(installer.section(self.OVERLAY, name))
self.assertEqual(sorted(set(parity) & others), [])
self.assertEqual(sorted(set(parity) & set(installer.section(self.OVERLAY, "build"))), ["unzip"])
removal = [line for line in (ROOT / "scripts/configure-services.sh").read_text().splitlines()
if "remove --no-autoremove" in line]
self.assertEqual(len(removal), 1)
self.assertNotIn("unzip", removal[0])

def test_verifier_asserts_the_parity_section(self):
source = (ROOT / "scripts/verify-rpm-contract.py").read_text()
self.assertIn('parity = section(overlay, "parity")', source)
self.assertIn("*parity,", source)


if __name__ == "__main__":
unittest.main()
Loading