Skip to content

Commit

Permalink
Detect bootsnap from all frames
Browse files Browse the repository at this point in the history
  • Loading branch information
hsbt committed Dec 13, 2023
1 parent ce74047 commit 57fcfca
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/bundled_gems.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,12 @@ def self.warning?(name, specs: nil)
else
return
end
# Warning feature is not working correctly with Bootsnap
return if caller_locations(2,1)[0]&.path.match?(/bootsnap/)
# Warning feature is not working correctly with Bootsnap.
# caller_locations returns:
# lib/ruby/3.3.0+0/bundled_gems.rb:65:in `block (2 levels) in replace_require'
# $GEM_HOME/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'"
# ...
return if caller_locations(2).find {|c| c&.path.match?(/bootsnap/) }
return if WARNED[name]
WARNED[name] = true
if gem == true
Expand Down

0 comments on commit 57fcfca

Please sign in to comment.