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 2023-11-14 21:43:24
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bootsnap (Old)
 and      /work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.17445 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "rubygem-bootsnap"

Tue Nov 14 21:43:24 2023 rev:22 rq:1122993 version:1.17.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bootsnap/rubygem-bootsnap.changes        
2022-12-13 18:56:43.647606781 +0100
+++ 
/work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.17445/rubygem-bootsnap.changes 
    2023-11-14 21:43:29.537640982 +0100
@@ -1,0 +2,18 @@
+Thu Nov  2 15:40:16 UTC 2023 - Dan Čermák <[email protected]>
+
+- # 1.17.0
+
+* Ensure `$LOAD_PATH.dup` is Ractor shareable to fix an conflit with 
`did_you_mean`.
+* Allow to ignore direcotries using absolute paths.
+* Support YAML and JSON CompileCache on TruffleRuby.
+* Support LoadPathCache on TruffleRuby.
+
+# 1.16.0
+
+* Use `RbConfig::CONFIG["rubylibdir"]` instead of `RbConfig::CONFIG["libdir"]` 
to check for stdlib files. See #431.
+* Fix the cached version of `YAML.load_file` being slightly more permissive 
than the default `Psych` one. See #434.
+  `Date` and `Time` values are now properly rejected, as well as aliases.
+  If this causes a regression in your application, it is recommended to load 
*trusted* YAML files with `YAML.unsafe_load_file`.
+
+
+-------------------------------------------------------------------

Old:
----
  bootsnap-1.15.0.gem

New:
----
  bootsnap-1.17.0.gem

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ rubygem-bootsnap.spec ++++++
--- /var/tmp/diff_new_pack.qDNmis/_old  2023-11-14 21:43:30.101661861 +0100
+++ /var/tmp/diff_new_pack.qDNmis/_new  2023-11-14 21:43:30.101661861 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package rubygem-bootsnap
 #
-# Copyright (c) 2022 SUSE LLC
+# Copyright (c) 2023 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -24,11 +24,10 @@
 #
 
 Name:           rubygem-bootsnap
-Version:        1.15.0
+Version:        1.17.0
 Release:        0
 %define mod_name bootsnap
 %define mod_full_name %{mod_name}-%{version}
-BuildRoot:      %{_tmppath}/%{name}-%{version}-build
 BuildRequires:  %{rubydevel >= 2.6.0}
 BuildRequires:  %{rubygem gem2rpm}
 BuildRequires:  ruby-macros >= 5
@@ -38,7 +37,6 @@
 Source1:        gem2rpm.yml
 Summary:        Boot large ruby/rails apps faster
 License:        MIT
-Group:          Development/Languages/Ruby
 PreReq:         update-alternatives
 
 %description

++++++ bootsnap-1.15.0.gem -> bootsnap-1.17.0.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md    2022-11-25 15:35:55.000000000 +0100
+++ new/CHANGELOG.md    2023-10-30 10:06:25.000000000 +0100
@@ -1,5 +1,19 @@
 # Unreleased
 
+# 1.17.0
+
+* Ensure `$LOAD_PATH.dup` is Ractor shareable to fix an conflit with 
`did_you_mean`.
+* Allow to ignore direcotries using absolute paths.
+* Support YAML and JSON CompileCache on TruffleRuby.
+* Support LoadPathCache on TruffleRuby.
+
+# 1.16.0
+
+* Use `RbConfig::CONFIG["rubylibdir"]` instead of `RbConfig::CONFIG["libdir"]` 
to check for stdlib files. See #431.
+* Fix the cached version of `YAML.load_file` being slightly more permissive 
than the default `Psych` one. See #434.
+  `Date` and `Time` values are now properly rejected, as well as aliases.
+  If this causes a regression in your application, it is recommended to load 
*trusted* YAML files with `YAML.unsafe_load_file`.
+
 # 1.15.0
 
 * Add a readonly mode, for environments in which the updated cache wouldn't be 
persisted. See #428 and #423.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/README.md new/README.md
--- old/README.md       2022-11-25 15:35:55.000000000 +0100
+++ new/README.md       2023-10-30 10:06:25.000000000 +0100
@@ -1,6 +1,6 @@
 # Bootsnap [![Actions 
