Fix precompiled gem not working on a different linux machine: #17
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
Same as on MacOS where
libruby.sois 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).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.