Project

General

Profile

Actions

Bug #21096

open

Ruby hangs up when compiling for bytecode on AArch64 emulated by QEMU

Added by midnight (Sarun R) 7 days ago. Updated 7 days ago.

Status:
Open
Assignee:
-
Target version:
-
ruby -v:
ruby 3.4.1 (2024-12-25 revision 48d4efcb85) +PRISM [x86_64-linux]
[ruby-core:120817]

Description

Hello,

We are experiencing issues when using Bootsnap for production container image building, specifically when running bundle exec bootsnap precompile --gemfile on an emulated ARM64 environment on AMD64 hosts.

Here are more details:

  • Bootsnap is a Ruby gem for bytecode caching, which speeds up loading times. It achieves this by calling RubyVM::InstructionSequence.compile_file and RubyVM::InstructionSequence.load_from_binary.
  • When running bundle exec bootsnap precompile --gemfile in the environment described (using QEMU to emulate the AArch64 instruction set), the process can compile and generate some bytecode but eventually hangs.
  • The hang seems random, occurring at different points during the process.
  • According to a Rails GitHub issue, the issue affects both Docker and containerd, as well as native Linux and macOS environments.
  • From a Bootsnap GitHub issue, the problem likely doesn't occur in Ruby 3.2.6 but appears in later versions.
  • So far, the common factors observed are:
    • Emulated ARM64 on AMD64 CPUs (likely using QEMU)
    • Newer Ruby versions (e.g., 3.3 and 3.4)

As a user, I don't have the expertise to debug the issue but am willing to gather more information if provided with sufficient instructions.

Actions

Also available in: Atom PDF

Like0
Like0Like0