Inject required_rubygems_version >= 4.1.0.a into CA gems at build - #193
Conversation
137b0c2 to
ea51bda
Compare
|
There was a problem hiding this comment.
🟡 Changes recommended
Pessimistic constraints are mishandled around prerelease upper bounds, potentially broadening or making requirements unsatisfiable.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds a RubyGems version floor to Ruby ABI-scoped content-addressable gems.
Changes:
- Normalizes and propagates
required_rubygems_version. - Rejects incompatible constraints and warns about rewrites.
- Adds package and command-level tests.
File summaries
| File | Description |
|---|---|
lib/rubygems/package.rb |
Implements requirement normalization and validation. |
test/rubygems/test_gem_package.rb |
Tests metadata derivation and constraints. |
test/rubygems/test_gem_commands_build_command.rb |
Tests command-level conflict rejection. |
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
ea51bda to
c26c555
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Valid prerelease constraints are incorrectly rejected as conflicting with the declared minimum.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 2
- Review effort level: Balanced
c5cff18 to
35c6975
Compare
35c6975 to
5aba3e6
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Compound constraints capped at the version floor can produce an uninstallable gem instead of failing the build.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 3/3 changed files
- Comments generated: 1
- Review effort level: Balanced
c67ec4f to
9d0b03f
Compare
b0c2841 to
11503fc
Compare
Skinny gems built with --ruby-abi did not carry a required_rubygems_version constraint, so older RubyGems clients (4.0.x) could install them through the local path (gem install ./file.gem, vendor/cache, bundle install --local) with no warning. The content address was silently discarded and a gem scoped to one Ruby ABI would activate on an incompatible Ruby sharing that GEM_HOME. The remote path was safe only by accident: the version token parsed to platform=unknown which failed Gem::Platform.match_spec?. Now the protection is the one the RFC describes -- older clients reject the gem because their RubyGems version doesn't satisfy >= 4.1.0.a. Published artifacts are immutable, so any skinny gem released without this constraint stays visible to old clients permanently. Gem::Package.build now derives the required_rubygems_version for the built gem from the gemspec's own requirement: - unset requirements become >= 4.1.0.a - requirements that already satisfy that floor are left untouched - weaker requirements are rewritten to the floor plus any declared upper bounds and exclusions, with a warning since the built gem's metadata will differ from the gemspec - requirements that cap below the floor (e.g. < 4.0, ~> 3.5) raise at build time, since combined with the floor no RubyGems version could ever install the resulting gem As with required_ruby_version, the derived value is propagated back to the original spec only after a successful build. Assisted-By: devx/01a05e2e-d421-7e27-b54e-abee85203da5
11503fc to
a1abcc9
Compare
5f8c2b5
into
feature-branch-ca-changes-rubygems
Skinny gems built with --ruby-abi did not carry a
required_rubygems_versionconstraint, so older RubyGems clients (4.0.x) could install them through the local path (gem install ./file.gem, vendor/cache, bundle install --local) with no warning. The content address was silently discarded and a gem scoped to one Ruby ABI would activate on an incompatible Ruby sharing that GEM_HOME.Gem::Package.build now derives the required_rubygems_version for the built gem from the gemspec's own requirement:
As with required_ruby_version, the derived value is propagated back to the original spec only after a successful build.