Skip to content

Conversation

@Edouard-chin
Copy link
Member

Fix precompiled gem not working on a different linux machine:

  • I tried installing a gem precompiled on a CI machine in a completely different environment and the binary doesn't work.

    I have two different problems:

    1. Same as on MacOS where libruby.so is linked on a path that doesn't exist. I fixed the issue the same way as I did on MacOS but tweaked the logic to modify the makfile (the previous regex wouldn't work if -l$(LIBRUBYSO) was in between other flags).

    2. This one is more tricky and the solution is a bandaid. On ubuntu-24.04 (ubuntu-latest), the glibc version is 2.38, and it's relatively new. Any system using a older glibc version will not be able to use the precompiled binaries because glibc versions aren't backward compatible.

      In this commit, I modified the GitHub runner to use ubuntu 22.04, which has glibc to 2.35. This should allow slighltly older linux versions to install our precompiled gems.

      Ultimately, glibc 2.35 may still be too recent (released on 2022-02), and maybe a more acceptable version should be glibc 2.31 which was released in 2020. At least that's what Rake Compiler Dock uses and I haven't seen people complaining that they'd like the precompiled gems to support even older linux distro.

      We can't downgrade glibc to version 2.31, it will crash the CI machine. So I don't think we have any other way but to build a docker image and do the compilation in docker.

- I tried installing a gem precompiled on a CI machine in a completely
  different environment and the binary doesn't work.

  I have two different problems:

  1. Same as on MacOS where `libruby.so` is linked on a path that
     doesn't exist. I fixed the issue the same way as I did on MacOS
     but tweaked the logic to modify the makfile (the previous regex
     wouldn't work if `-l$(LIBRUBYSO)` was in between other flags).
  2. This one is more tricky and the solution is a bandaid. On
     ubuntu-24.04 (ubuntu-latest), the glibc version is 2.38, and it's
     relatively new. Any system using a older glibc version will not
     be able to use the precompiled binaries because glibc versions
     aren't backward compatible.

     In this commit, I modified the GitHub runner to use ubuntu 22.04,
     which has glibc to 2.35. This should allow slighltly older linux
     versions to install our precompiled gems.

     Ultimately, glibc 2.35 may still be too recent (released
     on 2022-02), and maybe a more acceptable version should be glibc
     2.31 which was released in 2020. At least that's what Rake
     Compiler Dock uses and I haven't seen people complaining that
     they'd like the precompiled gems to support even older linux
     distro.

     We can't downgrade glibc to version 2.31, it will crash the
     CI machine. So I don't think we have any other way but to build
     a docker image and do the compilation in docker.
@Edouard-chin Edouard-chin merged commit bca7651 into main Oct 30, 2025
20 checks passed
@Edouard-chin Edouard-chin deleted the ec-disable-librubyarg branch October 30, 2025 00:16
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.

1 participant