Skip to content

Conversation

@gjtorikian
Copy link

Hiya, I noticed that cross-compiling Ruby 4.0 gems fail when using rake-compiler-dock. A similar issue was filed here.

I believe that this is due to a GLIBC version mismatch. GitHub Actions runners now use Ubuntu 24.04, which has GLIBC 2.38. When gems with native extensions (like date or psych) are installed on the host before cross-compilation, they get compiled against GLIBC 2.38. When these gems are then used inside the rake-compiler-dock container, they fail to load:

  LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.38' not found
  (required by vendor/bundle/ruby/4.0.0/gems/date-3.5.1/lib/date_core.so)

Note that the base image in Dockerfile.jruby was updated recently, so I this this is in line with that change too.

@gjtorikian gjtorikian changed the title Update base image to Ubuntu 22.04 for GLIBC 2.38 compatibility with Ruby 4.0 Update base image to Ubuntu 24.04 for GLIBC 2.38 compatibility with Ruby 4.0 Jan 6, 2026
@larskanis
Copy link
Member

larskanis commented Jan 6, 2026

It should help to disable the bundler cache like so:

- name: Set up Ruby
        uses: ruby/setup-ruby@v1
        with:
          bundler-cache: false

Or use a different cache directory outside of the project tree.

The re-use of binaries from the host system in the docker container possibly works in case of the same operating system, but is not a supported use case in rake-compiler-dock. Even if we update the base system to Ubuntu-22.04, there can be the next gem that links to some newer functions of glibc, that is provided by Ubuntu-24.04 only. Then the re-use of host binaries is broken again. And it's broken at all, if host and container operating systems are too different.

So we can discuss to update the base image for some other reason, but the execution of host binaries within the docker image is not a valid use case.

@gjtorikian
Copy link
Author

Ok, fair enough. Feel free to close.

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