fix(ruby): make platform gems load on Linux and stop building source gem#18
Merged
Conversation
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.
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.
Summary
["lib/quicknode_sdk.bundle"] are not files— the base gemspec hardcoded a macOS-only filename.lib/quicknode_sdk/andrequire_relative "quicknode_sdk/quicknode_sdk"so Ruby's loader picks.bundle/.soautomatically. Without this, the existingx86_64-linuxandaarch64-linuxplatform gems would have hitLoadErroratrequiretime.extconf.rband no precompiled binary, so it installed but couldn'trequire. 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.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, andCLAUDE.md.releasejustfile recipe to take aversionargument — 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 lintcleanjust ruby-build→ruby/lib/quicknode_sdk/quicknode_sdk.bundleexistsruby -Iruby/lib -rquicknode_sdk -e 'p QuicknodeSdk::SDK; p QuicknodeSdk::Admin; p QuicknodeSdk::Streams; p QuicknodeSdk::Webhooks; p QuicknodeSdk::KvStore'resolves all clients with noLoadErrorlib/quicknode_sdk/quicknode_sdk.bundleinside.so, ran the inline gemspec heredoc,gem buildreports success)build-rubyjob produces three platform gems (no source gem) and theBuild platform gemstep no longer errorsNote
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 updatingrequire_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.