Skip to content

[Content Addressable] Add CA Naming to the gem build Flow #9727

Description

@OughtPuts

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions