Interest in supporting precompiled gems?
Hiya! I migrated an app from 3.3.1 to 3.4.5 and got blocked on psych, because of a missing yaml.h file.
I was wondering if you would support a PR to change CI to build the gems ahead of time, before pushing?
Basically, you set up your CI matrix for every platform you're interested in, then CI installs all the tools necessary to compile the extension. The compiled extension is packaged into one gem per platform, and then each platform version is pushed to Rubygems. The result is that every user automatically gets the correctly compiled gem for their specific platform--they don't need to build the gem themselves.
If a platform is not supported, a plain ruby version is pushed. This would run the compilation locally on the user's machine, just as it is done now.
I've done this for a bunch of projects and took the idea from Nokogiri. I do not mind at all doing the work necessary to get this working; the challenge is that, since this would run on GitHub Actions, and I don't have admin privileges, someone on the team would need to trigger the builds to test it out. I can do my best building locally with rake-compiler-dock, but inevitably there will be errors on the CI machine while working the flow out. There always are. 😆
Bumping for interest. This would make installation of the gem drastically simpler and less prone to error.
I'm interested, but the issue isn't organized. I think we should follow the discussion at https://github.com/ruby/json/pull/907.
I'm not sure I should close this or not based on the referenced issue. Personally I would like to keep the conversation going, but I'm just proposing a contribution, I am not the maintainer here.
From the json gem issue, the two issues I see coming out of that thread are:
- resulting gem size is too big...but it seems that the 7MB comes from improperly packaging the gem
- the technique is untested and shouldn't be tried out on json, psych, etc...but nokogiri and grpc each have hundreds of millions of downloads using this fat gem technique and they have no reported problems
I would love to work on a path forward here but I don't know what shape that would look like. Where can a centralized discussion of the pros and cons to the idea—not even necessarily the implementation—be had?
I would love to work on a path forward here but I don't know what shape that would look like. Where can a centralized discussion of the pros and cons to the idea—not even necessarily the implementation—be had?
I think @kou may open a ticket on the RubyGems tracker. AFAICT, people seem in agreement that we should be shipping binary gems and really the sticking point is the implementation 😅
Ok, in that case I think this can be closed ✌️