bootsnap 1.4.5-java → 1.4.6-java
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/.rubocop.yml +1 -1
- data/Gemfile +1 -0
- data/README.jp.md +1 -1
- data/README.md +1 -1
- data/Rakefile +1 -0
- data/bin/console +1 -0
- data/bootsnap.gemspec +2 -1
- data/ext/bootsnap/bootsnap.c +33 -29
- data/ext/bootsnap/extconf.rb +1 -0
- data/lib/bootsnap.rb +1 -0
- data/lib/bootsnap/bundler.rb +1 -0
- data/lib/bootsnap/compile_cache.rb +1 -0
- data/lib/bootsnap/compile_cache/iseq.rb +1 -0
- data/lib/bootsnap/compile_cache/yaml.rb +1 -0
- data/lib/bootsnap/explicit_require.rb +1 -0
- data/lib/bootsnap/load_path_cache/cache.rb +2 -2
- data/lib/bootsnap/load_path_cache/change_observer.rb +1 -0
- data/lib/bootsnap/load_path_cache/core_ext/active_support.rb +1 -0
- data/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb +2 -1
- data/lib/bootsnap/load_path_cache/core_ext/loaded_features.rb +1 -0
- data/lib/bootsnap/load_path_cache/loaded_features_index.rb +32 -9
- data/lib/bootsnap/load_path_cache/path.rb +1 -0
- data/lib/bootsnap/load_path_cache/store.rb +6 -5
- data/lib/bootsnap/setup.rb +1 -0
- data/lib/bootsnap/version.rb +2 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 1bc6287c7bacc07db2b707a99dac5e6cd0b3a5b1
|
4
|
+
data.tar.gz: 98d79072d34f986dc1caa38aee469cbc070bd334
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f823dc1c7a10d57b4cefac71dbca6a4b94d8fd0015a69c194cb7ea47ac28fc9694888533d7de58b8a7adedab0b779ac422d389a669690f880afeff9bb3b6487b
|
7
|
+
data.tar.gz: 9d80f121235529847a427b286772b758c5efa14e208799f3761502b521a84b44e495d7c5024f1acc2d70bb8071d95e2d12a05e043ec57668d2edce20f9504fd7
|
data/.rubocop.yml
CHANGED
data/Gemfile
CHANGED
data/README.jp.md
CHANGED
@@ -152,7 +152,7 @@ close n
|
|
152
152
|
Bootsnap は、64バイトのヘッダーとそれに続くキャッシュの内容を含んだキャッシュファイルを書き込みます。ヘッダーは、次のいくつかのフィールドで構成されるキャッシュキーです。
|
153
153
|
|
154
154
|
- `version`、Bootsnapにハードコードされる基本的なスキーマのバージョン
|
155
|
-
- `
|
155
|
+
- `ruby_platform`、`RUBY_PLATFORM`(x86_64-linux-gnuなど)変数とglibcバージョン(Linuxの場合)またはOSバージョン(BSD、macOSの場合は` uname -v`)のハッシュ
|
156
156
|
- `compile_option`、`RubyVM::InstructionSequence.compile_option` の返り値
|
157
157
|
- `ruby_revision`、コンパイルされたRubyのバージョン
|
158
158
|
- `size`、ソースファイルのサイズ
|
data/README.md
CHANGED
@@ -214,7 +214,7 @@ Bootsnap writes a cache file containing a 64 byte header followed by the cache c
|
|
214
214
|
is a cache key including several fields:
|
215
215
|
|
216
216
|
* `version`, hardcoded in bootsnap. Essentially a schema version;
|
217
|
-
* `
|
217
|
+
* `ruby_platform`, A hash of `RUBY_PLATFORM` (e.g. x86_64-linux-gnu) variable and glibc version (on Linux) or OS version (`uname -v` on BSD, macOS)
|
218
218
|
* `compile_option`, which changes with `RubyVM::InstructionSequence.compile_option` does;
|
219
219
|
* `ruby_revision`, the version of Ruby this was compiled with;
|
220
220
|
* `size`, the size of the source file;
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/bootsnap.gemspec
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
# coding: utf-8
|
2
|
+
# frozen_string_literal: true
|
2
3
|
lib = File.expand_path('../lib', __FILE__)
|
3
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
5
|
require('bootsnap/version')
|
@@ -26,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
26
27
|
end
|
27
28
|
spec.require_paths = %w(lib)
|
28
29
|
|
29
|
-
spec.required_ruby_version = '>= 2.
|
30
|
+
spec.required_ruby_version = '>= 2.3.0'
|
30
31
|
|
31
32
|
if RUBY_PLATFORM =~ /java/
|
32
33
|
spec.platform = 'java'
|
data/ext/bootsnap/bootsnap.c
CHANGED
@@ -21,6 +21,9 @@
|
|
21
21
|
#ifndef _WIN32
|
22
22
|
#include <sys/utsname.h>
|
23
23
|
#endif
|
24
|
+
#ifdef __GLIBC__
|
25
|
+
#include <gnu/libc-version.h>
|
26
|
+
#endif
|
24
27
|
|
25
28
|
/* 1000 is an arbitrary limit; FNV64 plus some slashes brings the cap down to
|
26
29
|
* 981 for the cache dir */
|
@@ -90,12 +93,12 @@ static VALUE bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handl
|
|
90
93
|
|
91
94
|
/* Helpers */
|
92
95
|
static uint64_t fnv1a_64(const char *str);
|
93
|
-
static void bs_cache_path(const char * cachedir, const char * path, char
|
96
|
+
static void bs_cache_path(const char * cachedir, const char * path, char (* cache_path)[MAX_CACHEPATH_SIZE]);
|
94
97
|
static int bs_read_key(int fd, struct bs_cache_key * key);
|
95
98
|
static int cache_key_equal(struct bs_cache_key * k1, struct bs_cache_key * k2);
|
96
99
|
static VALUE bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler);
|
97
|
-
static int open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenance);
|
98
|
-
static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, char ** errno_provenance);
|
100
|
+
static int open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance);
|
101
|
+
static int fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, const char ** errno_provenance);
|
99
102
|
static uint32_t get_ruby_revision(void);
|
100
103
|
static uint32_t get_ruby_platform(void);
|
101
104
|
|
@@ -236,6 +239,9 @@ get_ruby_platform(void)
|
|
236
239
|
|
237
240
|
#ifdef _WIN32
|
238
241
|
return (uint32_t)(hash >> 32) ^ (uint32_t)GetVersion();
|
242
|
+
#elif defined(__GLIBC__)
|
243
|
+
hash = fnv1a_64_iter(hash, gnu_get_libc_version());
|
244
|
+
return (uint32_t)(hash >> 32);
|
239
245
|
#else
|
240
246
|
struct utsname utsname;
|
241
247
|
|
@@ -256,7 +262,7 @@ get_ruby_platform(void)
|
|
256
262
|
* The path will look something like: <cachedir>/12/34567890abcdef
|
257
263
|
*/
|
258
264
|
static void
|
259
|
-
bs_cache_path(const char * cachedir, const char * path, char
|
265
|
+
bs_cache_path(const char * cachedir, const char * path, char (* cache_path)[MAX_CACHEPATH_SIZE])
|
260
266
|
{
|
261
267
|
uint64_t hash = fnv1a_64(path);
|
262
268
|
|
@@ -308,10 +314,8 @@ bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
|
|
308
314
|
char * path = RSTRING_PTR(path_v);
|
309
315
|
char cache_path[MAX_CACHEPATH_SIZE];
|
310
316
|
|
311
|
-
|
312
|
-
|
313
|
-
bs_cache_path(cachedir, path, &tmp);
|
314
|
-
}
|
317
|
+
/* generate cache path to cache_path */
|
318
|
+
bs_cache_path(cachedir, path, &cache_path);
|
315
319
|
|
316
320
|
return bs_fetch(path, path_v, cache_path, handler);
|
317
321
|
}
|
@@ -321,14 +325,14 @@ bs_rb_fetch(VALUE self, VALUE cachedir_v, VALUE path_v, VALUE handler)
|
|
321
325
|
* was loaded.
|
322
326
|
*/
|
323
327
|
static int
|
324
|
-
open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenance)
|
328
|
+
open_current_file(char * path, struct bs_cache_key * key, const char ** errno_provenance)
|
325
329
|
{
|
326
330
|
struct stat statbuf;
|
327
331
|
int fd;
|
328
332
|
|
329
333
|
fd = open(path, O_RDONLY);
|
330
334
|
if (fd < 0) {
|
331
|
-
*errno_provenance =
|
335
|
+
*errno_provenance = "bs_fetch:open_current_file:open";
|
332
336
|
return fd;
|
333
337
|
}
|
334
338
|
#ifdef _WIN32
|
@@ -336,7 +340,7 @@ open_current_file(char * path, struct bs_cache_key * key, char ** errno_provenan
|
|
336
340
|
#endif
|
337
341
|
|
338
342
|
if (fstat(fd, &statbuf) < 0) {
|
339
|
-
*errno_provenance =
|
343
|
+
*errno_provenance = "bs_fetch:open_current_file:fstat";
|
340
344
|
close(fd);
|
341
345
|
return -1;
|
342
346
|
}
|
@@ -382,13 +386,13 @@ bs_read_key(int fd, struct bs_cache_key * key)
|
|
382
386
|
* - ERROR_WITH_ERRNO (-1, errno is set)
|
383
387
|
*/
|
384
388
|
static int
|
385
|
-
open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_provenance)
|
389
|
+
open_cache_file(const char * path, struct bs_cache_key * key, const char ** errno_provenance)
|
386
390
|
{
|
387
391
|
int fd, res;
|
388
392
|
|
389
393
|
fd = open(path, O_RDONLY);
|
390
394
|
if (fd < 0) {
|
391
|
-
*errno_provenance =
|
395
|
+
*errno_provenance = "bs_fetch:open_cache_file:open";
|
392
396
|
if (errno == ENOENT) return CACHE_MISSING_OR_INVALID;
|
393
397
|
return ERROR_WITH_ERRNO;
|
394
398
|
}
|
@@ -398,7 +402,7 @@ open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_prov
|
|
398
402
|
|
399
403
|
res = bs_read_key(fd, key);
|
400
404
|
if (res < 0) {
|
401
|
-
*errno_provenance =
|
405
|
+
*errno_provenance = "bs_fetch:open_cache_file:read";
|
402
406
|
close(fd);
|
403
407
|
return res;
|
404
408
|
}
|
@@ -422,7 +426,7 @@ open_cache_file(const char * path, struct bs_cache_key * key, char ** errno_prov
|
|
422
426
|
* or exception, will be the final data returnable to the user.
|
423
427
|
*/
|
424
428
|
static int
|
425
|
-
fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, char ** errno_provenance)
|
429
|
+
fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data, int * exception_tag, const char ** errno_provenance)
|
426
430
|
{
|
427
431
|
char * data = NULL;
|
428
432
|
ssize_t nread;
|
@@ -431,7 +435,7 @@ fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data,
|
|
431
435
|
VALUE storage_data;
|
432
436
|
|
433
437
|
if (data_size > 100000000000) {
|
434
|
-
*errno_provenance =
|
438
|
+
*errno_provenance = "bs_fetch:fetch_cached_data:datasize";
|
435
439
|
errno = EINVAL; /* because wtf? */
|
436
440
|
ret = -1;
|
437
441
|
goto done;
|
@@ -439,7 +443,7 @@ fetch_cached_data(int fd, ssize_t data_size, VALUE handler, VALUE * output_data,
|
|
439
443
|
data = ALLOC_N(char, data_size);
|
440
444
|
nread = read(fd, data, data_size);
|
441
445
|
if (nread < 0) {
|
442
|
-
*errno_provenance =
|
446
|
+
*errno_provenance = "bs_fetch:fetch_cached_data:read";
|
443
447
|
ret = -1;
|
444
448
|
goto done;
|
445
449
|
}
|
@@ -491,7 +495,7 @@ mkpath(char * file_path, mode_t mode)
|
|
491
495
|
* path.
|
492
496
|
*/
|
493
497
|
static int
|
494
|
-
atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char ** errno_provenance)
|
498
|
+
atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, const char ** errno_provenance)
|
495
499
|
{
|
496
500
|
char template[MAX_CACHEPATH_SIZE + 20];
|
497
501
|
char * tmp_path;
|
@@ -505,12 +509,12 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
|
|
505
509
|
fd = mkstemp(tmp_path);
|
506
510
|
if (fd < 0) {
|
507
511
|
if (mkpath(tmp_path, 0775) < 0) {
|
508
|
-
*errno_provenance =
|
512
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:mkpath";
|
509
513
|
return -1;
|
510
514
|
}
|
511
515
|
fd = open(tmp_path, O_WRONLY | O_CREAT, 0664);
|
512
516
|
if (fd < 0) {
|
513
|
-
*errno_provenance =
|
517
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:open";
|
514
518
|
return -1;
|
515
519
|
}
|
516
520
|
}
|
@@ -521,11 +525,11 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
|
|
521
525
|
key->data_size = RSTRING_LEN(data);
|
522
526
|
nwrite = write(fd, key, KEY_SIZE);
|
523
527
|
if (nwrite < 0) {
|
524
|
-
*errno_provenance =
|
528
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:write";
|
525
529
|
return -1;
|
526
530
|
}
|
527
531
|
if (nwrite != KEY_SIZE) {
|
528
|
-
*errno_provenance =
|
532
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:keysize";
|
529
533
|
errno = EIO; /* Lies but whatever */
|
530
534
|
return -1;
|
531
535
|
}
|
@@ -533,7 +537,7 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
|
|
533
537
|
nwrite = write(fd, RSTRING_PTR(data), RSTRING_LEN(data));
|
534
538
|
if (nwrite < 0) return -1;
|
535
539
|
if (nwrite != RSTRING_LEN(data)) {
|
536
|
-
*errno_provenance =
|
540
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:writelength";
|
537
541
|
errno = EIO; /* Lies but whatever */
|
538
542
|
return -1;
|
539
543
|
}
|
@@ -541,12 +545,12 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
|
|
541
545
|
close(fd);
|
542
546
|
ret = rename(tmp_path, path);
|
543
547
|
if (ret < 0) {
|
544
|
-
*errno_provenance =
|
548
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:rename";
|
545
549
|
return -1;
|
546
550
|
}
|
547
551
|
ret = chmod(path, 0664 & ~current_umask);
|
548
552
|
if (ret < 0) {
|
549
|
-
*errno_provenance =
|
553
|
+
*errno_provenance = "bs_fetch:atomic_write_cache_file:chmod";
|
550
554
|
}
|
551
555
|
return ret;
|
552
556
|
}
|
@@ -555,13 +559,13 @@ atomic_write_cache_file(char * path, struct bs_cache_key * key, VALUE data, char
|
|
555
559
|
/* Read contents from an fd, whose contents are asserted to be +size+ bytes
|
556
560
|
* long, into a buffer */
|
557
561
|
static ssize_t
|
558
|
-
bs_read_contents(int fd, size_t size, char ** contents, char ** errno_provenance)
|
562
|
+
bs_read_contents(int fd, size_t size, char ** contents, const char ** errno_provenance)
|
559
563
|
{
|
560
564
|
ssize_t nread;
|
561
565
|
*contents = ALLOC_N(char, size);
|
562
566
|
nread = read(fd, *contents, size);
|
563
567
|
if (nread < 0) {
|
564
|
-
*errno_provenance =
|
568
|
+
*errno_provenance = "bs_fetch:bs_read_contents:read";
|
565
569
|
}
|
566
570
|
return nread;
|
567
571
|
}
|
@@ -617,7 +621,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler)
|
|
617
621
|
char * contents = NULL;
|
618
622
|
int cache_fd = -1, current_fd = -1;
|
619
623
|
int res, valid_cache = 0, exception_tag = 0;
|
620
|
-
char * errno_provenance = NULL;
|
624
|
+
const char * errno_provenance = NULL;
|
621
625
|
|
622
626
|
VALUE input_data; /* data read from source file, e.g. YAML or ruby source */
|
623
627
|
VALUE storage_data; /* compiled data, e.g. msgpack / binary iseq */
|
@@ -685,7 +689,7 @@ bs_fetch(char * path, VALUE path_v, char * cache_path, VALUE handler)
|
|
685
689
|
* using input_to_output */
|
686
690
|
if (NIL_P(output_data)) {
|
687
691
|
if (unlink(cache_path) < 0) {
|
688
|
-
errno_provenance =
|
692
|
+
errno_provenance = "bs_fetch:unlink";
|
689
693
|
goto fail_errno;
|
690
694
|
}
|
691
695
|
bs_input_to_output(handler, input_data, &output_data, &exception_tag);
|
data/ext/bootsnap/extconf.rb
CHANGED
data/lib/bootsnap.rb
CHANGED
data/lib/bootsnap/bundler.rb
CHANGED
@@ -67,7 +67,7 @@ module Bootsnap
|
|
67
67
|
# native dynamic extension, e.g. .bundle or .so), we know it was a
|
68
68
|
# failure and there's nothing more we can do to find the file.
|
69
69
|
# no extension, .rb, (.bundle or .so)
|
70
|
-
when '', *CACHED_EXTENSIONS
|
70
|
+
when '', *CACHED_EXTENSIONS
|
71
71
|
nil
|
72
72
|
# Ruby allows specifying native extensions as '.so' even when DLEXT
|
73
73
|
# is '.bundle'. This is where we handle that case.
|
@@ -144,7 +144,7 @@ module Bootsnap
|
|
144
144
|
expanded_path = p.expanded_path
|
145
145
|
entries, dirs = p.entries_and_dirs(@store)
|
146
146
|
# push -> low precedence -> set only if unset
|
147
|
-
dirs.each { |dir| @dirs[dir]
|
147
|
+
dirs.each { |dir| @dirs[dir] ||= path }
|
148
148
|
entries.each { |rel| @index[rel] ||= expanded_path }
|
149
149
|
end
|
150
150
|
end
|
@@ -1,8 +1,9 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
module Bootsnap
|
2
3
|
module LoadPathCache
|
3
4
|
module CoreExt
|
4
5
|
def self.make_load_error(path)
|
5
|
-
err = LoadError.new("cannot load such file -- #{path}")
|
6
|
+
err = LoadError.new(+"cannot load such file -- #{path}")
|
6
7
|
err.instance_variable_set(Bootsnap::LoadPathCache::ERROR_TAG_IVAR, true)
|
7
8
|
err.define_singleton_method(:path) { path }
|
8
9
|
err
|
@@ -40,7 +40,7 @@ module Bootsnap
|
|
40
40
|
# /a/b/lib/my/foo.rb
|
41
41
|
# ^^^^^^^^^
|
42
42
|
short = feat[(lpe.length + 1)..-1]
|
43
|
-
stripped =
|
43
|
+
stripped = strip_extension_if_elidable(short)
|
44
44
|
@lfi[short] = hash
|
45
45
|
@lfi[stripped] = hash
|
46
46
|
end
|
@@ -94,13 +94,14 @@ module Bootsnap
|
|
94
94
|
|
95
95
|
hash = long.hash
|
96
96
|
|
97
|
-
#
|
98
|
-
|
99
|
-
|
100
|
-
|
97
|
+
# Do we have a filename with an elidable extension, e.g.,
|
98
|
+
# 'bundler.rb', or 'libgit2.so'?
|
99
|
+
altname = if extension_elidable?(short)
|
100
|
+
# Strip the extension off, e.g. 'bundler.rb' -> 'bundler'.
|
101
|
+
strip_extension_if_elidable(short)
|
101
102
|
elsif long && (ext = File.extname(long))
|
102
|
-
#
|
103
|
-
#
|
103
|
+
# We already know the extension of the actual file this
|
104
|
+
# resolves to, so put that back on.
|
104
105
|
short + ext
|
105
106
|
end
|
106
107
|
|
@@ -117,8 +118,30 @@ module Bootsnap
|
|
117
118
|
STRIP_EXTENSION = /\.[^.]*?$/
|
118
119
|
private_constant(:STRIP_EXTENSION)
|
119
120
|
|
120
|
-
|
121
|
-
|
121
|
+
# Might Ruby automatically search for this extension if
|
122
|
+
# someone tries to 'require' the file without it? E.g. Ruby
|
123
|
+
# will implicitly try 'x.rb' if you ask for 'x'.
|
124
|
+
#
|
125
|
+
# This is complex and platform-dependent, and the Ruby docs are a little
|
126
|
+
# handwavy about what will be tried when and in what order.
|
127
|
+
# So optimistically pretend that all known elidable extensions
|
128
|
+
# will be tried on all platforms, and that people are unlikely
|
129
|
+
# to name files in a way that assumes otherwise.
|
130
|
+
# (E.g. It's unlikely that someone will know that their code
|
131
|
+
# will _never_ run on MacOS, and therefore think they can get away
|
132
|
+
# with callling a Ruby file 'x.dylib.rb' and then requiring it as 'x.dylib'.)
|
133
|
+
#
|
134
|
+
# See <https://ruby-doc.org/core-2.6.4/Kernel.html#method-i-require>.
|
135
|
+
def extension_elidable?(f)
|
136
|
+
f.to_s.end_with?('.rb', '.so', '.o', '.dll', '.dylib')
|
137
|
+
end
|
138
|
+
|
139
|
+
def strip_extension_if_elidable(f)
|
140
|
+
if extension_elidable?(f)
|
141
|
+
f.sub(STRIP_EXTENSION, '')
|
142
|
+
else
|
143
|
+
f
|
144
|
+
end
|
122
145
|
end
|
123
146
|
end
|
124
147
|
end
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require_relative('../explicit_require')
|
2
3
|
|
3
4
|
Bootsnap::ExplicitRequire.with_gems('msgpack') { require('msgpack') }
|
@@ -63,11 +64,11 @@ module Bootsnap
|
|
63
64
|
def load_data
|
64
65
|
@data = begin
|
65
66
|
MessagePack.load(File.binread(@store_path))
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
67
|
+
# handle malformed data due to upgrade incompatability
|
68
|
+
rescue Errno::ENOENT, MessagePack::MalformedFormatError, MessagePack::UnknownExtTypeError, EOFError
|
69
|
+
{}
|
70
|
+
rescue ArgumentError => e
|
71
|
+
e.message =~ /negative array size/ ? {} : raise
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
data/lib/bootsnap/setup.rb
CHANGED
data/lib/bootsnap/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bootsnap
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.6
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -159,14 +159,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
159
159
|
requirements:
|
160
160
|
- - ">="
|
161
161
|
- !ruby/object:Gem::Version
|
162
|
-
version: 2.
|
162
|
+
version: 2.3.0
|
163
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
164
|
requirements:
|
165
165
|
- - ">="
|
166
166
|
- !ruby/object:Gem::Version
|
167
167
|
version: '0'
|
168
168
|
requirements: []
|
169
|
-
|
169
|
+
rubyforge_project:
|
170
|
+
rubygems_version: 2.4.8
|
170
171
|
signing_key:
|
171
172
|
specification_version: 4
|
172
173
|
summary: Boot large ruby/rails apps faster
|