Skip to content

build: honor an explicitly empty pre-resolved set; refuse foreign-arc… - #2449

Merged
mattmoor merged 1 commit into
chainguard-dev:mainfrom
mattmoor:pre-resolved-followups
Aug 31, 2026
Merged

build: honor an explicitly empty pre-resolved set; refuse foreign-arc…#2449
mattmoor merged 1 commit into
chainguard-dev:mainfrom
mattmoor:pre-resolved-followups

Conversation

@mattmoor

Copy link
Copy Markdown
Member

…h contents

Two follow-ups to the pre-resolved install path (#2448):

An explicitly empty set fell through to the lockfile or FixateWorld branch, so WithPreResolvedPackages([]) — a promise to install precisely nothing without consulting an index — still resolved repositories and could fail offline. The option now distinguishes set-but-empty from unset (nil normalizes to empty; the options field documents nil as unset), and buildImage branches on presence rather than length. The test proves it by contradiction: against a repository that cannot satisfy anything, the control build fails to resolve and the empty-set build succeeds with zero packages installed.

A multi-arch build reuses one option set for every architecture context, so contents for the wrong architecture arrived at InstallPackageContents silently and installed foreign binaries without an error. The installer now refuses contents whose .PKGINFO architecture disagrees with the context (noarch and unstated architectures still install everywhere).

…h contents

Two follow-ups to the pre-resolved install path (chainguard-dev#2448):

An explicitly empty set fell through to the lockfile or FixateWorld
branch, so WithPreResolvedPackages([]) — a promise to install precisely
nothing without consulting an index — still resolved repositories and
could fail offline. The option now distinguishes set-but-empty from
unset (nil normalizes to empty; the options field documents nil as
unset), and buildImage branches on presence rather than length. The
test proves it by contradiction: against a repository that cannot
satisfy anything, the control build fails to resolve and the empty-set
build succeeds with zero packages installed.

A multi-arch build reuses one option set for every architecture
context, so contents for the wrong architecture arrived at
InstallPackageContents silently and installed foreign binaries without
an error. The installer now refuses contents whose .PKGINFO
architecture disagrees with the context (noarch and unstated
architectures still install everywhere).
@mattmoor
mattmoor requested a review from tcnghia August 31, 2026 17:17
@mattmoor
mattmoor merged commit eb2d36f into chainguard-dev:main Aug 31, 2026
23 checks passed
@mattmoor
mattmoor deleted the pre-resolved-followups branch August 31, 2026 17:36
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.

2 participants