Skip to content

Commit de8d4c7

Browse files
authored
Merge pull request #383 from k0kubun/force-fiddle
Fix LoadError and warnings for fiddle
2 parents 3d64bb7 + c4e794f commit de8d4c7

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

harness/harness-common.rb

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,20 @@ def is_macos
7171

7272
def get_maxrss
7373
unless $LOAD_PATH.resolve_feature_path("fiddle")
74-
gem "fiddle", ">= 1.1.8" # For ruby 3.5.0-dev compatibility
74+
# In Ruby 3.5+, fiddle is no longer a default gem. Load the bundled-gem fiddle instead.
75+
if defined?(Bundler) # benchmarks with Gemfile
76+
bundler_ui_level, Bundler.ui.level = Bundler.ui.level, :error if defined?(Bundler) # suppress warnings from force_activate
77+
Gem::BUNDLED_GEMS.force_activate("fiddle")
78+
Bundler.ui.level = bundler_ui_level if bundler_ui_level
79+
else # benchmarks without Gemfile
80+
gem "fiddle", ">= 1.1.8"
81+
end
7582
end
76-
83+
# Suppress a warning for Ruby 3.4+ on benchmarks with Gemfile
84+
verbose, $VERBOSE = $VERBOSE, nil
7785
require 'fiddle'
86+
$VERBOSE = verbose
87+
7888
require 'rbconfig/sizeof'
7989

8090
unless Fiddle::SIZEOF_LONG == 8 and RbConfig::CONFIG["host_os"] =~ /linux|darwin/

0 commit comments

Comments
 (0)