Fix native extension load path for source gem installs#10
Merged
igalshilman merged 2 commits intoMay 14, 2026
Conversation
When the gem is installed from source (gem install), extconf.rb builds the native extension to lib/restate_internal.bundle. But vm.rb is in lib/restate/ and uses require_relative, so the fallback resolves to lib/restate/restate_internal — which doesn't exist. Add a third fallback that looks one directory up to find the extension at lib/restate_internal where source builds place it. Co-authored-by: Cursor <cursoragent@cursor.com>
The falcon gem (0.55.3) depends on the openssl gem (4.0.2) which requires OpenSSL development headers to compile its native extension. The slim Docker image doesn't include these by default. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Problem
When the gem is installed from source (
gem install restate-sdkwithout a pre-compiled native gem),extconf.rbbuilds the native extension tolib/restate_internal.bundle. However,vm.rblives inlib/restate/and usesrequire_relative, so the existing fallback resolves tolib/restate/restate_internal— which doesn't exist.The load path chain in
vm.rbcurrently tries:lib/restate/<ruby_version>/restate_internal(cross-compiled gems)lib/restate/restate_internal(rake compiledev builds)But misses the case where the extension is at
lib/restate_internal(source gem installs).Solution
Add a third fallback
require_relative '../restate_internal'to handle source gem installs where the extension is built one directory up fromvm.rb.Made with Cursor