summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2025-02-04 10:59:52 +0900
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2025-02-05 07:36:59 +0900
commit9052d0d534828f5b8bd5d94b3863f8afbd617053 (patch)
tree78d9b84734c42307bef0fb756a71660cdd8b1908
parentb50360e08be5b35ec42b0b97e1d25bc89432023b (diff)
Try to inject fiddle path as bundled gems for RJIT
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/12616
-rw-r--r--rjit.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/rjit.rb b/rjit.rb
index 12fc10c91e..81d341ce39 100644
--- a/rjit.rb
+++ b/rjit.rb
@@ -28,6 +28,11 @@ end
if RubyVM::RJIT.enabled?
begin
+ fiddle_paths = %w[.bundle/gems/fiddle-*/lib .bundle/extensions/*/*/fiddle-*].map do |dir|
+ Dir.glob("#{File.expand_path("..", __FILE__)}/#{dir}").first
+ end.compact
+ $LOAD_PATH.unshift(*fiddle_paths) unless fiddle_paths.empty?
+
require 'fiddle'
require 'fiddle/import'
rescue LoadError