Skip to content

Add better arch support + support ARM runners#178

Open
bleggett wants to merge 1 commit into
mainfrom
bleggett/add-arm-runners
Open

Add better arch support + support ARM runners#178
bleggett wants to merge 1 commit into
mainfrom
bleggett/add-arm-runners

Conversation

@bleggett
Copy link
Copy Markdown
Contributor

@bleggett bleggett commented May 11, 2026

  • Adds flavor-level arch overrides, so specific flavors can build with unique arch combos (e.g. zone-nvidiagpu = x86_64 only, zone= x86_64 + aarch64, etc)
  • Prefer GH-supplied ARM runners for ARM kernel builds, instead of QEMU+edera-large crosscomp (experiment to see if this is actually faster - EDIT: as seen in CI it's equivalent to a coldcache build on edera-large, good enough)
  • Add arch to the matrix buildscript args: ./hack/build/docker-build.sh "only-latest-lts:flavor=zone;arch=aarch64"
  • by default, build only zone (standard) kernel for both x86_64 and aarch64, so we don't have to choose between cross-building everything or nothing, and can be selective about it.

@bleggett bleggett requested review from azenla, kaniini and tycho as code owners May 11, 2026 17:25
@bleggett bleggett changed the title WIP: Add better arch support + support ARM runners Add better arch support + support ARM runners May 11, 2026
@bleggett bleggett enabled auto-merge (squash) May 11, 2026 18:22
Copy link
Copy Markdown
Contributor

@sveith sveith left a comment

Choose a reason for hiding this comment

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

Thank you for taking care of implementing the aarch64 builds.

I have some minor suggestions around the way shell escaping is done in this area of the code.

Comment on lines +31 to +32
def quoted(text: str) -> str:
return '"%s"' % text
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.

For the purpose of shell-safe quoting, please use the builtin shlex.quote() method rather than creating one here.

Comment on lines +409 to +414
archs_env = os.getenv("KERNEL_ARCHITECTURES", "")
arch_env = os.getenv("KERNEL_ARCH", "")
if archs_env:
root_kernel_archs = [a.strip() for a in archs_env.split(",") if a.strip()]
elif arch_env:
root_kernel_archs = [arch_env.strip()]
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.

I'm not fully convinced that the convenience of using KERNEL_ARCH=aarch64 over KERNEL_ARCHITECTURES=aarch64 is worth the additional logic; not blocking though.

quoted(
'%s@$(cat "image-id-%s-%s-%s")' % (tag, tag_version, flavor, actual_target)
),
quoted('%s@$(cat "%s")' % (tagged, iidfile)),
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.

This is not strictly a new issue with the changes you are making, but I find the existing quoted() function misleading in this context: it does not quote its input in a way that prevents shell expansion (in fact, it looks like we deliberately want shell expansion here since we are doing code generation), and it is also not suitable for nesting.

This expression should be shlex.quote(tagged) + '@"$(cat %s)"' % shlex.quote(iidfile)

if is_publish_enabled():
# Start fresh so a re-run within the same workspace doesn't pick up
# digests from a previous (failed) invocation.
lines += ['rm -f "%s"' % DIGESTS_FILE]
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.

If we're using quoted() or shlex.quote() elsewhere in this script, we should be doing so here as well (preferably the latter function).

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