RubyGems needs to build platform gems scoped to a single Ruby ABI without different ABI builds colliding on the same <name>-<version>-<platform>.gem filename.
Covered in this PR:
gem build produces <name>-<version>-<sha>.gem for skinny gems. The gem is built in memory, the content address is computed from the bytes, and the file is written in a single pass. Fat/source builds are unchanged.
--ruby-abi selector lets a maintainer request a skinny build explicitly. If it conflicts with required_ruby_version the client raises; if required_ruby_version is absent the appropriate ~> value is added.
Still to be decided on:
- Detect skinny gems — recognize a platformed gem pinned to a single ABI (both ~> X.Y.Z and rake-compiler's >= X.Y, < X.(Y+1).dev). HSBT suggested we should require maintainers to pass in
--ruby_abi and not default to skinny if the required_ruby_version suggests it. It has been coded like this in the PR but unclear if we have community agreement on this design (?)
- In this closed PR, copilot raised the performance tradeoff of building a gem in memory. We need to benchmark the largest platformed gem we have on RG.o and see what the build time would be for a Tempfile vs io.string to see what we would be gaining as a tradeoff for the extra complexity around a Tempfile.
RubyGems needs to build platform gems scoped to a single Ruby ABI without different ABI builds colliding on the same
<name>-<version>-<platform>.gem filename.Covered in this PR:
gem buildproduces<name>-<version>-<sha>.gemfor skinny gems. The gem is built in memory, the content address is computed from the bytes, and the file is written in a single pass. Fat/source builds are unchanged.--ruby-abiselector lets a maintainer request a skinny build explicitly. If it conflicts withrequired_ruby_versionthe client raises; ifrequired_ruby_versionis absent the appropriate~>value is added.Still to be decided on:
--ruby_abiand not default to skinny if therequired_ruby_versionsuggests it. It has been coded like this in the PR but unclear if we have community agreement on this design (?)