Skip to content

Generate supplemental RPM packages#1147

Open
cpuguy83 wants to merge 8 commits into
subpackage-modelfrom
subpackage-rpm
Open

Generate supplemental RPM packages#1147
cpuguy83 wants to merge 8 commits into
subpackage-modelfrom
subpackage-rpm

Conversation

@cpuguy83

Copy link
Copy Markdown
Collaborator

Adds RPM subpackage sections, artifact selection, and scriptlets, with template and LLB-level coverage.

This is layer 2 of the native supplemental-packages stack and depends on #1146.

Related to #607.

@cpuguy83
cpuguy83 marked this pull request as ready for review July 16, 2026 21:45
Copilot AI review requested due to automatic review settings July 16, 2026 21:45

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds RPM generation for target-level supplemental packages sharing the primary build output.

Changes:

  • Generates RPM subpackage metadata, artifacts, dependencies, and scriptlets.
  • Refactors shared artifact installation and scriptlet generation.
  • Adds template and LLB-level tests.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
packaging/linux/rpm/template.go Generates supplemental RPM sections and artifacts.
packaging/linux/rpm/template_test.go Tests generated subpackage specifications.
packaging/linux/rpm/buildroot_test.go Tests generated RPM-spec LLB operations.

Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go
Comment thread packaging/linux/rpm/template.go Outdated
Comment thread packaging/linux/rpm/template.go
@cpuguy83
cpuguy83 force-pushed the subpackage-rpm branch 2 times, most recently from a194042 to 117864c Compare July 17, 2026 18:12
cpuguy83 added 7 commits July 17, 2026 12:13
Add SubPackages() method and supporting types to produce %package,
%description, %files, and scriptlet sections for each supplemental
package. Refactor Install() to include subpackage artifacts in the
shared %install section. Includes comprehensive template-level tests.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Test RPMSpec() at the LLB layer by marshaling the returned state,
extracting protobuf ops, and asserting on Mkdir/Mkfile actions. Covers
default and custom directory paths, subpackage sections with default
and custom names, dependencies, sorted ordering, install artifacts,
wrong-target exclusion, and invalid spec error handling.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Install only the primary RPM in default containers and apply package metadata, scriptlets, ownership, and artifact selection to the package that declares them. Strip disabling remains spec-wide because rpmbuild processes the shared buildroot as one unit.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Keep the shared buildroot strip setting controlled by the root package while preserving independent automatic dependency discovery for supplemental packages.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Use deterministic map iteration, derive ownership dependencies without rendering scripts, and keep test gateway doubles minimal.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Generate supplemental package sections directly from the shared target package sequence.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
Restore default containers to install every generated binary RPM and keep supplemental package integration coverage with the RPM implementation.

Signed-off-by: Brian Goff <cpuguy83@gmail.com>
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