bootsnap 1.7.5 → 1.8.1
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 +4 -4
- data/CHANGELOG.md +17 -0
- data/lib/bootsnap/cli/worker_pool.rb +5 -1
- data/lib/bootsnap/compile_cache/yaml.rb +33 -1
- data/lib/bootsnap/load_path_cache/change_observer.rb +2 -0
- data/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb +2 -1
- data/lib/bootsnap/load_path_cache/loaded_features_index.rb +2 -2
- data/lib/bootsnap/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4565db3033321cbf9866e33e0d42021d76f164974154bfb62dc9bcb02082763c
|
4
|
+
data.tar.gz: 48424a914d66bebe2029e2bbdb86aef1c0d684a9a773f219a54b4c2675aec0b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05732a91a5437872eb83b96fcf1fa2db302acf599a53ca5a25c5ef9b628eef780051173f5081261a2491798ea71a005af180504da19707a09c52692eb01d65c3
|
7
|
+
data.tar.gz: b19e9db48806a6cee08f9de5268c81fb235d577e8771f6acb238843a507856cb120fce3d63bec7d4664d4c88ea60f01ebb7acd8545ffa10291a3157dd25ebf89
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,22 @@
|
|
1
1
|
# Unreleased
|
2
2
|
|
3
|
+
# 1.8.1
|
4
|
+
|
5
|
+
* Fixed support for older Psych. (#369)
|
6
|
+
|
7
|
+
# 1.8.0
|
8
|
+
|
9
|
+
* Improve support for Pysch 4. (#368)
|
10
|
+
|
11
|
+
# 1.7.7
|
12
|
+
|
13
|
+
* Fix `require_relative` in evaled code on latest ruby 3.1.0-dev. (#366)
|
14
|
+
|
15
|
+
# 1.7.6
|
16
|
+
|
17
|
+
* Fix reliance on `set` to be required.
|
18
|
+
* Fix `Encoding::UndefinedConversionError` error for Rails applications when precompiling cache. (#364)
|
19
|
+
|
3
20
|
# 1.7.5
|
4
21
|
|
5
22
|
* Handle a regression of Ruby 2.7.3 causing Bootsnap to call the deprecated `untaint` method. (#360)
|
@@ -37,7 +37,11 @@ module Bootsnap
|
|
37
37
|
|
38
38
|
def initialize(jobs)
|
39
39
|
@jobs = jobs
|
40
|
-
@pipe_out, @to_io = IO.pipe
|
40
|
+
@pipe_out, @to_io = IO.pipe(binmode: true)
|
41
|
+
# Set the writer encoding to binary since IO.pipe only sets it for the reader.
|
42
|
+
# https://github.com/rails/rails/issues/16514#issuecomment-52313290
|
43
|
+
@to_io.set_encoding(Encoding::BINARY)
|
44
|
+
|
41
45
|
@pid = nil
|
42
46
|
end
|
43
47
|
|
@@ -23,7 +23,11 @@ module Bootsnap
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def input_to_output(data, kwargs)
|
26
|
-
::YAML.
|
26
|
+
if ::YAML.respond_to?(:unsafe_load)
|
27
|
+
::YAML.unsafe_load(data, **(kwargs || {}))
|
28
|
+
else
|
29
|
+
::YAML.load(data, **(kwargs || {}))
|
30
|
+
end
|
27
31
|
end
|
28
32
|
|
29
33
|
def strict_load(payload, *args)
|
@@ -52,6 +56,13 @@ module Bootsnap
|
|
52
56
|
require('msgpack')
|
53
57
|
require('date')
|
54
58
|
|
59
|
+
if Patch.method_defined?(:unsafe_load_file) && !::YAML.respond_to?(:unsafe_load_file)
|
60
|
+
Patch.send(:remove_method, :unsafe_load_file)
|
61
|
+
end
|
62
|
+
if Patch.method_defined?(:load_file) && ::YAML::VERSION >= '4'
|
63
|
+
Patch.send(:remove_method, :load_file)
|
64
|
+
end
|
65
|
+
|
55
66
|
# MessagePack serializes symbols as strings by default.
|
56
67
|
# We want them to roundtrip cleanly, so we use a custom factory.
|
57
68
|
# see: https://github.com/msgpack/msgpack-ruby/pull/122
|
@@ -126,6 +137,27 @@ module Bootsnap
|
|
126
137
|
end
|
127
138
|
|
128
139
|
ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
|
140
|
+
|
141
|
+
def unsafe_load_file(path, *args)
|
142
|
+
return super if args.size > 1
|
143
|
+
if kwargs = args.first
|
144
|
+
return super unless kwargs.is_a?(Hash)
|
145
|
+
return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
|
146
|
+
end
|
147
|
+
|
148
|
+
begin
|
149
|
+
::Bootsnap::CompileCache::Native.fetch(
|
150
|
+
Bootsnap::CompileCache::YAML.cache_dir,
|
151
|
+
File.realpath(path),
|
152
|
+
::Bootsnap::CompileCache::YAML,
|
153
|
+
kwargs,
|
154
|
+
)
|
155
|
+
rescue Errno::EACCES
|
156
|
+
::Bootsnap::CompileCache.permission_error(path)
|
157
|
+
end
|
158
|
+
end
|
159
|
+
|
160
|
+
ruby2_keywords :unsafe_load_file if respond_to?(:ruby2_keywords, true)
|
129
161
|
end
|
130
162
|
end
|
131
163
|
end
|
@@ -15,11 +15,13 @@ module Bootsnap
|
|
15
15
|
@lpc_observer.push_paths(self, *entries.map(&:to_s))
|
16
16
|
super
|
17
17
|
end
|
18
|
+
alias_method :append, :push
|
18
19
|
|
19
20
|
def unshift(*entries)
|
20
21
|
@lpc_observer.unshift_paths(self, *entries.map(&:to_s))
|
21
22
|
super
|
22
23
|
end
|
24
|
+
alias_method :prepend, :unshift
|
23
25
|
|
24
26
|
def concat(entries)
|
25
27
|
@lpc_observer.push_paths(self, *entries.map(&:to_s))
|
@@ -47,8 +47,9 @@ module Kernel
|
|
47
47
|
|
48
48
|
alias_method(:require_relative_without_bootsnap, :require_relative)
|
49
49
|
def require_relative(path)
|
50
|
+
location = caller_locations(1..1).first
|
50
51
|
realpath = Bootsnap::LoadPathCache.realpath_cache.call(
|
51
|
-
|
52
|
+
location.absolute_path || location.path, path
|
52
53
|
)
|
53
54
|
require(realpath)
|
54
55
|
end
|
@@ -58,9 +58,9 @@ module Bootsnap
|
|
58
58
|
end
|
59
59
|
|
60
60
|
def purge_multi(features)
|
61
|
-
rejected_hashes = features.
|
61
|
+
rejected_hashes = features.each_with_object({}) { |f, h| h[f.hash] = true }
|
62
62
|
@mutex.synchronize do
|
63
|
-
@lfi.reject! { |_, hash| rejected_hashes.
|
63
|
+
@lfi.reject! { |_, hash| rejected_hashes.key?(hash) }
|
64
64
|
end
|
65
65
|
end
|
66
66
|
|
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
|
+
version: 1.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Burke Libbey
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-08-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -153,7 +153,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
153
153
|
- !ruby/object:Gem::Version
|
154
154
|
version: '0'
|
155
155
|
requirements: []
|
156
|
-
rubygems_version: 3.
|
156
|
+
rubygems_version: 3.2.20
|
157
157
|
signing_key:
|
158
158
|
specification_version: 4
|
159
159
|
summary: Boot large ruby/rails apps faster
|