Hello community,
here is the log from the commit of package rubygem-bootsnap for
openSUSE:Factory checked in at 2020-11-02 10:36:11
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-bootsnap (Old)
and /work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.3463 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-bootsnap"
Mon Nov 2 10:36:11 2020 rev:7 rq:845268 version:1.4.9
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-bootsnap/rubygem-bootsnap.changes
2020-08-24 15:09:51.558591607 +0200
+++
/work/SRC/openSUSE:Factory/.rubygem-bootsnap.new.3463/rubygem-bootsnap.changes
2020-11-02 10:36:37.947306548 +0100
@@ -1,0 +2,8 @@
+Sun Nov 1 14:46:59 UTC 2020 - Manuel Schnitzer <[email protected]>
+
+- updated to version 1.4.9
+
+ * [Windows support](https://github.com/Shopify/bootsnap/pull/319)
+ * [Fix potential crash](https://github.com/Shopify/bootsnap/pull/322)
+
+-------------------------------------------------------------------
Old:
----
bootsnap-1.4.8.gem
New:
----
bootsnap-1.4.9.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-bootsnap.spec ++++++
--- /var/tmp/diff_new_pack.5AGKMQ/_old 2020-11-02 10:36:38.967307246 +0100
+++ /var/tmp/diff_new_pack.5AGKMQ/_new 2020-11-02 10:36:38.971307250 +0100
@@ -24,7 +24,7 @@
#
Name: rubygem-bootsnap
-Version: 1.4.8
+Version: 1.4.9
Release: 0
%define mod_name bootsnap
%define mod_full_name %{mod_name}-%{version}
++++++ bootsnap-1.4.8.gem -> bootsnap-1.4.9.gem ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/CHANGELOG.md new/CHANGELOG.md
--- old/CHANGELOG.md 2020-08-11 19:32:52.000000000 +0200
+++ new/CHANGELOG.md 2020-10-26 19:22:04.000000000 +0100
@@ -1,3 +1,8 @@
+# 1.4.9
+
+* [Windows support](https://github.com/Shopify/bootsnap/pull/319)
+* [Fix potential crash](https://github.com/Shopify/bootsnap/pull/322)
+
# 1.4.8
* [Prevent FallbackScan from polluting exception
cause](https://github.com/Shopify/bootsnap/pull/314)
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 2020-08-11 19:32:52.000000000 +0200
+++ new/ext/bootsnap/bootsnap.c 2020-10-26 19:22:04.000000000 +0100
@@ -91,16 +91,16 @@
/* Functions exposed as module functions on Bootsnap::CompileCache::Native */
static VALUE bs_compile_option_crc32_set(VALUE self, VALUE crc32_v);
-static VALUE bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE
handler);
+static VALUE bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE
handler, VALUE args);
/* Helpers */
static uint64_t fnv1a_64(const char *str);
-static void bs_cache_path(const char * cachedir, const char * path, char (*
cache_path)[MAX_CACHEPATH_SIZE]);
+static void bs_cache_path(const char * cachedir, const char * path, const char
* extra, char (* cache_path)[MAX_CACHEPATH_SIZE]);
static int bs_read_key(int fd, struct bs_cache_key * key);
static int cache_key_equal(struct bs_cache_key * k1, struct bs_cache_key * k2);
-static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE
handler);
+static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE
handler, VALUE args);
static int open_current_file(char * path, struct bs_cache_key * key, const
char ** errno_provenance);
-static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE *
output_data, int * exception_tag, const char ** errno_provenance);
+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);
static uint32_t get_ruby_revision(void);
static uint32_t get_ruby_platform(void);
@@ -108,12 +108,12 @@
* Helper functions to call ruby methods on handler object without crashing on
* exception.
*/
-static int bs_storage_to_output(VALUE handler, VALUE storage_data, VALUE *
output_data);
+static int bs_storage_to_output(VALUE handler, VALUE args, VALUE storage_data,
VALUE * output_data);
static VALUE prot_storage_to_output(VALUE arg);
static VALUE prot_input_to_output(VALUE arg);
-static void bs_input_to_output(VALUE handler, VALUE input_data, VALUE *
output_data, int * exception_tag);
+static void bs_input_to_output(VALUE handler, VALUE args, VALUE input_data,
VALUE * output_data, int * exception_tag);
static VALUE prot_input_to_storage(VALUE arg);
-static int bs_input_to_storage(VALUE handler, VALUE input_data, VALUE pathval,
VALUE * storage_data);
+static int bs_input_to_storage(VALUE handler, VALUE args, VALUE input_data,
VALUE pathval, VALUE * storage_data);
struct s2o_data;
struct i2o_data;
struct i2s_data;
@@ -148,7 +148,7 @@
uncompilable = rb_intern("__bootsnap_uncompilable__");
rb_define_module_function(rb_mBootsnap_CompileCache_Native,
"coverage_running?", bs_rb_coverage_running, 0);
- rb_define_module_function(rb_mBootsnap_CompileCache_Native, "fetch",
bs_rb_fetch, 3);
+ rb_define_module_function(rb_mBootsnap_CompileCache_Native, "fetch",
bs_rb_fetch, 4);
rb_define_module_function(rb_mBootsnap_CompileCache_Native,
"compile_option_crc32=", bs_compile_option_crc32_set, 1);
current_umask = umask(0777);
@@ -264,9 +264,12 @@
* The path will look something like: <cachedir>/12/34567890abcdef
*/
static void
-bs_cache_path(const char * cachedir, const char * path, char (*
cache_path)[MAX_CACHEPATH_SIZE])
+bs_cache_path(const char * cachedir, const char * path, const char * extra,
char (* cache_path)[MAX_CACHEPATH_SIZE])
{
uint64_t hash = fnv1a_64(path);
+ if (extra) {
+ hash ^= fnv1a_64(extra);
+ }
uint8_t first_byte = (hash >> (64 - 8));
uint64_t remainder = hash & 0x00ffffffffffffff;
@@ -301,7 +304,7 @@
* conversions on the ruby VALUE arguments before passing them along.
*/
static VALUE
-bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
+bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler, VALUE
args)
{
FilePathValue(path_v);
@@ -315,11 +318,16 @@
char * cachedir = RSTRING_PTR(cachedir_v);
char * path = RSTRING_PTR(path_v);
char cache_path[MAX_CACHEPATH_SIZE];
+ char * extra = NULL;
+ if (!NIL_P(args)) {
+ VALUE args_serial = rb_marshal_dump(args, Qnil);
+ extra = RSTRING_PTR(args_serial);
+ }
/* generate cache path to cache_path */
- bs_cache_path(cachedir, path, &cache_path);
+ bs_cache_path(cachedir, path, extra, &cache_path);
- return bs_fetch(path, path_v, cache_path, handler);
+ return bs_fetch(path, path_v, cache_path, handler, args);
}
/*
@@ -428,7 +436,7 @@
* or exception, will be the final data returnable to the user.
*/
static int
-fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE *
output_data, int * exception_tag, const char ** errno_provenance)
+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;
@@ -454,9 +462,9 @@
goto done;
}
- storage_data = rb_str_new_static(data, data_size);
+ storage_data = rb_str_new(data, data_size);
- *exception_tag = bs_storage_to_output(handler, storage_data, output_data);
+ *exception_tag = bs_storage_to_output(handler, args, storage_data,
output_data);
ret = 0;
done:
if (data != NULL) xfree(data);
@@ -624,7 +632,7 @@
* - Return storage_to_output(storage_data)
*/
static VALUE
-bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler)
+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;
@@ -657,7 +665,7 @@
if (valid_cache) {
/* Fetch the cache data and return it if we're able to load it
successfully */
res = fetch_cached_data(
- cache_fd, (ssize_t)cached_key.data_size, handler,
+ cache_fd, (ssize_t)cached_key.data_size, handler, args,
&output_data, &exception_tag, &errno_provenance
);
if (exception_tag != 0) goto raise;
@@ -671,15 +679,15 @@
/* 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_static(contents, current_key.size);
+ input_data = rb_str_new(contents, current_key.size);
/* Try to compile the input_data using input_to_storage(input_data) */
- exception_tag = bs_input_to_storage(handler, input_data, path_v,
&storage_data);
+ exception_tag = bs_input_to_storage(handler, args, input_data, path_v,
&storage_data);
if (exception_tag != 0) goto raise;
/* If input_to_storage raised Bootsnap::CompileCache::Uncompilable, don't try
* to cache anything; just return input_to_output(input_data) */
if (storage_data == uncompilable) {
- bs_input_to_output(handler, input_data, &output_data, &exception_tag);
+ bs_input_to_output(handler, args, input_data, &output_data,
&exception_tag);
if (exception_tag != 0) goto raise;
goto succeed;
}
@@ -691,7 +699,7 @@
if (res < 0) goto fail_errno;
/* Having written the cache, now convert storage_data to output_data */
- exception_tag = bs_storage_to_output(handler, storage_data, &output_data);
+ exception_tag = bs_storage_to_output(handler, args, storage_data,
&output_data);
if (exception_tag != 0) goto raise;
/* If output_data is nil, delete the cache entry and generate the output
@@ -701,7 +709,7 @@
errno_provenance = "bs_fetch:unlink";
goto fail_errno;
}
- bs_input_to_output(handler, input_data, &output_data, &exception_tag);
+ bs_input_to_output(handler, args, input_data, &output_data,
&exception_tag);
if (exception_tag != 0) goto raise;
}
@@ -751,16 +759,19 @@
struct s2o_data {
VALUE handler;
+ VALUE args;
VALUE storage_data;
};
struct i2o_data {
VALUE handler;
+ VALUE args;
VALUE input_data;
};
struct i2s_data {
VALUE handler;
+ VALUE args;
VALUE input_data;
VALUE pathval;
};
@@ -769,15 +780,16 @@
prot_storage_to_output(VALUE arg)
{
struct s2o_data * data = (struct s2o_data *)arg;
- return rb_funcall(data->handler, rb_intern("storage_to_output"), 1,
data->storage_data);
+ return rb_funcall(data->handler, rb_intern("storage_to_output"), 2,
data->storage_data, data->args);
}
static int
-bs_storage_to_output(VALUE handler, VALUE storage_data, VALUE * output_data)
+bs_storage_to_output(VALUE handler, VALUE args, VALUE storage_data, VALUE *
output_data)
{
int state;
struct s2o_data s2o_data = {
.handler = handler,
+ .args = args,
.storage_data = storage_data,
};
*output_data = rb_protect(prot_storage_to_output, (VALUE)&s2o_data, &state);
@@ -785,10 +797,11 @@
}
static void
-bs_input_to_output(VALUE handler, VALUE input_data, VALUE * output_data, int *
exception_tag)
+bs_input_to_output(VALUE handler, VALUE args, VALUE input_data, VALUE *
output_data, int * exception_tag)
{
struct i2o_data i2o_data = {
.handler = handler,
+ .args = args,
.input_data = input_data,
};
*output_data = rb_protect(prot_input_to_output, (VALUE)&i2o_data,
exception_tag);
@@ -798,14 +811,14 @@
prot_input_to_output(VALUE arg)
{
struct i2o_data * data = (struct i2o_data *)arg;
- return rb_funcall(data->handler, rb_intern("input_to_output"), 1,
data->input_data);
+ return rb_funcall(data->handler, rb_intern("input_to_output"), 2,
data->input_data, data->args);
}
static VALUE
try_input_to_storage(VALUE arg)
{
struct i2s_data * data = (struct i2s_data *)arg;
- return rb_funcall(data->handler, rb_intern("input_to_storage"), 2,
data->input_data, data->pathval);
+ return rb_funcall(data->handler, rb_intern("input_to_storage"), 3,
data->input_data, data->pathval, data->args);
}
static VALUE
@@ -825,11 +838,12 @@
}
static int
-bs_input_to_storage(VALUE handler, VALUE input_data, VALUE pathval, VALUE *
storage_data)
+bs_input_to_storage(VALUE handler, VALUE args, VALUE input_data, VALUE
pathval, VALUE * storage_data)
{
int state;
struct i2s_data i2s_data = {
.handler = handler,
+ .args = args,
.input_data = input_data,
.pathval = pathval,
};
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 2020-08-11 19:32:52.000000000
+0200
+++ new/lib/bootsnap/compile_cache/iseq.rb 2020-10-26 19:22:04.000000000
+0100
@@ -9,13 +9,13 @@
attr_accessor(:cache_dir)
end
- def self.input_to_storage(_, path)
+ def self.input_to_storage(_, path, _args)
RubyVM::InstructionSequence.compile_file(path).to_binary
rescue SyntaxError
raise(Uncompilable, 'syntax error')
end
- def self.storage_to_output(binary)
+ def self.storage_to_output(binary, _args)
RubyVM::InstructionSequence.load_from_binary(binary)
rescue RuntimeError => e
if e.message == 'broken binary format'
@@ -26,7 +26,7 @@
end
end
- def self.input_to_output(_)
+ def self.input_to_output(_, _)
nil # ruby handles this
end
@@ -38,7 +38,8 @@
Bootsnap::CompileCache::Native.fetch(
Bootsnap::CompileCache::ISeq.cache_dir,
path.to_s,
- Bootsnap::CompileCache::ISeq
+ Bootsnap::CompileCache::ISeq,
+ nil,
)
rescue Errno::EACCES
Bootsnap::CompileCache.permission_error(path)
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 2020-08-11 19:32:52.000000000
+0200
+++ new/lib/bootsnap/compile_cache/yaml.rb 2020-10-26 19:22:04.000000000
+0100
@@ -5,56 +5,84 @@
module CompileCache
module YAML
class << self
- attr_accessor(:msgpack_factory)
- end
+ attr_accessor(:msgpack_factory, :cache_dir, :supported_options)
- def self.input_to_storage(contents, _)
- raise(Uncompilable) if contents.index("!ruby/object")
- obj = ::YAML.load(contents)
- msgpack_factory.packer.write(obj).to_s
- rescue NoMethodError, RangeError
- # if the object included things that we can't serialize, fall back to
- # Marshal. It's a bit slower, but can encode anything yaml can.
- # NoMethodError is unexpected types; RangeError is Bignums
- Marshal.dump(obj)
- end
+ def input_to_storage(contents, _, kwargs)
+ raise(Uncompilable) if contents.index("!ruby/object")
+ obj = ::YAML.load(contents, **(kwargs || {}))
+ msgpack_factory.dump(obj)
+ rescue NoMethodError, RangeError
+ # if the object included things that we can't serialize, fall back to
+ # Marshal. It's a bit slower, but can encode anything yaml can.
+ # NoMethodError is unexpected types; RangeError is Bignums
+ Marshal.dump(obj)
+ end
- def self.storage_to_output(data)
- # This could have a meaning in messagepack, and we're being a little
lazy
- # about it. -- but a leading 0x04 would indicate the contents of the
YAML
- # is a positive integer, which is rare, to say the least.
- if data[0] == 0x04.chr && data[1] == 0x08.chr
- Marshal.load(data)
- else
- msgpack_factory.unpacker.feed(data).read
+ def storage_to_output(data, kwargs)
+ # This could have a meaning in messagepack, and we're being a little
lazy
+ # about it. -- but a leading 0x04 would indicate the contents of the
YAML
+ # is a positive integer, which is rare, to say the least.
+ if data[0] == 0x04.chr && data[1] == 0x08.chr
+ Marshal.load(data)
+ else
+ msgpack_factory.load(data, **(kwargs || {}))
+ end
+ end
+
+ def input_to_output(data, kwargs)
+ ::YAML.load(data, **(kwargs || {}))
end
- end
- def self.input_to_output(data)
- ::YAML.load(data)
+ def install!(cache_dir)
+ self.cache_dir = cache_dir
+ init!
+ ::YAML.singleton_class.prepend(Patch)
+ end
+
+ def init!
+ require('yaml')
+ require('msgpack')
+
+ # MessagePack serializes symbols as strings by default.
+ # We want them to roundtrip cleanly, so we use a custom factory.
+ # see: https://github.com/msgpack/msgpack-ruby/pull/122
+ factory = MessagePack::Factory.new
+ factory.register_type(0x00, Symbol)
+ self.msgpack_factory = factory
+
+ self.supported_options = []
+ params = ::YAML.method(:load).parameters
+ if params.include?([:key, :symbolize_names])
+ self.supported_options << :symbolize_names
+ end
+ if params.include?([:key, :freeze])
+ if factory.load(factory.dump('yaml'), freeze: true).frozen?
+ self.supported_options << :freeze
+ end
+ end
+ self.supported_options.freeze
+ end
end
- def self.install!(cache_dir)
- require('yaml')
- require('msgpack')
-
- # MessagePack serializes symbols as strings by default.
- # We want them to roundtrip cleanly, so we use a custom factory.
- # see: https://github.com/msgpack/msgpack-ruby/pull/122
- factory = MessagePack::Factory.new
- factory.register_type(0x00, Symbol)
- Bootsnap::CompileCache::YAML.msgpack_factory = factory
+ module Patch
+ extend self
+
+ def load_file(path, *args)
+ return super if args.size > 1
+ if kwargs = args.first
+ return super unless kwargs.is_a?(Hash)
+ return super unless (kwargs.keys -
::Bootsnap::CompileCache::YAML.supported_options).empty?
+ end
- klass = class << ::YAML; self; end
- klass.send(:define_method, :load_file) do |path|
begin
- Bootsnap::CompileCache::Native.fetch(
- cache_dir,
+ ::Bootsnap::CompileCache::Native.fetch(
+ Bootsnap::CompileCache::YAML.cache_dir,
path,
- Bootsnap::CompileCache::YAML
+ ::Bootsnap::CompileCache::YAML,
+ kwargs,
)
rescue Errno::EACCES
- Bootsnap::CompileCache.permission_error(path)
+ ::Bootsnap::CompileCache.permission_error(path)
end
end
end
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 2020-08-11 19:32:52.000000000 +0200
+++ new/lib/bootsnap/compile_cache.rb 2020-10-26 19:22:04.000000000 +0100
@@ -34,9 +34,9 @@
end
def self.supported?
- # only enable on 'ruby' (MRI), POSIX (darwin, linux, *bsd), and >= 2.3.0
+ # only enable on 'ruby' (MRI), POSIX (darwin, linux, *bsd), Windows
(RubyInstaller2) and >= 2.3.0
RUBY_ENGINE == 'ruby' &&
- RUBY_PLATFORM =~ /darwin|linux|bsd/ &&
+ RUBY_PLATFORM =~ /darwin|linux|bsd|mswin|mingw|cygwin/ &&
Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.3.0")
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 2020-08-11 19:32:52.000000000 +0200
+++ new/lib/bootsnap/load_path_cache.rb 2020-10-26 19:22:04.000000000 +0100
@@ -61,7 +61,7 @@
def supported?
RUBY_ENGINE == 'ruby' &&
- RUBY_PLATFORM =~ /darwin|linux|bsd/
+ RUBY_PLATFORM =~ /darwin|linux|bsd|mswin|mingw|cygwin/
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 2020-08-11 19:32:52.000000000 +0200
+++ new/lib/bootsnap/version.rb 2020-10-26 19:22:04.000000000 +0100
@@ -1,4 +1,4 @@
# frozen_string_literal: true
module Bootsnap
- VERSION = "1.4.8"
+ VERSION = "1.4.9"
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2020-08-11 19:32:52.000000000 +0200
+++ new/metadata 2020-10-26 19:22:04.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: bootsnap
version: !ruby/object:Gem::Version
- version: 1.4.8
+ version: 1.4.9
platform: ruby
authors:
- Burke Libbey
autorequire:
bindir: bin
cert_chain: []
-date: 2020-08-11 00:00:00.000000000 Z
+date: 2020-10-26 00:00:00.000000000 Z
dependencies:
- !ruby/object:Gem::Dependency
name: bundler
@@ -134,6 +134,7 @@
bug_tracker_uri: https://github.com/Shopify/bootsnap/issues
changelog_uri: https://github.com/Shopify/bootsnap/blob/master/CHANGELOG.md
source_code_uri: https://github.com/Shopify/bootsnap
+ allowed_push_host: https://rubygems.org
post_install_message:
rdoc_options: []
require_paths:
@@ -149,7 +150,7 @@
- !ruby/object:Gem::Version
version: '0'
requirements: []
-rubygems_version: 3.0.2
+rubygems_version: 3.0.3
signing_key:
specification_version: 4
summary: Boot large ruby/rails apps faster