bootsnap 1.10.2 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 22aca6043d2a55eb7747cb38aec8365879c37e3fbdbd0cdfdd040098dd945fdd
4
- data.tar.gz: 69085ad28c61b3dbffeab8e50a49f0655d05c9639cae9e4ba0a9cc2f2b7c9051
3
+ metadata.gz: 3dfd9cfb2cde26fc31c82206b73f3940b4b46903a3fa73d0f3f1a4c4a90c6984
4
+ data.tar.gz: 6dd8acfb2676a2585eb320ed50ba0ddb9f9c847fb415bcda824c7ebff0cce752
5
5
  SHA512:
6
- metadata.gz: f63a81e86c721f737e5f29b9696abbcbc118e5bf703bf994dbf275d9939203d1eb6aebabc8ccad927f818b2bf9311d4174dde0338b7cd74f4e71e7e9727e6692
7
- data.tar.gz: 3209a8fcdbb446c0f32738f2f580e7adc573d556da298560718c23d25963dc3f9dcf8fd5794a79864bac203089aef6be3da7743fde8bcc906f469b20461bb7aa
6
+ metadata.gz: 219a84be718e4ac5681621739b6f9400d77a16dee631bdc286adad87c0ddf99cc581da7281150add34075c08c59832df2a468524656d2f1ac36ac1613be051bb
7
+ data.tar.gz: 0e407a034fd081c9e506637e0997d0c2cc0eea312be798f6fd0d573173699f906f1b43a1f3d37ff64ee6efb2f9257228c6c4e7663b7337bfc49d99e5089fccb9
data/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # Unreleased
2
2
 
