Skip to content

[Content Addressable] Add support for Packaging Single-ABI Gems - #62

Draft
OughtPuts wants to merge 1 commit into
mainfrom
ho/build-skinny-ca-gems
Draft

[Content Addressable] Add support for Packaging Single-ABI Gems#62
OughtPuts wants to merge 1 commit into
mainfrom
ho/build-skinny-ca-gems

Conversation

@OughtPuts

Copy link
Copy Markdown

TL;DR

This PR adds support to cibuildgem for the building of gems that contain a single-Ruby-ABI-supporting binary.

Summary

This PR follows the rubygems changes which support the lifecycle of lightweight content addressable gems that support only one Ruby ABI. This PR introduces changes to Cibuildgem so we can use it to build a set of gems with binary support for an individual Ruby ABI, instead of building one gem that would contain binaries for multiple Ruby ABIs.

The PR introduces a --package-mode flag which can optionally be added to the package command, where the options passed can be either single-ABI or multi-ABI. It defaults to multi-ABI. When single-ABI is passed, we iterate over each ruby version, setting it as the ENV["RUBY_CC_VERSION"] before running all rake tasks.

Tests

Tests have been added to cli_test to cover the new behaviour

Tophatting

@OughtPuts
OughtPuts marked this pull request as draft September 1, 2026 16:23
@OughtPuts
OughtPuts requested a balanced review from Copilot September 1, 2026 16:23

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.

Comment thread lib/cibuildgem/cli.rb Outdated
Comment on lines +51 to +54
if options["package-mode"] == "single-ABI"
compilation_task.ruby_versions.each do |ruby_version|
ENV["RUBY_CC_VERSION"] = ruby_version.to_s
run_rake_tasks!("cibuildgem:setup", :cross, :native, :gem)
Comment thread lib/cibuildgem/cli.rb Outdated
cibuildgem will create one gem per Ruby version supported by the gem.
MSG
method_option "gemspec", type: "string", required: false, desc: "The gemspec to use. Defaults to the gemspec from the current working directory."
method_option "package-mode", type: "string", required: false, desc: "The package mode to use when compiling multi-ABI or single-ABI gems. Defaults to multi-ABI."
Comment thread test/cli_test.rb
assert_predicate($CHILD_STATUS, :success?)
end

def test_package_single_abi_runs_rake_tasks_for_each_ruby_version
@OughtPuts
OughtPuts force-pushed the ho/build-skinny-ca-gems branch from 89aab5c to 1bf41d9 Compare September 9, 2026 16:27
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.

2 participants