Add a test to prove that if there is an error reading a file
the message contains the problematic path.
The custom permission error class and method were designed
to warn about errors with the cache path
but we stopped reporting write errors in
d878622782
and read errors in
503e9d5080
Fix: #434
Our strictness was based on the incorrect assumption that all extra types
would use a tag, which is incorrect as `Time` and `Date` objects can be
expressed in regular YAML syntax without the use of `!ruby/object`.
Ref: https://github.com/msgpack/msgpack-ruby/pull/211
The default msgpack Symbol packer/unpacker is not encoding
aware which cause all non-ASCII symbols to be unpacked with
ASCII-8BIT encoding aka BINARY.
So we define a custom packer that prefix the symbol name with `1`
for UTF-8 symbols, and `0` for the others (ASCII or binary)
If `Encoding.default_internal` is set to something MessagePack
doesn't support, we entirely disable the YAML cache.
Context: https://bugs.ruby-lang.org/issues/18492
Rescuing exceptions from a C-extension is complicated, and even seem
a bit broken on Windows.
It's much simpler to return a special unique value, and likely is more performant
too.
Psych 4 now load in safe mode by default, which means many
features such as aliases are disabled by default.
This makes it complicated for Bootsnap to cache, and pretty
much impossible to precompile.
So until we figure out a better solution, we're better to
entirely disable that cache for Psych 4+. However it
can stay active for `YAML.unsafe_load_file`.