Skip to content

Conversation

@kylewlacy
Copy link
Member

This PR updates all packages plus the GitHub Actions "Build" workflow to support building for aarch64-linux.

To start, there's a new std.CURRENT_PLATFORM const which uses the new JS op from brioche-dev/brioche#260.

std.toolchain also took a bit of iteration (building off some old work in 42b098c). But the changes there are mostly "boring", and mostly come down to using the right target triple or dynamic linker path based on platform. I updated the runtime utils to the latest commit used across std.

Once the toolchain was working, most packages built fine for aarch64 without any extra changes! There were a handful of exceptions though, and the following packages were tweaked:

  • bugstalker: Doesn't support aarch64 at all today (it's marketed as an x86-64 debugger). I added an assertion to prevent building it plus a "magic comment" to skip it in the build workflow.
  • go, rust, nodejs: Use pre-built artifacts, so needed adjustment to download the aarch64 versions of each.
  • gitui, xplr: Removed upstream-provided .cargo/config.toml. These were overriding the aarch64 linker, which I'm guessing was set up for cross-compilation in CI? Anyway, just removing the file from the source fixed the build.
  • linux: Required python as a dependency when building for aarch64 with the default configuration. Not sure why... but I added python as a dependency (regardless of platform) to fix it.
  • llvm: Required more RAM to build than was available on our aarch64 runner (M1 Mac mini running Asahi Linux). As a quick hack, I just tweaked the parallelism based on platform.
  • proot, strace: Had issues around 32-bit ARM personalities, so I adjusted their builds for now. We should fix this in the future.

Finally, I updated the CI/CD pipeline for aarch64 using a custom runner (M1 Mac mini with Asahi Linux). It's a lot slower than our custom x86-64 runner, so I also had to bump up the timeout for the "build" CI/CD pipeline: a full rebuild appears to take ~16 hours on aarch64 compared to ~8 hours for x86-64, and I set the new timeout to 24 hours to give some overhead.

I also updated the CI/CD pipeline to skip packages based on a "magic comment": if a package contains the string @brioche-packages skip-platform aarch64-linux it'll be skipped on aarch64 (also works to skip a package for x86-64). This is currently only used by bugstalker, since the upstream project doesn't support it (and would take a significant lift to add support, since it's a debugger and therefore deals with architecture-specific details)

@kylewlacy kylewlacy requested a review from jaudiger June 23, 2025 03:12
Copy link
Contributor

@jaudiger jaudiger left a comment

Choose a reason for hiding this comment

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

A really nice move in the right direction ! I'm so excited to see where we are now and what we can achieve in the future 😁 So far so good, I rebuilt a few things locally and packages a few packages and I saw no bugs. Once this PR is merged during the weekend, we should open issues to track the remaining works to do.

This is intended to be used as a check requirement for PRs, similar to
the "All tests passed" job from the main Brioche repo
@kylewlacy kylewlacy merged commit 0c3655b into main Jun 28, 2025
3 checks passed
@kylewlacy kylewlacy deleted the add-support-for-aarch64-linux branch June 28, 2025 08:53
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.

3 participants