3
+ # 1.10.3
4
+
5
+ * Fix Regexp and Date type support in YAML compile cache. (#400)
6
+
7
+ * Improve the YAML compile cache to support `UTF-8` symbols. (#398, #399)
8
+ [The default `MessagePack` symbol serializer assumes all symbols are ASCII](https://github.com/msgpack/msgpack-ruby/pull/211),
9
+ because of this, non-ASCII compatible symbol would be restored with `ASCII_8BIT` encoding (AKA `BINARY`).
10
+ Bootsnap now properly cache them in `UTF-8`.
11
+
12
+ Note that the above only apply for actual YAML symbols (e..g `--- :foo`).
13
+ The issue is still present for string keys parsed with `YAML.load_file(..., symbolize_names: true)`, that is a bug
14
+ in `msgpack` that will hopefully be solved soon, see: https://github.com/msgpack/msgpack-ruby/pull/246
15
+
16
+ * Entirely disable the YAML compile cache if `Encoding.default_internal` is set to an encoding not supported by `msgpack`. (#398)
17
+ `Psych` coerce strings to `Encoding.default_internal`, but `MessagePack` doesn't. So in this scenario we can't provide
18
+ YAML caching at all without returning the strings in the wrong encoding.
19
+ This never came up in practice but might as well be safe.
20
+
3
21
  # 1.10.2
4
22
 
5
23
  * Reduce the `Kernel.require` extra stack frames some more. Now bootsnap should only add one extra frame per `require` call.
@@ -22,7 +40,7 @@
22
40
  Since `1.8.0`, `YAML.load_file` was no longer cached when Psych 4 was used. This is because `load_file` loads
23
41
  in safe mode by default, so the Bootsnap cache could defeat that safety.
24
42
  Now when precompiling YAML files, Bootsnap first try to parse them in safe mode, and if it can't fallback to unsafe mode,
25
- and the cache contains a flag that records wether it was generated in safe mode or not.
43
+ and the cache contains a flag that records whether it was generated in safe mode or not.
26
44
  `YAML.unsafe_load_file` will use safe caches just fine, but `YAML.load_file` will fallback to uncached YAML parsing
27
45
  if the cache was generated using unsafe parsing.
28
46
 
@@ -63,7 +81,7 @@
63
81
 
64
82
  # 1.8.0
65
83
 
66
- * Improve support for Pysch 4. (#368)
84
+ * Improve support for Psych 4. (#368)
67
85
 
68
86
  # 1.7.7
69
87
 
@@ -81,8 +99,8 @@
81
99
 
82
100
  # 1.7.4
83
101
 
84
- * Stop raising errors when encoutering various file system errors. The cache is now best effort,
85
- if somehow it can't be saved, bootsnapp will gracefully fallback to the original operation (e.g. `Kernel.require`).
102
+ * Stop raising errors when encountering various file system errors. The cache is now best effort,
103
+ if somehow it can't be saved, bootsnap will gracefully fallback to the original operation (e.g. `Kernel.require`).
86
104
  (#353, #177, #262)
87
105
 
88
106
  # 1.7.3
@@ -2,7 +2,7 @@
2
2
  * Suggested reading order:
3
3
  * 1. Skim Init_bootsnap
4
4
  * 2. Skim bs_fetch
5
- * 3. The rest of everything
5
+ * 3. The rest of everyrything
6
6
  *
7
7
  * Init_bootsnap sets up the ruby objects and binds bs_fetch to
8
8
  * Bootsnap::CompileCache::Native.fetch.
@@ -5,7 +5,15 @@ require("bootsnap/bootsnap")
5
5
  module Bootsnap
6
6
  module CompileCache
7
7
  module YAML
8
- UnsupportedTags = Class.new(StandardError)
8
+ Uncompilable = Class.new(StandardError)
9
+ UnsupportedTags = Class.new(Uncompilable)
10
+
11
+ SUPPORTED_INTERNAL_ENCODINGS = [
12
+ nil, # UTF-8
13
+ Encoding::UTF_8,
14
+ Encoding::ASCII,
15
+ Encoding::BINARY,
16
+ ].freeze
9
17
 
10
18
  class << self
11
19
  attr_accessor(:msgpack_factory, :supported_options)
@@ -16,7 +24,9 @@ module Bootsnap
16
24
  end
17
25
 
18
26
  def precompile(path)
19
- Bootsnap::CompileCache::Native.precompile(
27
+ return false unless CompileCache::YAML.supported_internal_encoding?
28
+
29
+ CompileCache::Native.precompile(
20
30
  cache_dir,
21
31
  path.to_s,
22
32
  @implementation,
@@ -29,6 +39,21 @@ module Bootsnap
29
39
  ::YAML.singleton_class.prepend(@implementation::Patch)
30
40
  end
31
41
 
42
+ # Psych coerce strings to `Encoding.default_internal` but Message Pack only support
43
+ # UTF-8, US-ASCII and BINARY. So if Encoding.default_internal is set to anything else
44
+ # we can't safely use the cache
45
+ def supported_internal_encoding?
46
+ SUPPORTED_INTERNAL_ENCODINGS.include?(Encoding.default_internal)
47
+ end
48
+
49
+ module EncodingAwareSymbols
50
+ extend self
51
+
52
+ def unpack(payload)
53
+ (+payload).force_encoding(Encoding::UTF_8).to_sym
54
+ end
55
+ end
56
+
32
57
  def init!
33
58
  require("yaml")
34
59
  require("msgpack")
@@ -43,7 +68,12 @@ module Bootsnap
43
68
  # We want them to roundtrip cleanly, so we use a custom factory.
44
69
  # see: https://github.com/msgpack/msgpack-ruby/pull/122
45
70
  factory = MessagePack::Factory.new
46
- factory.register_type(0x00, Symbol)
71
+ factory.register_type(
72
+ 0x00,
73
+ Symbol,
74
+ packer: :to_msgpack_ext,
75
+ unpacker: EncodingAwareSymbols.method(:unpack).to_proc,
76
+ )
47
77
 
48
78
  if defined? MessagePack::Timestamp
49
79
  factory.register_type(
@@ -119,13 +149,15 @@ module Bootsnap
119
149
  extend self
120
150
 
121
151
  def input_to_storage(contents, _)
122
- obj = CompileCache::YAML.strict_load(contents)
152
+ obj = ::YAML.unsafe_load(contents)
123
153
  packer = CompileCache::YAML.msgpack_factory.packer
124
154
  packer.pack(false) # not safe loaded
125
- packer.pack(obj)
155
+ begin
156
+ packer.pack(obj)
157
+ rescue NoMethodError, RangeError
158
+ return UNCOMPILABLE # The object included things that we can't serialize
159
+ end
126
160
  packer.to_s
127
- rescue NoMethodError, RangeError, UnsupportedTags
128
- UNCOMPILABLE # The object included things that we can't serialize
129
161
  end
130
162
 
131
163
  def storage_to_output(data, kwargs)
@@ -148,13 +180,20 @@ module Bootsnap
148
180
  extend self
149
181
 
150
182
  def input_to_storage(contents, _)
151
- obj = ::YAML.load(contents)
183
+ obj = begin
184
+ CompileCache::YAML.strict_load(contents)
185
+ rescue Psych::DisallowedClass, Psych::BadAlias, Uncompilable
186
+ return UNCOMPILABLE
187
+ end
188
+
152
189
  packer = CompileCache::YAML.msgpack_factory.packer
153
190
  packer.pack(true) # safe loaded
154
- packer.pack(obj)
191
+ begin
192
+ packer.pack(obj)
193
+ rescue NoMethodError, RangeError
194
+ return UNCOMPILABLE
195
+ end
155
196
  packer.to_s
156
- rescue NoMethodError, RangeError, Psych::DisallowedClass, Psych::BadAlias
157
- UNCOMPILABLE # The object included things that we can't serialize
158
197
  end
159
198
 
160
199
  def storage_to_output(data, kwargs)
@@ -179,44 +218,48 @@ module Bootsnap
179
218
 
180
219
  module Patch
181
220
  def load_file(path, *args)
221
+ return super unless CompileCache::YAML.supported_internal_encoding?
222
+
182
223
  return super if args.size > 1
183
224
 
184
225
  if (kwargs = args.first)
185
226
  return super unless kwargs.is_a?(Hash)
186
- return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
227
+ return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
187
228
  end
188
229
 
189
230
  begin
190
- ::Bootsnap::CompileCache::Native.fetch(
191
- Bootsnap::CompileCache::YAML.cache_dir,
231
+ CompileCache::Native.fetch(
232
+ CompileCache::YAML.cache_dir,
192
233
  File.realpath(path),
193
- ::Bootsnap::CompileCache::YAML::Psych4::SafeLoad,
234
+ CompileCache::YAML::Psych4::SafeLoad,
194
235
  kwargs,
195
236
  )
196
237
  rescue Errno::EACCES
197
- ::Bootsnap::CompileCache.permission_error(path)
238
+ CompileCache.permission_error(path)
198
239
  end
199
240
  end
200
241
 
201
242
  ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
202
243
 
203
244
  def unsafe_load_file(path, *args)
245
+ return super unless CompileCache::YAML.supported_internal_encoding?
246
+
204
247
  return super if args.size > 1
205
248
 
206
249
  if (kwargs = args.first)
207
250
  return super unless kwargs.is_a?(Hash)
208
- return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
251
+ return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
209
252
  end
210
253
 
211
254
  begin
212
- ::Bootsnap::CompileCache::Native.fetch(
213
- Bootsnap::CompileCache::YAML.cache_dir,
255
+ CompileCache::Native.fetch(
256
+ CompileCache::YAML.cache_dir,
214
257
  File.realpath(path),
215
- ::Bootsnap::CompileCache::YAML::Psych4::UnsafeLoad,
258
+ CompileCache::YAML::Psych4::UnsafeLoad,
216
259
  kwargs,
217
260
  )
218
261
  rescue Errno::EACCES
219
- ::Bootsnap::CompileCache.permission_error(path)
262
+ CompileCache.permission_error(path)
220
263
  end
221
264
  end
222
265
 
@@ -228,13 +271,15 @@ module Bootsnap
228
271
  extend self
229
272
 
230
273
  def input_to_storage(contents, _)
231
- obj = CompileCache::YAML.strict_load(contents)
274
+ obj = ::YAML.load(contents)
232
275
  packer = CompileCache::YAML.msgpack_factory.packer
233
276
  packer.pack(false) # not safe loaded
234
- packer.pack(obj)
277
+ begin
278
+ packer.pack(obj)
279
+ rescue NoMethodError, RangeError
280
+ return UNCOMPILABLE # The object included things that we can't serialize
281
+ end
235
282
  packer.to_s
236
- rescue NoMethodError, RangeError, UnsupportedTags
237
- UNCOMPILABLE # The object included things that we can't serialize
238
283
  end
239
284
 
240
285
  def storage_to_output(data, kwargs)
@@ -253,44 +298,48 @@ module Bootsnap
253
298
 
254
299
  module Patch
255
300
  def load_file(path, *args)
301
+ return super unless CompileCache::YAML.supported_internal_encoding?
302
+
256
303
  return super if args.size > 1
257
304
 
258
305
  if (kwargs = args.first)
259
306
  return super unless kwargs.is_a?(Hash)
260
- return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
307
+ return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
261
308
  end
262
309
 
263
310
  begin
264
- ::Bootsnap::CompileCache::Native.fetch(
265
- Bootsnap::CompileCache::YAML.cache_dir,
311
+ CompileCache::Native.fetch(
312
+ CompileCache::YAML.cache_dir,
266
313
  File.realpath(path),
267
- ::Bootsnap::CompileCache::YAML::Psych3,
314
+ CompileCache::YAML::Psych3,
268
315
  kwargs,
269
316
  )
270
317
  rescue Errno::EACCES
271
- ::Bootsnap::CompileCache.permission_error(path)
318
+ CompileCache.permission_error(path)
272
319
  end
273
320
  end
274
321
 
275
322
  ruby2_keywords :load_file if respond_to?(:ruby2_keywords, true)
276
323
 
277
324
  def unsafe_load_file(path, *args)
325
+ return super unless CompileCache::YAML.supported_internal_encoding?
326
+
278
327
  return super if args.size > 1
279
328
 
280
329
  if (kwargs = args.first)
281
330
  return super unless kwargs.is_a?(Hash)
282
- return super unless (kwargs.keys - ::Bootsnap::CompileCache::YAML.supported_options).empty?
331
+ return super unless (kwargs.keys - CompileCache::YAML.supported_options).empty?
283
332
  end
284
333
 
285
334
  begin
286
- ::Bootsnap::CompileCache::Native.fetch(
287
- Bootsnap::CompileCache::YAML.cache_dir,
335
+ CompileCache::Native.fetch(
336
+ CompileCache::YAML.cache_dir,
288
337
  File.realpath(path),
289
- ::Bootsnap::CompileCache::YAML::Psych3,
338
+ CompileCache::YAML::Psych3,
290
339
  kwargs,
291
340
  )
292
341
  rescue Errno::EACCES
293
- ::Bootsnap::CompileCache.permission_error(path)
342
+ CompileCache.permission_error(path)
294
343
  end
295
344
  end
296
345
 
@@ -3,6 +3,9 @@
3
3
  module Bootsnap
4
4
  module CompileCache
5
5
  UNCOMPILABLE = BasicObject.new
6
+ def UNCOMPILABLE.inspect
7
+ "<Bootsnap::UNCOMPILABLE>"
8
+ end
6
9
 
7
10
  Error = Class.new(StandardError)
8
11
  PermissionError = Class.new(Error)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bootsnap
4
- VERSION = "1.10.2"
4
+ VERSION = "1.10.3"
5
5
  end
data/lib/bootsnap.rb CHANGED
@@ -10,128 +10,128 @@ module Bootsnap
10
10
 
11
11
  class << self
12
12
  attr_reader :logger
13
- end
14
-
15
- def self.log!
16
- self.logger = $stderr.method(:puts)
17
- end
18
13
 
19
- def self.logger=(logger)
20
- @logger = logger
21
- self.instrumentation = if logger.respond_to?(:debug)
22
- ->(event, path) { @logger.debug("[Bootsnap] #{event} #{path}") }
23
- else
24
- ->(event, path) { @logger.call("[Bootsnap] #{event} #{path}") }
14
+ def log!
15
+ self.logger = $stderr.method(:puts)
25
16
  end
26
- end
27
17
 
28
- def self.instrumentation=(callback)
29
- @instrumentation = callback
30
- if respond_to?(:instrumentation_enabled=, true)
31
- self.instrumentation_enabled = !!callback
18
+ def logger=(logger)
19
+ @logger = logger
20
+ self.instrumentation = if logger.respond_to?(:debug)
21
+ ->(event, path) { @logger.debug("[Bootsnap] #{event} #{path}") }
22
+ else
23
+ ->(event, path) { @logger.call("[Bootsnap] #{event} #{path}") }
24
+ end
32
25
  end
33
- end
34
-
35
- def self._instrument(event, path)
36
- @instrumentation.call(event, path)
37
- end
38
26
 
39
- def self.setup(
40
- cache_dir:,
41
- development_mode: true,
42
- load_path_cache: true,
43
- autoload_paths_cache: nil,
44
- disable_trace: nil,
45
- compile_cache_iseq: true,
46
- compile_cache_yaml: true,
47
- compile_cache_json: true
48
- )
49
- unless autoload_paths_cache.nil?
50
- warn "[DEPRECATED] Bootsnap's `autoload_paths_cache:` option is deprecated and will be removed. " \
51
- "If you use Zeitwerk this option is useless, and if you are still using the classic autoloader " \
52
- "upgrading is recommended."
27
+ def instrumentation=(callback)
28
+ @instrumentation = callback
29
+ if respond_to?(:instrumentation_enabled=, true)
30
+ self.instrumentation_enabled = !!callback
31
+ end
53
32
  end
54
33
 
55
- unless disable_trace.nil?
56
- warn "[DEPRECATED] Bootsnap's `disable_trace:` option is deprecated and will be removed. " \
57
- "If you use Ruby 2.5 or newer this option is useless, if not upgrading is recommended."
34
+ def _instrument(event, path)
35
+ @instrumentation.call(event, path)
58
36
  end
59
37
 
60
- if compile_cache_iseq && !iseq_cache_supported?
61
- warn "Ruby 2.5 has a bug that break code tracing when code is loaded from cache. It is recommened " \
62
- "to turn `compile_cache_iseq` off on Ruby 2.5"
63
- end
38
+ def setup(
39
+ cache_dir:,
40
+ development_mode: true,
41
+ load_path_cache: true,
42
+ autoload_paths_cache: nil,
43
+ disable_trace: nil,
44
+ compile_cache_iseq: true,
45
+ compile_cache_yaml: true,
46
+ compile_cache_json: true
47
+ )
48
+ unless autoload_paths_cache.nil?
49
+ warn "[DEPRECATED] Bootsnap's `autoload_paths_cache:` option is deprecated and will be removed. " \
50
+ "If you use Zeitwerk this option is useless, and if you are still using the classic autoloader " \
51
+ "upgrading is recommended."
52
+ end
64
53
 
65
- if load_path_cache
66
- Bootsnap::LoadPathCache.setup(
67
- cache_path: cache_dir + "/bootsnap/load-path-cache",
68
- development_mode: development_mode,
69
- )
70
- end
54
+ unless disable_trace.nil?
55
+ warn "[DEPRECATED] Bootsnap's `disable_trace:` option is deprecated and will be removed. " \
56
+ "If you use Ruby 2.5 or newer this option is useless, if not upgrading is recommended."
57
+ end
71
58
 
72
- Bootsnap::CompileCache.setup(
73
- cache_dir: cache_dir + "/bootsnap/compile-cache",
74
- iseq: compile_cache_iseq,
75
- yaml: compile_cache_yaml,
76
- json: compile_cache_json,
77
- )
78
- end
59
+ if compile_cache_iseq && !iseq_cache_supported?
60
+ warn "Ruby 2.5 has a bug that break code tracing when code is loaded from cache. It is recommened " \
61
+ "to turn `compile_cache_iseq` off on Ruby 2.5"
62
+ end
79
63
 
80
- def self.iseq_cache_supported?
81
- return @iseq_cache_supported if defined? @iseq_cache_supported
64
+ if load_path_cache
65
+ Bootsnap::LoadPathCache.setup(
66
+ cache_path: cache_dir + "/bootsnap/load-path-cache",
67
+ development_mode: development_mode,
68
+ )
69
+ end
82
70
 
83
- ruby_version = Gem::Version.new(RUBY_VERSION)
84
- @iseq_cache_supported = ruby_version < Gem::Version.new("2.5.0") || ruby_version >= Gem::Version.new("2.6.0")
85
- end
71
+ Bootsnap::CompileCache.setup(
72
+ cache_dir: cache_dir + "/bootsnap/compile-cache",
73
+ iseq: compile_cache_iseq,
74
+ yaml: compile_cache_yaml,
75
+ json: compile_cache_json,
76
+ )
77
+ end
86
78
 
87
- def self.default_setup
88
- env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || ENV["ENV"]
89
- development_mode = ["", nil, "development"].include?(env)
79
+ def iseq_cache_supported?
80
+ return @iseq_cache_supported if defined? @iseq_cache_supported
90
81
 
91
- unless ENV["DISABLE_BOOTSNAP"]
92
- cache_dir = ENV["BOOTSNAP_CACHE_DIR"]
93
- unless cache_dir
94
- config_dir_frame = caller.detect do |line|
95
- line.include?("/config/")
96
- end
82
+ ruby_version = Gem::Version.new(RUBY_VERSION)
83
+ @iseq_cache_supported = ruby_version < Gem::Version.new("2.5.0") || ruby_version >= Gem::Version.new("2.6.0")
84
+ end
97
85
 
98
- unless config_dir_frame
99
- $stderr.puts("[bootsnap/setup] couldn't infer cache directory! Either:")
100
- $stderr.puts("[bootsnap/setup] 1. require bootsnap/setup from your application's config directory; or")
101
- $stderr.puts("[bootsnap/setup] 2. Define the environment variable BOOTSNAP_CACHE_DIR")
86
+ def default_setup
87
+ env = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || ENV["ENV"]
88
+ development_mode = ["", nil, "development"].include?(env)
102
89
 
103
- raise("couldn't infer bootsnap cache directory")
104
- end
90
+ unless ENV["DISABLE_BOOTSNAP"]
91
+ cache_dir = ENV["BOOTSNAP_CACHE_DIR"]
92
+ unless cache_dir
93
+ config_dir_frame = caller.detect do |line|
94
+ line.include?("/config/")
95
+ end
105
96
 
106
- path = config_dir_frame.split(/:\d+:/).first
107
- path = File.dirname(path) until File.basename(path) == "config"
108
- app_root = File.dirname(path)
97
+ unless config_dir_frame
98
+ $stderr.puts("[bootsnap/setup] couldn't infer cache directory! Either:")
99
+ $stderr.puts("[bootsnap/setup] 1. require bootsnap/setup from your application's config directory; or")
100
+ $stderr.puts("[bootsnap/setup] 2. Define the environment variable BOOTSNAP_CACHE_DIR")
109
101
 
110
- cache_dir = File.join(app_root, "tmp", "cache")
111
- end
102
+ raise("couldn't infer bootsnap cache directory")
103
+ end
112
104
 
113
- setup(
114
- cache_dir: cache_dir,
115
- development_mode: development_mode,
116
- load_path_cache: !ENV["DISABLE_BOOTSNAP_LOAD_PATH_CACHE"],
117
- compile_cache_iseq: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"] && iseq_cache_supported?,
118
- compile_cache_yaml: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"],
119
- compile_cache_json: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"],
120
- )
105
+ path = config_dir_frame.split(/:\d+:/).first
106
+ path = File.dirname(path) until File.basename(path) == "config"
107
+ app_root = File.dirname(path)
108
+
109
+ cache_dir = File.join(app_root, "tmp", "cache")
110
+ end
121
111
 
122
- if ENV["BOOTSNAP_LOG"]
123
- log!
112
+ setup(
113
+ cache_dir: cache_dir,
114
+ development_mode: development_mode,
115
+ load_path_cache: !ENV["DISABLE_BOOTSNAP_LOAD_PATH_CACHE"],
116
+ compile_cache_iseq: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"] && iseq_cache_supported?,
117
+ compile_cache_yaml: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"],
118
+ compile_cache_json: !ENV["DISABLE_BOOTSNAP_COMPILE_CACHE"],
119
+ )
120
+
121
+ if ENV["BOOTSNAP_LOG"]
122
+ log!
123
+ end
124
124
  end
125
125
  end
126
- end
127
126
 
128
- if RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
129
- def self.absolute_path?(path)
130
- path[1] == ":"
131
- end
132
- else
133
- def self.absolute_path?(path)
134
- path.start_with?("/")
127
+ if RbConfig::CONFIG["host_os"] =~ /mswin|mingw|cygwin/
128
+ def absolute_path?(path)
129
+ path[1] == ":"
130
+ end
131
+ else
132
+ def absolute_path?(path)
133
+ path.start_with?("/")
134
+ end
135
135
  end
136
136
  end
137
137
  end
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.10.2
4
+ version: 1.10.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Burke Libbey
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-01-21 00:00:00.000000000 Z
11
+ date: 2022-02-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: msgpack