Skip to content

many: cross-arch bootstrapping from packages (HMS-11277) - #2676

Merged
supakeen merged 5 commits into
osbuild:mainfrom
supakeen:bootstrap-from-packages
Sep 14, 2026
Merged

supakeen merged 5 commits into
osbuild:mainfrom
supakeen:bootstrap-from-packages

Conversation

@supakeen

Copy link
Copy Markdown
Member

Historically we've used pre-built containers for cross-arch bootstrapping. This PR allows for cross-arch bootstrapping through RPMs instead. When a distribution definitions defines a set of packages for a given arch it is preferred over the container.

Initially this only swaps over the riscv64 bootstrap as they're the most problematic and a good area to test this. If you want to test properly it's best to rebase this PR on top of #2614a and cross-building an everything-network-installer for example.

We recently grew support for passing on ignore arch to the RPM stage;
this allows RPM to ignore the architecture when installing an RPM.

Signed-off-by: Simon de Vlieger <[email protected]>
Make it possible to set ignorearch on the buildroot pipeline generator.

Signed-off-by: Simon de Vlieger <[email protected]>
Instead of bootstrapping from a pre-built container allow bootstrapping
from RPMs. This uses the recently added ignorearch option from our
osbuild stage.

*If* a distribution defines packages for an architecture then it is
preferred over using containers.

Signed-off-by: Simon de Vlieger <[email protected]>
The `manifest` subcommand didn't pass on bootstrap if needed so it
didn't honor `--arch` correctly when bootstraps *were* being used. This
is probably debatable (do we want bootstraps in the manifest
subcommand?).

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen
supakeen requested a review from a team as a code owner September 10, 2026 08:31
Instead of pulling a container that is no longer under our control build
the buildroot cross-arch with the RPM stage.

Signed-off-by: Simon de Vlieger <[email protected]>
@supakeen
supakeen force-pushed the bootstrap-from-packages branch from e1e3be9 to 9066e73 Compare September 10, 2026 08:49
@achilleas-k

Copy link
Copy Markdown
Member

This is probably debatable (do we want bootstraps in the manifest subcommand?).

Yes. In my mind, image-builder manifest should create the same manifest that is created for the same set of options for image-builder build. Which does raise an interesting discussion topic here: image-builder manifest --arch <not host arch> ... doesn't require anything special. The manifest can be generated for any architecture from any architecture. But image-builder build --arch <not host arch> ... requires an extra pipeline. So how do we reconcile this?

My first instinct is to make things explicit. In this case that means that calling build with a foreign arch fails unless another option is provided to explicitly turn on the cross-arch bootstrap pipeline. That same option generates the same manifest when added to the manifest subcommand.

This is less helpful than the alternative though, which is implicitly generating the correct manifest and building it when calling build with a foreign arch. I kinda like the convenience of this, the way it does the right thing for the user without them needing to know the details or internals. But I think I prefer the explicit control over this.

@supakeen What do you think?

@achilleas-k

achilleas-k commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

The more I think about it, the more I prefer the explicit option. I think on principle image-builder build <stuff> should be as close as possible to image-builder manifest <same stuff> | osbuild <export options> -.

@supakeen

Copy link
Copy Markdown
Member Author

I'm not sure; either one is fine with me but now adding an additional argument to say 'no actually generate a cross-arch' manifest is bound to break some pipelines. I guess the support is experimental.

@achilleas-k

achilleas-k commented Sep 10, 2026 •

Copy link
Copy Markdown
Member

is bound to break some pipelines

How? I assume there's some decision point somewhere that chooses to add a cross-arch pipeline or not and instead of making it implicit on the host-vs-target arch mismatch we make it explicit on a CLI option.

If that decision is being made in multiple places, we should fix that.

@supakeen

Copy link
Copy Markdown
Member Author

is bound to break some pipelines

How? I assume there's some decision point somewhere that chooses to add a cross-arch pipeline or not and instead of making it implicit on the host-vs-target arch mismatch we make it explicit on a CLI option.

If that decision is being made in multiple places, we should fix that.

The more I think about it, the more I prefer the explicit option. I think on principle image-builder build should be as close as possible to image-builder manifest | osbuild -.

How I'm reading this is that image-builder build --arch ... will no longer work unless an additional option is passed? Hence if someone is currently using image-builder build --arch ... somewhere they would need to adjust to pass this additional option; or does automatically injecting the cross-arch pipeline when using build fall in the "as close as possible" part? :)

@achilleas-k achilleas-k left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! LGTM

@achilleas-k

Copy link
Copy Markdown
Member

is bound to break some pipelines

How? I assume there's some decision point somewhere that chooses to add a cross-arch pipeline or not and instead of making it implicit on the host-vs-target arch mismatch we make it explicit on a CLI option.
If that decision is being made in multiple places, we should fix that.

The more I think about it, the more I prefer the explicit option. I think on principle image-builder build should be as close as possible to image-builder manifest | osbuild -.

How I'm reading this is that image-builder build --arch ... will no longer work unless an additional option is passed? Hence if someone is currently using image-builder build --arch ... somewhere they would need to adjust to pass this additional option; or does automatically injecting the cross-arch pipeline when using build fall in the "as close as possible" part? :)

We had a call and decided that the manifest subcommand will include the cross-arch parts (either container or packages) when needed and in a follow-up we will add a special option for the manifest subcommand to generate manifests for a target architecture without the cross-arch bootstrap parts.

@supakeen
supakeen added this pull request to the merge queue Sep 14, 2026
Merged via the queue into osbuild:main with commit bfe3168 Sep 14, 2026
54 checks passed
@supakeen
supakeen deleted the bootstrap-from-packages branch September 14, 2026 14:54
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