[Content Addressable] Update gem build flags to include --content-addressable when building a singe Ruby ABI gem - #9906
Open
OughtPuts wants to merge 1 commit into
Conversation
OughtPuts
force-pushed
the
ho/gem-build-content-addressable-flag
branch
from
September 24, 2026 14:58
7f978db to
30e07af
Compare
OughtPuts
force-pushed
the
ho/gem-build-content-addressable-flag
branch
from
September 24, 2026 15:28
30e07af to
09317f6
Compare
kou
approved these changes
Sep 25, 2026
kou
left a comment
Member
There was a problem hiding this comment.
+1
Could you check the CI failure?
…ntent addressable gem
OughtPuts
force-pushed
the
ho/gem-build-content-addressable-flag
branch
from
September 25, 2026 08:16
09317f6 to
fc6f026
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
#9899
TLDR
Removes the responsibility of building a content addressable gem out of the
--ruby-abi X.Yflag and into a new separate flag,--content-addressable.Description
This PR:
--content-addressableflag option toBuildCommand--ruby-abioption inBuildCommandbut this command is now only responsible for setting a ruby ABI at build time (instead of in the spec). All help text is rewritten to reflect this.ruby_abiis no longer passed through toGem::Package.build- the final argument is now a boolean representing whether or not--content-addressableis provided.--content-addressableis passed.ruby_abi_compatible?method inGem::ContentAddressis now no longer used (we useGem::ContentAddress.eligible?instead so this has been removed).Gem::Package.buildcallsites were adjusted, e.g.builders.rbandhelper.rb.Tests
Relevant functionality tests:
clean_spec,content_addressable_spec,test_gem_commands_build_command,test_gem_content_address,test_gem_package.Other test updates:
Dir[File.join(@tempdir, "platformed_gem-2-*.gem")].firstfromtest_content_addressable_produces_deterministic_content_addressas this was hiding a small bug. We should return the relevant Dir from the lamda from the build each time and not take the first matching directory of the set.Top Hatting:
The below has passed successfully for me locally ✅
From a local gem directory (but specifying the rubygems changes present on this branch) Build a gem using the content addressable flag e.g.
gem build --content-addressable. Confirm a content addressable gem is built e.g.ca_test-1.0.0-1234abcd.gem.Build a gem using the content addressable flag AND the ruby-abi flag because
required_ruby_versionis not present in the spec e.g.gem build --content-addressable --ruby-abi 4.0. Confirm a content addressable gem is built e.g.ca_test-2.0.0-1234abcd.gem. Confirm that the Ruby ABI version has been correctly set in the spec.Build a standard gem without either flag e.g.
gem build. Confirm that a gem is built e.g.ca_test-3.0.0.gem