Closed bgw closed 3 days ago
This stack of pull requests is managed by Graphite. Learn more about stacking.
Join @bgw and the rest of your teammates on Graphite
Commit: 7ab3d3aa6eae1c2e8bab6dc0bfc29874add02a5b
Commit: 7ab3d3aa6eae1c2e8bab6dc0bfc29874add02a5b
pnpm test-dev test/development/middleware-errors/index.test.ts
Read more about building and testing Next.js in contributing.md.
We either need GCC >= 4.9 or we need to link with libatomic: https://github.com/microsoft/mimalloc/issues/443
Unfortunately, manylinux2014-cross ships with GCC 4.8.5: https://github.com/rust-cross/manylinux-cross/blob/main/manylinux2014/aarch64/Dockerfile#L71
We already appear to override the compiler toolchain in CI for x86_64 to use clang (which is why mimalloc works there), so let's go ahead and do that here too. This at least means we're using the same compiler across both architectures.
I'm leaving the aarch64-musl codepath the same (using gcc) because (1) we don't use mimalloc there yet and (2) it's a bit harder for me to test as thoroughly.
Testing
Local Compilation
Run bash inside the docker image (I also had to install rosetta2 inside my Linux VM, as this is an x86_64 image used for cross-compilation to aarch64):
Run the build locally:
Sanity check that the result is an aarch64 binary
Verifying the binary works
Copy the next-swc binary into a copy of shadcn-ui I have sitting around:
and then try running the dev server and loading pages from it in the browser:
In CI
https://github.com/vercel/next.js/actions/runs/9523143080/job/26254016137