diff --git a/docs/skills/index.json b/docs/skills/index.json index 93d6db3e7..0770b9509 100644 --- a/docs/skills/index.json +++ b/docs/skills/index.json @@ -1,5 +1,5 @@ { - "generated_at": "2026-09-19", + "generated_at": "2026-09-20", "schema_version": "1.0", "skills": [ { @@ -125,7 +125,7 @@ ], "description": "Bluefin parity contract: verbatim bluefin.toml, utah.toml overlay, [unavailable] rules, repository policy. Use when adding, removing, or debugging packages or parity/check-repos failures.", "version": "1.0", - "last_updated": "2026-09-18", + "last_updated": "2026-09-20", "doc_type": "policy" }, { diff --git a/docs/skills/index.md b/docs/skills/index.md index d3800c2cb..d2c0e44ba 100644 --- a/docs/skills/index.md +++ b/docs/skills/index.md @@ -3,7 +3,7 @@ This file is a human-readable mirror of `index.json`. Both are generated by `scripts/generate_skill_index.py` — do not hand-edit either file. -Generated: 2026-09-19 · schema 1.0 · 8 skills +Generated: 2026-09-20 · schema 1.0 · 8 skills | id | category | status | one-line purpose | |---|---|---|---| diff --git a/docs/skills/package-contract.md b/docs/skills/package-contract.md index 02bd8957a..c26c2da51 100644 --- a/docs/skills/package-contract.md +++ b/docs/skills/package-contract.md @@ -1,7 +1,7 @@ --- name: package-contract version: "1.0" -last_updated: "2026-09-18" +last_updated: "2026-09-20" id: package-contract one_line_purpose: Maintain Bluefin package parity and Utah's overlay manifest. entry_point: docs/skills/package-contract.md @@ -91,7 +91,12 @@ annotation (either directly preceding or within the `[section]` header in ordered by priority (ascending), so rebuilds in `utah-packages` (`priority=1`) precede base Hummingbird packages (`priority=10`). Repositories without this marker (such as `nvidia-container-toolkit` or builder-only `fedora-44`) are excluded from -the desktop package transaction. +the desktop package transaction. `packages/nvidia-container.repo` additionally ships +`enabled=0` in every flavor's image, main included — only +`scripts/install-nvidia.sh`, which runs exclusively on the `nvidia`/`nvidia-gaming` +flavors, enables it, and only for the one `dnf install nvidia-container-toolkit` +transaction (`--enablerepo=nvidia-container-toolkit`), so a non-NVIDIA image never +carries an enabled third-party repository (#169). The pinned package image is an RPM repository, not a runtime dependency: its contents are copied into the image so the package transaction is reproducible diff --git a/packages/nvidia-container.repo b/packages/nvidia-container.repo index 5bfa14f12..f6d2424e8 100644 --- a/packages/nvidia-container.repo +++ b/packages/nvidia-container.repo @@ -18,10 +18,21 @@ # the checksums of the packages. The key is pinned to NVIDIA CORPORATION # (Open Source Projects), fingerprint # C95B 321B 61E8 8C18 09C4 F759 DDCA E044 F796 ECB0. +# +# enabled=0: this file is copied into every flavor's /etc/yum.repos.d, not +# just the NVIDIA ones, and Utah's runtime repositories are Hummingbird plus +# the pinned utah-packages factory -- nothing else (see #169). Only +# install-nvidia.sh, which runs exclusively on the nvidia and nvidia-gaming +# flavors, enables it, scoping the enable to that one transaction with +# --enablerepo=nvidia-container-toolkit rather than flipping enabled= in the +# file. That is unlike utah-packages.repo, which starts enabled=1 and is +# flipped to enabled=0 by sed after the flavor step's last install (see +# Containerfile) -- this file is the first repo here to start disabled and +# be enabled per-transaction instead. [nvidia-container-toolkit] name=nvidia-container-toolkit baseurl=https://nvidia.github.io/libnvidia-container/stable/rpm/$basearch -enabled=1 +enabled=0 repo_gpgcheck=1 gpgcheck=0 gpgkey=https://nvidia.github.io/libnvidia-container/gpgkey diff --git a/scripts/install-nvidia.sh b/scripts/install-nvidia.sh index 8105eb393..6c56bc5f1 100755 --- a/scripts/install-nvidia.sh +++ b/scripts/install-nvidia.sh @@ -258,7 +258,10 @@ sh "$run_path" --silent --no-kernel-module --no-nouveau-check \ # bundle was one source, not the only one: NVIDIA publishes the toolkit itself, # from a path with no distribution version in it, and its dependencies are base # OS libraries Hummingbird already has. See packages/nvidia-container.repo. -"$DNF" -y install nvidia-container-toolkit +# The repository ships enabled=0 in every flavor, this one included, so it is +# never a runtime dependency for images that do not use it (#169); enable it +# only for this one transaction. +"$DNF" -y --enablerepo=nvidia-container-toolkit install nvidia-container-toolkit # /usr/lib/utah is created by install-ogc-kernel.sh, but that only runs on the # gaming flavors, so on plain nvidia nothing has made it yet. diff --git a/tests/test_package_resolution.py b/tests/test_package_resolution.py index 5aaf2d31f..80b509b45 100644 --- a/tests/test_package_resolution.py +++ b/tests/test_package_resolution.py @@ -254,6 +254,18 @@ def test_package_repository_file_is_enabled_only_during_the_build(self): self.assertIn("baseurl=file:///etc/utah-packages", text) self.assertIn("utah-packages", installer.REPOS) + def test_nvidia_container_repo_ships_disabled_and_is_scoped_to_install_nvidia(self): + # #169: the repository used to ship enabled=1 in every flavor's image, + # including non-NVIDIA ones, even though only install-nvidia.sh -- which + # runs exclusively on the nvidia/nvidia-gaming flavors -- installs + # anything from it. + repo = (ROOT / "packages/nvidia-container.repo").read_text() + self.assertIn("enabled=0", repo) + self.assertNotRegex(repo, r"(?m)^enabled=1$") + self.assertIn("repo_gpgcheck=1", repo) + script = (ROOT / "scripts/install-nvidia.sh").read_text() + self.assertIn("--enablerepo=nvidia-container-toolkit", script) + def test_hummingbird_packages_are_signature_checked(self): text = (ROOT / "packages/hummingbird.repo").read_text() self.assertIn("gpgcheck=1", text)