mattwise
mattwise

Reputation: 1506

Failed to build native gem extensions on Ubuntu 24.04 emulating arm64 with QEMU in Github Actions: gcc segfault

I am building a Ruby on Rails project into docker images with GitHub Actions: https://github.com/havenweb/haven/blob/master/.github/workflows/docker-image.yml

This has worked great for a while, but on my most recent change, it now consistently fails to build. It seems to be failing to build gem native extensions. My setup builds on both linux/amd64 and linux/arm64, using QEMU. The failure is only on linux/arm64, and it started when ubuntu-latest started pointing to 24.04 instead of 22.04.

Failed run: https://github.com/havenweb/haven/actions/runs/13115117753/job/36587454025

Operating System
  Ubuntu
  24.04.1
  LTS
...
#22 [linux/arm64  5/11] RUN bundle install
...
#22 603.4 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...
#22 603.4 gcc: internal compiler error: Segmentation fault signal terminated program cc1

Previous successful run: https://github.com/havenweb/haven/actions/runs/12591352634/job/35094343713

Operating System
  Ubuntu
  22.04.5
  LTS

Any ideas why GCC is seg-faulting when building on arm64 with Ubuntu 24.04 but not 22.04?

Note: Builds do succeed when I explicitly specify ubuntu-22.04 instead of ubuntu-latest: https://github.com/havenweb/haven/actions/runs/13116319349/job/36591411306

Edit: The initial failure was from the msgpack gem, I was able to remove that dependency, and then it failed on the pg gem. Both times the failure was the first native gem to be built so I don't think it is a gem-specific issue.

Upvotes: 0

Views: 92

Answers (0)

Related Questions