Skip to content

many: pass on install_langs to RPM - #1857

Merged
supakeen merged 3 commits into
osbuild:mainfrom
supakeen:train/rpm-install-langs
Sep 11, 2025
Merged

supakeen merged 3 commits into
osbuild:mainfrom
supakeen:train/rpm-install-langs

Conversation

@supakeen

Copy link
Copy Markdown
Member

In osbuild we have the capability to set the _install_langs macro in the stage options. This was never wired through into images. This PR wires it up into image_config so it can be set.

This saves about 90 MiB on a small installation I'm working on in my spare time.

@supakeen
supakeen requested a review from a team as a code owner September 11, 2025 07:00
The osbuild RPM stage allows defining `install_langs` but this is not
currently possible on the RPM stage wrapper in `images`. Let's add the
capability.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
Wire up the previously added new `InstallLangs` RPM stage option all the
way into the image config so it can be written there.

Signed-off-by: Simon de Vlieger <supakeen@redhat.com>

@mvo5 mvo5 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.

Thank you, this looks fine to me. But I would like to see a test for it too (see inline suggestion)


// InstallLangs determines which locales are installed by RPM, the default
// is `all`.
InstallLangs []string `yaml:"install_langs,omitempty"`

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.

(nitpick) just to double check the comment - the default is the empty string which means "all", right?

@supakeen supakeen Sep 11, 2025 •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The default is empty slice of strings which then doesn't get into the JSON which in the stage means don't set the macro at all which in RPM means it uses the default 'all'.

Comment thread pkg/manifest/os.go
lzap
lzap previously approved these changes Sep 11, 2025
Add a test case to ensure `InstallLangs` ends up in the appropriate
place in the RPM stage options.

Co-Authored-By: Michael Vogt <michael.vogt@gmail.com>
Signed-off-by: Simon de Vlieger <supakeen@redhat.com>
@supakeen

Copy link
Copy Markdown
Member Author

I've added the test case in a separate commit with the appropriate co-authored-by. This means this PR needs to be re-acked.

@supakeen
supakeen added this pull request to the merge queue Sep 11, 2025
Merged via the queue into osbuild:main with commit 4ac6849 Sep 11, 2025
25 checks passed
@supakeen
supakeen deleted the train/rpm-install-langs branch September 11, 2025 18:25
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.

4 participants