Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package rubygem-bootsnap for
openSUSE:Factory checked in at 2022-03-10 22:45:52
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bootsnap (Old)
and /work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.2349 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bootsnap"
Thu Mar 10 22:45:52 2022 rev:18 rq:960833 version:1.11.1
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bootsnap/rubygem-bootsnap.changes
2022-02-24 18:23:29.446657702 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.2349/rubygem-bootsnap.changes
2022-03-11 11:35:15.270196066 +0100
@@ -1,0 +2,20 @@
+Thu Mar 10 15:43:33 UTC 2022 - Manuel Schnitzer <[email protected]>
+
+- updated to version 1.11.1
+
+ * Fix the `can't modify frozen Hash` error on load path cache mutation. See
#411.
+
+ # 1.11.0
+
+ * Drop dependency on `fileutils`.
+
+ * Better respect `Kernel#require` duck typing. While it almost never comes
up in practice, `Kernel#require`
+ follow a fairly intricate duck-typing protocol on its argument implemented
as `rb_get_path(VALUE)` in MRI.
+ So when applicable we bind `rb_get_path` and use it for improved
compatibility. See #396 and #406.
+
+ * Get rid of the `Kernel.require_relative` decorator by resolving
`$LOAD_PATH` members to their real path.
+ This way we handle symlinks in `$LOAD_PATH` much more efficiently. See
#402 for the detailed explanation.
+
+ * Drop support for Ruby 2.3 (to allow getting rid of the
`Kernel.require_relative` decorator).
+
+-------------------------------------------------------------------
Old:
----
bootsnap-1.10.3.gem
New:
----
bootsnap-1.11.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-bootsnap.spec ++++++
--- /var/tmp/diff_new_pack.iG0Ki0/_old 2022-03-11 11:35:15.730196605 +0100
+++ /var/tmp/diff_new_pack.iG0Ki0/_new 2022-03-11 11:35:15.734196610 +0100
@@ -24,12 +24,12 @@
#
Name: rubygem-bootsnap
-Version: 1.10.3
+Version: 1.11.1
Release: 0
%define mod_name bootsnap
%define mod_full_name %{mod_name}-%{version}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
-BuildRequires: %{rubydevel >= 2.3.0}
+BuildRequires: %{rubydevel >= 2.4.0}
BuildRequires: %{rubygem gem2rpm}
BuildRequires: ruby-macros >= 5
BuildRequires: update-alternatives
++++++ bootsnap-1.10.3.gem -> bootsnap-1.11.1.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2022-02-02 09:29:18.000000000 +0100
+++ new/CHANGELOG.md 2022-03-08 10:54:17.000000000 +0100
@@ -1,5 +1,22 @@
# Unreleased
+# 1.11.1
+
+* Fix the `can't modify frozen Hash` error on load path cache mutation. See
#411.
+
+# 1.11.0
+
+* Drop dependency on `fileutils`.
+
+* Better respect `Kernel#require` duck typing. While it almost never comes up
in practice, `Kernel#require`
+ follow a fairly intricate duck-typing protocol on its argument implemented
as `rb_get_path(VALUE)` in MRI.
+ So when applicable we bind `rb_get_path` and use it for improved
compatibility. See #396 and #406.
+
+* Get rid of the `Kernel.require_relative` decorator by resolving `$LOAD_PATH`
members to their real path.
+ This way we handle symlinks in `$LOAD_PATH` much more efficiently. See #402
for the detailed explanation.
+
+* Drop support for Ruby 2.3 (to allow getting rid of the
`Kernel.require_relative` decorator).
+
# 1.10.3
* Fix Regexp and Date type support in YAML compile cache. (#400)
Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/ext/bootsnap/bootsnap.c new/ext/bootsnap/bootsnap.c
--- old/ext/bootsnap/bootsnap.c 2022-02-02 09:29:18.000000000 +0100
+++ new/ext/bootsnap/bootsnap.c 2022-03-08 10:54:17.000000000 +0100
@@ -2,7 +2,7 @@
* Suggested reading order:
* 1. Skim Init_bootsnap
* 2. Skim bs_fetch
- * 3. The rest of everyrything
+ * 3. The rest of everything
*
* Init_bootsnap sets up the ruby objects and binds bs_fetch to
* Bootsnap::CompileCache::Native.fetch.
@@ -135,6 +135,12 @@
return RTEST(cov) ? Qtrue : Qfalse;
}
+static VALUE
+bs_rb_get_path(VALUE self, VALUE fname)
+{
+ return rb_get_path(fname);
+}
+
/*
* Ruby C extensions are initialized by calling Init_<extname>.
*
@@ -146,6 +152,9 @@
Init_bootsnap(void)
{
rb_mBootsnap = rb_define_module("Bootsnap");
+
+ rb_define_singleton_method(rb_mBootsnap, "rb_get_path", bs_rb_get_path, 1);
+
rb_mBootsnap_CompileCache = rb_define_module_under(rb_mBootsnap,
"CompileCache");
rb_mBootsnap_CompileCache_Native =
rb_define_module_under(rb_mBootsnap_CompileCache, "Native");
rb_cBootsnap_CompileCache_UNCOMPILABLE =
rb_const_get(rb_mBootsnap_CompileCache, rb_intern("UNCOMPILABLE"));
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/compile_cache.rb
new/lib/bootsnap/compile_cache.rb
--- old/lib/bootsnap/compile_cache.rb 2022-02-02 09:29:18.000000000 +0100
+++ new/lib/bootsnap/compile_cache.rb 2022-03-08 10:54:17.000000000 +0100
@@ -50,9 +50,7 @@
def self.supported?
# only enable on 'ruby' (MRI), POSIX (darwin, linux, *bsd), Windows
(RubyInstaller2) and >= 2.3.0
- RUBY_ENGINE == "ruby" &&
- RUBY_PLATFORM =~ /darwin|linux|bsd|mswin|mingw|cygwin/ &&
- Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.3.0")
+ RUBY_ENGINE == "ruby" &&
RUBY_PLATFORM.match?(/darwin|linux|bsd|mswin|mingw|cygwin/)
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/cache.rb
new/lib/bootsnap/load_path_cache/cache.rb
--- old/lib/bootsnap/load_path_cache/cache.rb 2022-02-02 09:29:18.000000000
+0100
+++ new/lib/bootsnap/load_path_cache/cache.rb 2022-03-08 10:54:17.000000000
+0100
@@ -142,6 +142,8 @@
@has_relative_paths = true if p.relative?
next if p.non_directory?
+ p = p.to_realpath
+
expanded_path = p.expanded_path
entries, dirs = p.entries_and_dirs(@store)
# push -> low precedence -> set only if unset
@@ -157,6 +159,8 @@
p = Path.new(path)
next if p.non_directory?
+ p = p.to_realpath
+
expanded_path = p.expanded_path
entries, dirs = p.entries_and_dirs(@store)
# unshift -> high precedence -> unconditional set
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb
new/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb
--- old/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb 2022-02-02
09:29:18.000000000 +0100
+++ new/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb 2022-03-08
10:54:17.000000000 +0100
@@ -6,7 +6,7 @@
alias_method(:require_without_bootsnap, :require)
def require(path)
- string_path = path.to_s
+ string_path = Bootsnap.rb_get_path(path)
return false if
Bootsnap::LoadPathCache.loaded_features_index.key?(string_path)
resolved = Bootsnap::LoadPathCache.load_path_cache.find(string_path)
@@ -33,18 +33,9 @@
end
end
- alias_method(:require_relative_without_bootsnap, :require_relative)
- def require_relative(path)
- location = caller_locations(1..1).first
- realpath = Bootsnap::LoadPathCache.realpath_cache.call(
- location.absolute_path || location.path, path
- )
- require(realpath)
- end
-
alias_method(:load_without_bootsnap, :load)
def load(path, wrap = false)
- if (resolved = Bootsnap::LoadPathCache.load_path_cache.find(path,
try_extensions: false))
+ if (resolved =
Bootsnap::LoadPathCache.load_path_cache.find(Bootsnap.rb_get_path(path),
try_extensions: false))
load_without_bootsnap(resolved, wrap)
else
load_without_bootsnap(path, wrap)
@@ -62,7 +53,7 @@
# The challenge is that we don't control the point at which the entry gets
# added to $LOADED_FEATURES and won't be able to hook that modification
# since it's done in C-land.
- resolved = Bootsnap::LoadPathCache.load_path_cache.find(path)
+ resolved =
Bootsnap::LoadPathCache.load_path_cache.find(Bootsnap.rb_get_path(path))
if Bootsnap::LoadPathCache::FALLBACK_SCAN.equal?(resolved)
autoload_without_bootsnap(const, path)
elsif resolved == false
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/path.rb
new/lib/bootsnap/load_path_cache/path.rb
--- old/lib/bootsnap/load_path_cache/path.rb 2022-02-02 09:29:18.000000000
+0100
+++ new/lib/bootsnap/load_path_cache/path.rb 2022-03-08 10:54:17.000000000
+0100
@@ -21,8 +21,26 @@
attr_reader(:path)
- def initialize(path)
+ def initialize(path, real: false)
@path = path.to_s.freeze
+ @real = real
+ end
+
+ def to_realpath
+ return self if @real
+
+ realpath = begin
+ File.realpath(path)
+ rescue Errno::ENOENT
+ return self
+ end
+
+ if realpath != path
+ Path.new(realpath, real: true)
+ else
+ @real = true
+ self
+ end
end
# True if the path exists, but represents a non-directory object
@@ -62,7 +80,11 @@
end
def expanded_path
- File.expand_path(path).freeze
+ if @real
+ path
+ else
+ @expanded_path ||= File.expand_path(path).freeze
+ end
end
private
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/realpath_cache.rb
new/lib/bootsnap/load_path_cache/realpath_cache.rb
--- old/lib/bootsnap/load_path_cache/realpath_cache.rb 2022-02-02
09:29:18.000000000 +0100
+++ new/lib/bootsnap/load_path_cache/realpath_cache.rb 1970-01-01
01:00:00.000000000 +0100
@@ -1,33 +0,0 @@
-# frozen_string_literal: true
-
-module Bootsnap
- module LoadPathCache
- class RealpathCache
- def initialize
- @cache = Hash.new { |h, k| h[k] = realpath(*k) }
- end
-
- def call(*key)
- @cache[key]
- end
-
- private
-
- def realpath(caller_location, path)
- base = File.dirname(caller_location)
- abspath = File.expand_path(path, base).freeze
- find_file(abspath)
- end
-
- def find_file(name)
- return File.realpath(name).freeze if File.exist?(name)
-
- CACHED_EXTENSIONS.each do |ext|
- filename = "#{name}#{ext}"
- return File.realpath(filename).freeze if File.exist?(filename)
- end
- name
- end
- end
- end
-end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/store.rb
new/lib/bootsnap/load_path_cache/store.rb
--- old/lib/bootsnap/load_path_cache/store.rb 2022-02-02 09:29:18.000000000
+0100
+++ new/lib/bootsnap/load_path_cache/store.rb 2022-03-08 10:54:17.000000000
+0100
@@ -29,8 +29,8 @@
v = get(key)
unless v
- @dirty = true
v = yield
+ mark_for_mutation!
@data[key] = v
end
v
@@ -40,7 +40,7 @@
raise(SetOutsideTransactionNotAllowed) unless @txn_mutex.owned?
if value != @data[key]
- @dirty = true
+ mark_for_mutation!
@data[key] = value
end
end
@@ -59,6 +59,11 @@
private
+ def mark_for_mutation!
+ @dirty = true
+ @data = @data.dup if @data.frozen?
+ end
+
def commit_transaction
if @dirty
dump_data
@@ -69,7 +74,7 @@
def load_data
@data = begin
data = File.open(@store_path, encoding: Encoding::BINARY) do |io|
- MessagePack.load(io)
+ MessagePack.load(io, freeze: true)
end
if data.is_a?(Hash) && data[VERSION_KEY] == CURRENT_VERSION
data
@@ -89,19 +94,17 @@
end
def dump_data
- require "fileutils" unless defined? FileUtils
-
# Change contents atomically so other processes can't get invalid
# caches if they read at an inopportune time.
tmp = "#{@store_path}.#{Process.pid}.#{(rand * 100_000).to_i}.tmp"
- FileUtils.mkpath(File.dirname(tmp))
+ mkdir_p(File.dirname(tmp))
exclusive_write = File::Constants::CREAT | File::Constants::EXCL |
File::Constants::WRONLY
# `encoding:` looks redundant wrt `binwrite`, but necessary on windows
# because binary is part of mode.
File.open(tmp, mode: exclusive_write, encoding: Encoding::BINARY) do
|io|
- MessagePack.dump(@data, io, freeze: true)
+ MessagePack.dump(@data, io)
end
- FileUtils.mv(tmp, @store_path)
+ File.rename(tmp, @store_path)
rescue Errno::EEXIST
retry
rescue SystemCallError
@@ -110,6 +113,21 @@
def default_data
{VERSION_KEY => CURRENT_VERSION}
end
+
+ def mkdir_p(path)
+ stack = []
+ until File.directory?(path)
+ stack.push path
+ path = File.dirname(path)
+ end
+ stack.reverse_each do |dir|
+ begin
+ Dir.mkdir(dir)
+ rescue SystemCallError
+ raise unless File.directory?(dir)
+ end
+ end
+ end
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache.rb
new/lib/bootsnap/load_path_cache.rb
--- old/lib/bootsnap/load_path_cache.rb 2022-02-02 09:29:18.000000000 +0100
+++ new/lib/bootsnap/load_path_cache.rb 2022-03-08 10:54:17.000000000 +0100
@@ -22,7 +22,7 @@
CACHED_EXTENSIONS = DLEXT2 ? [DOT_RB, DLEXT, DLEXT2] : [DOT_RB, DLEXT]
class << self
- attr_reader(:load_path_cache, :loaded_features_index, :realpath_cache)
+ attr_reader(:load_path_cache, :loaded_features_index)
def setup(cache_path:, development_mode:)
unless supported?
@@ -33,7 +33,6 @@
store = Store.new(cache_path)
@loaded_features_index = LoadedFeaturesIndex.new
- @realpath_cache = RealpathCache.new
@load_path_cache = Cache.new(store, $LOAD_PATH, development_mode:
development_mode)
require_relative("load_path_cache/core_ext/kernel_require")
@@ -55,5 +54,4 @@
require_relative("load_path_cache/store")
require_relative("load_path_cache/change_observer")
require_relative("load_path_cache/loaded_features_index")
- require_relative("load_path_cache/realpath_cache")
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap/version.rb new/lib/bootsnap/version.rb
--- old/lib/bootsnap/version.rb 2022-02-02 09:29:18.000000000 +0100
+++ new/lib/bootsnap/version.rb 2022-03-08 10:54:17.000000000 +0100
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Bootsnap
- VERSION = "1.10.3"
+ VERSION = "1.11.1"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/bootsnap.rb new/lib/bootsnap.rb
--- old/lib/bootsnap.rb 2022-02-02 09:29:18.000000000 +0100
+++ new/lib/bootsnap.rb 2022-03-08 10:54:17.000000000 +0100
@@ -133,5 +133,16 @@
path.start_with?("/")
end
end
+
+ # This is a semi-accurate ruby implementation of the native
`rb_get_path(VALUE)` function.
+ # The native version is very intricate and may behave differently on
windows etc.
+ # But we only use it for non-MRI platform.
+ def rb_get_path(fname)
+ path_path = fname.respond_to?(:to_path) ? fname.to_path : fname
+ String.try_convert(path_path) || raise(TypeError, "no implicit
conversion of #{path_path.class} into String")
+ end
+
+ # Allow the C extension to redefine `rb_get_path` without warning.
+ alias_method :rb_get_path, :rb_get_path # rubocop:disable
Lint/DuplicateMethods
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2022-02-02 09:29:18.000000000 +0100
+++ new/metadata 2022-03-08 10:54:17.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: bootsnap
version: !ruby/object:Gem::Version
- version: 1.10.3
+ version: 1.11.1
platform: ruby
authors:
- Burke Libbey
autorequire:
bindir: exe
cert_chain: []
-date: 2022-02-02 00:00:00.000000000 Z
+date: 2022-03-08 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: msgpack
@@ -57,7 +57,6 @@
- lib/bootsnap/load_path_cache/loaded_features_index.rb
- lib/bootsnap/load_path_cache/path.rb
- lib/bootsnap/load_path_cache/path_scanner.rb
-- lib/bootsnap/load_path_cache/realpath_cache.rb
- lib/bootsnap/load_path_cache/store.rb
- lib/bootsnap/setup.rb
- lib/bootsnap/version.rb
@@ -77,7 +76,7 @@
requirements:
- - ">="
- !ruby/object:Gem::Version
- version: 2.3.0
+ version: 2.4.0
required_rubygems_version: !ruby/object:Gem::Requirement
requirements:
- - ">="