Skip to content

fix(ruby): make platform gems load on Linux and stop building source gem#18

Merged
johnpmitsch merged 7 commits into
mainfrom
jm/ruby_ci_fixes1
Apr 27, 2026
Merged

fix(ruby): make platform gems load on Linux and stop building source gem#18
johnpmitsch merged 7 commits into
mainfrom
jm/ruby_ci_fixes1

Conversation

@johnpmitsch

@johnpmitsch johnpmitsch commented Apr 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix the gemspec so release CI on Linux stops failing with ["lib/quicknode_sdk.bundle"] are not files — the base gemspec hardcoded a macOS-only filename.
  • Move the native artifact under lib/quicknode_sdk/ and require_relative "quicknode_sdk/quicknode_sdk" so Ruby's loader picks .bundle/.so automatically. Without this, the existing x86_64-linux and aarch64-linux platform gems would have hit LoadError at require time.
  • Stop building and publishing a source gem. It shipped no extconf.rb and no precompiled binary, so it installed but couldn't require. Per discussion, we'd rather users on platforms without a published gem get a clean RubyGems "no compatible platform" error than an installable-but-broken gem. Adding more platform targets is the path forward when demand appears.
  • Misc cleanup of stale path references in Justfile (macOS dist), release.yml (Linux build + comments), publish-rubygems.yml (3 gems instead of 4), scripts/build-platform-gem.rb (example), ruby/.solargraph.yml, and CLAUDE.md.
  • Drive-by: restore the release justfile recipe to take a version argument — the previous name had no parameter, which would have made the {{version}} substitutions silently empty.

Test Plan

  • cargo test -p quicknode-sdk --lib (182/182 pass)
  • cargo check && just lint clean
  • just ruby-buildruby/lib/quicknode_sdk/quicknode_sdk.bundle exists
  • ruby -Iruby/lib -rquicknode_sdk -e 'p QuicknodeSdk::SDK; p QuicknodeSdk::Admin; p QuicknodeSdk::Streams; p QuicknodeSdk::Webhooks; p QuicknodeSdk::KvStore' resolves all clients with no LoadError
  • Local arm64-darwin gem build produces a gem with lib/quicknode_sdk/quicknode_sdk.bundle inside
  • Local simulation of CI's Linux platform-gem build succeeds (touched .so, ran the inline gemspec heredoc, gem build reports success)
  • Verify in CI: build-ruby job produces three platform gems (no source gem) and the Build platform gem step no longer errors

Note

Medium Risk
Medium risk because it changes release CI artifact layout and RubyGems publishing expectations; mistakes could cause broken gems or failed releases across supported platforms.

Overview
Fixes Ruby platform gem loading by relocating the native extension under ruby/lib/quicknode_sdk/quicknode_sdk.{so,bundle} and updating require_relative/build scripts to rely on Ruby’s platform extension resolution.

Updates release automation to stop building/publishing a source gem and instead verify/publish only the three platform gems, with corresponding adjustments to release.yml, publish-rubygems.yml, the base gemspec file list, and local build/release recipes (Justfile, scripts/build-platform-gem.rb, .gitignore, .solargraph.yml, docs).

Reviewed by Cursor Bugbot for commit 9e4d2ec. Bugbot is set up for automated code reviews on this repo. Configure here.

The base gemspec listed lib/quicknode_sdk.bundle in s.files, which
broke release CI on Linux where only lib/quicknode_sdk.so exists.
Platform-specific native libs are added by build-platform-gem.rb (and
the inline equivalent in release.yml), so the base spec should not
enumerate any native artifact.
Move the native artifact under lib/quicknode_sdk/ and require it via
"quicknode_sdk/quicknode_sdk" so Ruby's loader picks the platform-
appropriate extension automatically. Without this, Linux platform gems
(.so) cannot be loaded by the entry-point .rb, which hardcoded .bundle.
…uild

Mirror the loader-path change in macos-build-and-publish so the macOS
arm64 platform gem ships the bundle at lib/quicknode_sdk/quicknode_sdk.bundle,
matching what quicknode_sdk.rb now requires.
…ode_sdk/

Update both Linux build paths (cross and native), the strip target, and
the inline platform gemspec's spec.files entry to use the new
lib/quicknode_sdk/quicknode_sdk.so location.
The source gem ships no extconf.rb and no precompiled native lib, so
gem install on platforms without a published platform gem produces an
unloadable install. Drop the source-gem build and update the publisher
to expect 3 platform gems instead of 4.
Update remaining stale references to the old lib/quicknode_sdk.bundle
path and the obsolete "source gem compiles on install" comment in
release.yml. Also extend solargraph's exclude list to cover the .so
variant now that Linux platform gems ship a native artifact too.
The recipe takes a version argument (just release 0.2.0); the prior
'release_version' name with no parameter would have made the {{version}}
substitutions silently empty.
@johnpmitsch johnpmitsch merged commit a1d3a38 into main Apr 27, 2026
4 checks passed
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.

1 participant