Status](https://github.com/Shopify/bootsnap/workflows/ci/badge.svg)](https://github.com/Shopify/bootsnap/actions)
 
-Bootsnap is a library that plugs into Ruby, with optional support for `YAML`,
+Bootsnap is a library that plugs into Ruby, with optional support for `YAML` 
and `JSON`,
 to optimize and cache expensive computations. See [How Does This 
Work](#how-does-this-work).
 
 #### Performance
@@ -57,6 +57,7 @@
   load_path_cache:      true,                 # Optimize the LOAD_PATH with a 
cache
   compile_cache_iseq:   true,                 # Compile Ruby code into ISeq 
cache, breaks coverage reporting.
   compile_cache_yaml:   true,                 # Compile YAML into a cache
+  compile_cache_json:   true,                 # Compile JSON into a cache
   readonly:             true,                 # Use the caches but don't 
update them on miss or stale entries.
 )
 ```
@@ -68,7 +69,7 @@
 Note: Bootsnap and [Spring](https://github.com/rails/spring) are orthogonal 
tools. While Bootsnap
 speeds up the loading of individual source files, Spring keeps a copy of a 
pre-booted Rails process
 on hand to completely skip parts of the boot process the next time it's 
needed. The two tools work
-well together, and are both included in a newly-generated Rails applications 
by default.
+well together.
 
 ### Environment variables
 
@@ -82,7 +83,7 @@
 - `BOOTSNAP_LOG` configure bootsnap to log all caches misses to STDERR.
 - `BOOTSNAP_IGNORE_DIRECTORIES` a comma separated list of directories that 
shouldn't be scanned.
   Useful when you have large directories of non-ruby files inside `$LOAD_PATH`.
-  It default to ignore any directory named `node_modules`.
+  It defaults to ignore any directory named `node_modules`.
 
 ### Environments
 
@@ -119,6 +120,7 @@
       compilation.
     * `YAML.load_file` is modified to cache the result of loading a YAML 
object in MessagePack format
       (or Marshal, if the message uses types unsupported by MessagePack).
+    * `JSON.load_file` is modified to cache the result of loading a JSON 
object in MessagePack format
 
 ### Path Pre-Scanning
 
@@ -189,9 +191,9 @@
 allows caching that bytecode. This allows us to bypass the 
relatively-expensive compilation step on
 subsequent loads of the same file.
 
-We also noticed that we spend a lot of time loading YAML documents during our 
application boot, and
-that MessagePack and Marshal are *much* faster at deserialization than YAML, 
even with a fast
-implementation. We use the same strategy of compilation caching for YAML 
documents, with the
+We also noticed that we spend a lot of time loading YAML and JSON documents 
during our application boot, and
+that MessagePack and Marshal are *much* faster at deserialization than YAML 
and JSON, even with a fast
+implementation. We use the same strategy of compilation caching for YAML and 
JSON documents, with the
 equivalent of Ruby's "bytecode" format being a MessagePack document (or, in 
the case of YAML
 documents with types unsupported by MessagePack, a Marshal stream).
 
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-11-25 15:35:55.000000000 +0100
+++ new/ext/bootsnap/bootsnap.c 2023-10-30 10:06:25.000000000 +0100
@@ -377,7 +377,9 @@
 
   if (fstat(fd, &statbuf) < 0) {
     *errno_provenance = "bs_fetch:open_current_file:fstat";
+    int previous_errno = errno;
     close(fd);
+    errno = previous_errno;
     return -1;
   }
 
@@ -467,7 +469,6 @@
 static int
 fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE args, VALUE 
* output_data, int * exception_tag, const char ** errno_provenance)
 {
-  char * data = NULL;
   ssize_t nread;
   int ret;
 
@@ -479,8 +480,8 @@
     ret = ERROR_WITH_ERRNO;
     goto done;
   }
-  data = ALLOC_N(char, data_size);
-  nread = read(fd, data, data_size);
+  storage_data = rb_str_buf_new(data_size);
+  nread = read(fd, RSTRING_PTR(storage_data), data_size);
   if (nread < 0) {
     *errno_provenance = "bs_fetch:fetch_cached_data:read";
     ret = ERROR_WITH_ERRNO;
@@ -491,7 +492,7 @@
     goto done;
   }
 
-  storage_data = rb_str_new(data, data_size);
+  rb_str_set_len(storage_data, nread);
 
   *exception_tag = bs_storage_to_output(handler, args, storage_data, 
output_data);
   if (*output_data == rb_cBootsnap_CompileCache_UNCOMPILABLE) {
@@ -500,7 +501,6 @@
   }
   ret = 0;
 done:
-  if (data != NULL) xfree(data);
   return ret;
 }
 
@@ -607,17 +607,22 @@
 
 
 /* Read contents from an fd, whose contents are asserted to be +size+ bytes
- * long, into a buffer */
-static ssize_t
-bs_read_contents(int fd, size_t size, char ** contents, const char ** 
errno_provenance)
+ * long, returning a Ruby string on success and Qfalse on failure */
+static VALUE
+bs_read_contents(int fd, size_t size, const char ** errno_provenance)
 {
+  VALUE contents;
   ssize_t nread;
-  *contents = ALLOC_N(char, size);
-  nread = read(fd, *contents, size);
+  contents = rb_str_buf_new(size);
+  nread = read(fd, RSTRING_PTR(contents), size);
+
   if (nread < 0) {
     *errno_provenance = "bs_fetch:bs_read_contents:read";
+    return Qfalse;
+  } else {
+    rb_str_set_len(contents, nread);
+    return contents;
   }
-  return nread;
 }
 
 /*
@@ -668,7 +673,6 @@
 bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler, VALUE 
args)
 {
   struct bs_cache_key cached_key, current_key;
-  char * contents = NULL;
   int cache_fd = -1, current_fd = -1;
   int res, valid_cache = 0, exception_tag = 0;
   const char * errno_provenance = NULL;
@@ -678,10 +682,14 @@
   VALUE output_data;  /* return data, e.g. ruby hash or loaded iseq */
 
   VALUE exception; /* ruby exception object to raise instead of returning */
+  VALUE exception_message; /* ruby exception string to use instead of 
errno_provenance */
 
   /* Open the source file and generate a cache key for it */
   current_fd = open_current_file(path, &current_key, &errno_provenance);
-  if (current_fd < 0) goto fail_errno;
+  if (current_fd < 0) {
+    exception_message = path_v;
+    goto fail_errno;
+  }
 
   /* Open the cache key if it exists, and read its cache key in */
   cache_fd = open_cache_file(cache_path, &cached_key, &errno_provenance);
@@ -691,6 +699,7 @@
       rb_funcall(rb_mBootsnap, instrumentation_method, 2, cache_fd == 
CACHE_MISS ? sym_miss : sym_stale, path_v);
     }
   } else if (cache_fd < 0) {
+    exception_message = rb_str_new_cstr(cache_path);
     goto fail_errno;
   } else {
     /* True if the cache existed and no invalidating changes have occurred 
since
@@ -713,13 +722,18 @@
     else if (res == CACHE_UNCOMPILABLE) {
       /* If fetch_cached_data returned `Uncompilable` we fallback to 
`input_to_output`
         This happens if we have say, an unsafe YAML cache, but try to load it 
in safe mode */
-      if (bs_read_contents(current_fd, current_key.size, &contents, 
&errno_provenance) < 0) goto fail_errno;
-      input_data = rb_str_new(contents, current_key.size);
+      if ((input_data = bs_read_contents(current_fd, current_key.size, 
&errno_provenance)) == Qfalse){
+        exception_message = path_v;
+        goto fail_errno;
+      }
       bs_input_to_output(handler, args, input_data, &output_data, 
&exception_tag);
       if (exception_tag != 0) goto raise;
       goto succeed;
     } else if (res == CACHE_MISS || res == CACHE_STALE) valid_cache = 0;
-    else if (res == ERROR_WITH_ERRNO) goto fail_errno;
+    else if (res == ERROR_WITH_ERRNO){
+      exception_message = rb_str_new_cstr(cache_path);
+      goto fail_errno;
+    }
     else if (!NIL_P(output_data)) goto succeed; /* fast-path, goal */
   }
   close(cache_fd);
@@ -727,8 +741,10 @@
   /* Cache is stale, invalid, or missing. Regenerate and write it out. */
 
   /* Read the contents of the source file into a buffer */
-  if (bs_read_contents(current_fd, current_key.size, &contents, 
&errno_provenance) < 0) goto fail_errno;
-  input_data = rb_str_new(contents, current_key.size);
+  if ((input_data = bs_read_contents(current_fd, current_key.size, 
&errno_provenance)) == Qfalse){
+    exception_message = path_v;
+    goto fail_errno;
+  }
 
   /* Try to compile the input_data using input_to_storage(input_data) */
   exception_tag = bs_input_to_storage(handler, args, input_data, path_v, 
&storage_data);
@@ -765,6 +781,7 @@
       * No point raising an error */
       if (errno != ENOENT) {
         errno_provenance = "bs_fetch:unlink";
+        exception_message = rb_str_new_cstr(cache_path);
         goto fail_errno;
       }
     }
@@ -775,7 +792,6 @@
   goto succeed; /* output_data is now the correct return. */
 
 #define CLEANUP \
-  if (contents != NULL) xfree(contents);   \
   if (current_fd >= 0)  close(current_fd); \
   if (cache_fd >= 0)    close(cache_fd);
 
@@ -784,7 +800,7 @@
   return output_data;
 fail_errno:
   CLEANUP;
-  exception = rb_syserr_new(errno, errno_provenance);
+  exception = rb_syserr_new_str(errno, exception_message);
   rb_exc_raise(exception);
   __builtin_unreachable();
 raise:
@@ -836,8 +852,7 @@
   /* Cache is stale, invalid, or missing. Regenerate and write it out. */
 
   /* Read the contents of the source file into a buffer */
-  if (bs_read_contents(current_fd, current_key.size, &contents, 
&errno_provenance) < 0) goto fail;
-  input_data = rb_str_new(contents, current_key.size);
+  if ((input_data = bs_read_contents(current_fd, current_key.size, 
&errno_provenance)) == Qfalse) goto fail;
 
   /* Try to compile the input_data using input_to_storage(input_data) */
   exception_tag = bs_input_to_storage(handler, Qnil, input_data, path_v, 
&storage_data);
@@ -858,7 +873,6 @@
   goto succeed;
 
 #define CLEANUP \
-  if (contents != NULL) xfree(contents);   \
   if (current_fd >= 0)  close(current_fd); \
   if (cache_fd >= 0)    close(cache_fd);
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/ext/bootsnap/extconf.rb new/ext/bootsnap/extconf.rb
--- old/ext/bootsnap/extconf.rb 2022-11-25 15:35:55.000000000 +0100
+++ new/ext/bootsnap/extconf.rb 2023-10-30 10:06:25.000000000 +0100
@@ -2,7 +2,7 @@
 
 require("mkmf")
 
-if RUBY_ENGINE == "ruby"
+if %w[ruby truffleruby].include?(RUBY_ENGINE)
   $CFLAGS << " -O3 "
   $CFLAGS << " -std=c99"
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bootsnap/compile_cache/iseq.rb 
new/lib/bootsnap/compile_cache/iseq.rb
--- old/lib/bootsnap/compile_cache/iseq.rb      2022-11-25 15:35:55.000000000 
+0100
+++ new/lib/bootsnap/compile_cache/iseq.rb      2023-10-30 10:06:25.000000000 
+0100
@@ -12,6 +12,10 @@
         def cache_dir=(cache_dir)
           @cache_dir = cache_dir.end_with?("/") ? "#{cache_dir}iseq" : 
"#{cache_dir}-iseq"
         end
+
+        def supported?
+          CompileCache.supported? && defined?(RubyVM)
+        end
       end
 
       has_ruby_bug_18250 = begin # https://bugs.ruby-lang.org/issues/18250
@@ -83,8 +87,6 @@
           return nil if defined?(Coverage) && 
Bootsnap::CompileCache::Native.coverage_running?
 
           Bootsnap::CompileCache::ISeq.fetch(path.to_s)
-        rescue Errno::EACCES
-          Bootsnap::CompileCache.permission_error(path)
         rescue RuntimeError => error
           if error.message =~ /unmatched platform/
             puts("unmatched platform for file #{path}")
@@ -103,11 +105,15 @@
         crc = Zlib.crc32(option.inspect)
         Bootsnap::CompileCache::Native.compile_option_crc32 = crc
       end
-      compile_option_updated
+      compile_option_updated if supported?
 
       def self.install!(cache_dir)
         Bootsnap::CompileCache::ISeq.cache_dir = cache_dir
+
+        return unless supported?
+
         Bootsnap::CompileCache::ISeq.compile_option_updated
+
         class << RubyVM::InstructionSequence
           prepend(InstructionSequenceMixin)
         end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bootsnap/compile_cache/json.rb 
new/lib/bootsnap/compile_cache/json.rb
--- old/lib/bootsnap/compile_cache/json.rb      2022-11-25 15:35:55.000000000 
+0100
+++ new/lib/bootsnap/compile_cache/json.rb      2023-10-30 10:06:25.000000000 
+0100
@@ -74,16 +74,12 @@
             return super unless (kwargs.keys - 
::Bootsnap::CompileCache::JSON.supported_options).empty?
           end
 
-          begin
-            ::Bootsnap::CompileCache::Native.fetch(
-              Bootsnap::CompileCache::JSON.cache_dir,
-              File.realpath(path),
-              ::Bootsnap::CompileCache::JSON,
-              kwargs,
-            )
-          rescue Errno::EACCES
-            ::Bootsnap::CompileCache.permission_error(path)
-          end
+          ::Bootsnap::CompileCache::Native.fetch(
+            Bootsnap::CompileCache::JSON.cache_dir,
+            File.realpath(path),
+            ::Bootsnap::CompileCache::JSON,
+            kwargs,
+          )
         end
 
         ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bootsnap/compile_cache/yaml.rb 
new/lib/bootsnap/compile_cache/yaml.rb
--- old/lib/bootsnap/compile_cache/yaml.rb      2022-11-25 15:35:55.000000000 
+0100
+++ new/lib/bootsnap/compile_cache/yaml.rb      2023-10-30 10:06:25.000000000 
+0100
@@ -65,7 +65,7 @@
           end
 
           unless const_defined?(:NoTagsVisitor)
-            visitor = Class.new(Psych::Visitors::ToRuby) do
+            visitor = Class.new(Psych::Visitors::NoAliasRuby) do
               def visit(target)
                 if target.tag
                   raise UnsupportedTags, "YAML tags are not supported: 
#{target.tag}"
@@ -129,7 +129,10 @@
           ast = ::YAML.parse(payload)
           return ast unless ast
 
-          NoTagsVisitor.create.visit(ast)
+          loader = ::Psych::ClassLoader::Restricted.new(["Symbol"], [])
+          scanner = ::Psych::ScalarScanner.new(loader)
+
+          NoTagsVisitor.new(scanner, loader).visit(ast)
         end
       end
 
@@ -226,16 +229,12 @@
               return super unless (kwargs.keys - 
CompileCache::YAML.supported_options).empty?
             end
 
-            begin
-              CompileCache::Native.fetch(
-                CompileCache::YAML.cache_dir,
-                File.realpath(path),
-                CompileCache::YAML::Psych4::SafeLoad,
-                kwargs,
-              )
-            rescue Errno::EACCES
-              CompileCache.permission_error(path)
-            end
+            CompileCache::Native.fetch(
+              CompileCache::YAML.cache_dir,
+              File.realpath(path),
+              CompileCache::YAML::Psych4::SafeLoad,
+              kwargs,
+            )
           end
 
           ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
@@ -250,16 +249,12 @@
               return super unless (kwargs.keys - 
CompileCache::YAML.supported_options).empty?
             end
 
-            begin
-              CompileCache::Native.fetch(
-                CompileCache::YAML.cache_dir,
-                File.realpath(path),
-                CompileCache::YAML::Psych4::UnsafeLoad,
-                kwargs,
-              )
-            rescue Errno::EACCES
-              CompileCache.permission_error(path)
-            end
+            CompileCache::Native.fetch(
+              CompileCache::YAML.cache_dir,
+              File.realpath(path),
+              CompileCache::YAML::Psych4::UnsafeLoad,
+              kwargs,
+            )
           end
 
           ruby2_keywords :unsafe_load_file if respond_to?(:ruby2_keywords, 
true)
@@ -306,16 +301,12 @@
               return super unless (kwargs.keys - 
CompileCache::YAML.supported_options).empty?
             end
 
-            begin
-              CompileCache::Native.fetch(
-                CompileCache::YAML.cache_dir,
-                File.realpath(path),
-                CompileCache::YAML::Psych3,
-                kwargs,
-              )
-            rescue Errno::EACCES
-              CompileCache.permission_error(path)
-            end
+            CompileCache::Native.fetch(
+              CompileCache::YAML.cache_dir,
+              File.realpath(path),
+              CompileCache::YAML::Psych3,
+              kwargs,
+            )
           end
 
           ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
@@ -330,16 +321,12 @@
               return super unless (kwargs.keys - 
CompileCache::YAML.supported_options).empty?
             end
 
-            begin
-              CompileCache::Native.fetch(
-                CompileCache::YAML.cache_dir,
-                File.realpath(path),
-                CompileCache::YAML::Psych3,
-                kwargs,
-              )
-            rescue Errno::EACCES
-              CompileCache.permission_error(path)
-            end
+            CompileCache::Native.fetch(
+              CompileCache::YAML.cache_dir,
+              File.realpath(path),
+              CompileCache::YAML::Psych3,
+              kwargs,
+            )
           end
 
           ruby2_keywords :unsafe_load_file if respond_to?(:ruby2_keywords, 
true)
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-11-25 15:35:55.000000000 +0100
+++ new/lib/bootsnap/compile_cache.rb   2023-10-30 10:06:25.000000000 +0100
@@ -8,7 +8,6 @@
     end
 
     Error = Class.new(StandardError)
-    PermissionError = Class.new(Error)
 
     def self.setup(cache_dir:, iseq:, yaml:, json:, readonly: false)
       if iseq
@@ -43,18 +42,10 @@
       end
     end
 
-    def self.permission_error(path)
-      cpath = Bootsnap::CompileCache::ISeq.cache_dir
-      raise(
-        PermissionError,
-        "bootsnap doesn't have permission to write cache entries in '#{cpath}' 
" \
-        "(or, less likely, doesn't have permission to read '#{path}')",
-      )
-    end
-
     def self.supported?
-      # only enable on 'ruby' (MRI), POSIX (darwin, linux, *bsd), Windows 
(RubyInstaller2) and >= 2.3.0
-      RUBY_ENGINE == "ruby" && 
RUBY_PLATFORM.match?(/darwin|linux|bsd|mswin|mingw|cygwin/)
+      # only enable on 'ruby' (MRI) and TruffleRuby for POSIX (darwin, linux, 
*bsd), Windows (RubyInstaller2)
+      %w[ruby truffleruby].include?(RUBY_ENGINE) &&
+        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-11-25 15:35:55.000000000 
+0100
+++ new/lib/bootsnap/load_path_cache/cache.rb   2023-10-30 10:06:25.000000000 
+0100
@@ -24,8 +24,16 @@
         @mutex.synchronize { @dirs[dir] }
       end
 
+      TRUFFLERUBY_LIB_DIR_PREFIX = if RUBY_ENGINE == "truffleruby"
+        "#{File.join(RbConfig::CONFIG['libdir'], 'truffle')}#{File::SEPARATOR}"
+      end
+
       # { 'enumerator' => nil, 'enumerator.so' => nil, ... }
       BUILTIN_FEATURES = $LOADED_FEATURES.each_with_object({}) do |feat, 
features|
+        if TRUFFLERUBY_LIB_DIR_PREFIX && 
feat.start_with?(TRUFFLERUBY_LIB_DIR_PREFIX)
+          feat = feat.byteslice(TRUFFLERUBY_LIB_DIR_PREFIX.bytesize..-1)
+        end
+
         # Builtin features are of the form 'enumerator.so'.
         # All others include paths.
         next unless feat.size < 20 && !feat.include?("/")
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/change_observer.rb 
new/lib/bootsnap/load_path_cache/change_observer.rb
--- old/lib/bootsnap/load_path_cache/change_observer.rb 2022-11-25 
15:35:55.000000000 +0100
+++ new/lib/bootsnap/load_path_cache/change_observer.rb 2023-10-30 
10:06:25.000000000 +0100
@@ -54,6 +54,12 @@
             ret
           end
         end
+
+        def dup
+          [] + self
+        end
+
+        alias_method :clone, :dup
       end
 
       def self.register(arr, observer)
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-11-25 15:35:55.000000000 
+0100
+++ new/lib/bootsnap/load_path_cache/path.rb    2023-10-30 10:06:25.000000000 
+0100
@@ -116,8 +116,8 @@
       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
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/lib/bootsnap/load_path_cache/path_scanner.rb 
new/lib/bootsnap/load_path_cache/path_scanner.rb
--- old/lib/bootsnap/load_path_cache/path_scanner.rb    2022-11-25 
15:35:55.000000000 +0100
+++ new/lib/bootsnap/load_path_cache/path_scanner.rb    2023-10-30 
10:06:25.000000000 +0100
@@ -54,7 +54,7 @@
 
             absolute_path = "#{absolute_dir_path}/#{name}"
             if File.directory?(absolute_path)
-              next if ignored_directories.include?(name)
+              next if ignored_directories.include?(name) || 
ignored_directories.include?(absolute_path)
 
               if yield relative_path, absolute_path, true
                 walk(absolute_path, relative_path, &block)
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-11-25 15:35:55.000000000 +0100
+++ new/lib/bootsnap/load_path_cache.rb 2023-10-30 10:06:25.000000000 +0100
@@ -38,8 +38,8 @@
 
         @loaded_features_index = LoadedFeaturesIndex.new
 
-        @load_path_cache = Cache.new(store, $LOAD_PATH, development_mode: 
development_mode)
         PathScanner.ignored_directories = ignore_directories if 
ignore_directories
+        @load_path_cache = Cache.new(store, $LOAD_PATH, development_mode: 
development_mode)
         @enabled = true
         require_relative("load_path_cache/core_ext/kernel_require")
         require_relative("load_path_cache/core_ext/loaded_features")
@@ -50,12 +50,21 @@
         @loaded_features_index = nil
         @realpath_cache = nil
         @load_path_cache = nil
-        ChangeObserver.unregister($LOAD_PATH)
+        ChangeObserver.unregister($LOAD_PATH) if supported?
       end
 
       def supported?
-        RUBY_ENGINE == "ruby" &&
-          RUBY_PLATFORM =~ /darwin|linux|bsd|mswin|mingw|cygwin/
+        if RUBY_PLATFORM.match?(/darwin|linux|bsd|mswin|mingw|cygwin/)
+          case RUBY_ENGINE
+          when "truffleruby"
+            # https://github.com/oracle/truffleruby/issues/3131
+            RUBY_ENGINE_VERSION >= "23.1.0"
+          when "ruby"
+            true
+          else
+            false
+          end
+        end
       end
     end
   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-11-25 15:35:55.000000000 +0100
+++ new/lib/bootsnap/version.rb 2023-10-30 10:06:25.000000000 +0100
@@ -1,5 +1,5 @@
 # frozen_string_literal: true
 
 module Bootsnap
-  VERSION = "1.15.0"
+  VERSION = "1.17.0"
 end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata        2022-11-25 15:35:55.000000000 +0100
+++ new/metadata        2023-10-30 10:06:25.000000000 +0100
@@ -1,14 +1,14 @@
 --- !ruby/object:Gem::Specification
 name: bootsnap
 version: !ruby/object:Gem::Version
-  version: 1.15.0
+  version: 1.17.0
 platform: ruby
 authors:
 - Burke Libbey
 autorequire: 
 bindir: exe
 cert_chain: []
-date: 2022-11-25 00:00:00.000000000 Z
+date: 2023-10-30 00:00:00.000000000 Z
 dependencies:
 - !ruby/object:Gem::Dependency
   name: msgpack
@@ -83,7 +83,7 @@
     - !ruby/object:Gem::Version
       version: '0'
 requirements: []
-rubygems_version: 3.3.3
+rubygems_version: 3.4.21
 signing_key: 
 specification_version: 4
 summary: Boot large ruby/rails apps faster

Reply via email to