Skip to content

Commit

Permalink
Use RbConfig::CONFIG["rubylibdir"] to check for stdlib files
Browse files Browse the repository at this point in the history
Ref: #431
  • Loading branch information
byroot committed Jan 13, 2023
1 parent b6107b8 commit 72202aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Unreleased

* Use `RbConfig::CONFIG["rubylibdir"]` instead of `RbConfig::CONFIG["libdir"]` to check for stdlib files. See #431.

# 1.15.0

* Add a readonly mode, for environments in which the updated cache wouldn't be persisted. See #428 and #423.
Expand Down
4 changes: 2 additions & 2 deletions lib/bootsnap/load_path_cache/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ def latest_mtime(path, dirs)
VOLATILE = :volatile

# Built-in ruby lib stuff doesn't change, but things can occasionally be
# installed into sitedir, which generally lives under libdir.
RUBY_LIBDIR = RbConfig::CONFIG["libdir"]
# installed into sitedir, which generally lives under rubylibdir.
RUBY_LIBDIR = RbConfig::CONFIG["rubylibdir"]
RUBY_SITEDIR = RbConfig::CONFIG["sitedir"]

def stability
Expand Down
2 changes: 1 addition & 1 deletion test/load_path_cache/path_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def test_stability
volatile = Path.new(__FILE__)
stable = Path.new(time_file)
unknown = Path.new("/who/knows")
lib = Path.new("#{RbConfig::CONFIG['libdir']}/a")
lib = Path.new("#{RbConfig::CONFIG['rubylibdir']}/a")
site = Path.new("#{RbConfig::CONFIG['sitedir']}/b")
absolute_prefix = RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/ ? ENV["SystemDrive"] : ""
bundler = Path.new("#{absolute_prefix}/bp/3")
Expand Down

0 comments on commit 72202aa

Please sign in to comment.