Skip to content

Support ruby 4.0 - #12

Merged
kzaitsev merged 1 commit into
serverscom:mainfrom
scd-yuso:feature/ruby-4.0-support
Aug 12, 2026
Merged

Support ruby 4.0#12
kzaitsev merged 1 commit into
serverscom:mainfrom
scd-yuso:feature/ruby-4.0-support

Conversation

@scd-yuso

Copy link
Copy Markdown
Contributor

Summary

  • Bump gem version from 0.2.2 to 0.2.3
  • Add benchmark as an explicit Gemfile dependency (no longer a default gem as of Ruby 4.0, was breaking rubocop with a LoadError)
  • Verified ext/pgp_rb compiles and the full spec suite passes against Ruby 4.0.6 with existing rb-sys/magnus pins — no Cargo changes needed
  • Release workflow picks up Ruby 4.0 automatically from cache.ruby-lang.org's CI version feed once this is tagged, publishing precompiled binaries + a required_ruby_version upper bound that covers it

Changed Files

  • lib/pgp-rb/version.rb — version bump 0.2.20.2.3
  • Gemfile — add benchmark dependency
  • Gemfile.lock — reflects new version and benchmark dependency

benchmark is no longer a default gem as of ruby 4.0, so rubocop
(and anything else that shells out to it) fails to load without it
being declared explicitly in the Gemfile, same as ostruct/base64
before it.

ext/pgp_rb already compiles and passes the full spec suite against
ruby 4.0.6 with the current rb-sys/magnus pins, so no Cargo changes
are needed. Bumping the gem version so a new tag triggers the
release workflow, which picks up ruby 4.0 automatically from
https://cache.ruby-lang.org/pub/misc/ci_versions/cruby.json and
publishes precompiled binaries + a required_ruby_version upper bound
that covers it.
@kzaitsev
kzaitsev merged commit 10cab50 into serverscom:main Aug 12, 2026
7 checks passed
kzaitsev pushed a commit that referenced this pull request Aug 12, 2026
0.2.3 (#12) added source-level ruby 4.0 support, but the precompiled
gems it published only ship a 3.4 binary (verified by downloading
the actual x86_64-linux gem and checking its spec). Root cause:
Gemfile.lock had rb_sys locked at 0.9.105, way older than even the
0.9.124 already pinned in Cargo.toml, and unrelated to the
rake-compiler-dock-image:1.12.0 tag the docker/Dockerfile.* files
already reference. The cross-gem release job reads the rb_sys
version straight out of Gemfile.lock to decide which
rake-compiler-dock image to use, so it silently built against an
image that predates ruby 4.0 (and 3.3) support and dropped both
from the fat gem instead of failing loudly.

Bumping rb_sys to 0.9.128 (latest, pulls in rake-compiler-dock
1.12.0, matching the Dockerfiles) and rb-sys to the same version in
Cargo.toml for consistency. Recompiled and ran the full spec suite
locally against ruby 4.0.6 - all green.
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