1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/ext/psych
Alan Wu 9357e310fb [ruby/psych] Fix libyaml download failure rescue under miniruby
I tried to build Ruby on a system without libyaml today and realized
that my attempt from <https://github.com/ruby/psych/pull/557> doesn't
fix the error in <https://github.com/ruby/psych/issues/552>. I still got
the same `LoadError` from `digest` which stopped the build.

Since `LoadError` is not a `StandardError`, a plain `rescue` doesn't catch
it. Catch `LoadError` explicitly instead and reduce the scope of the
`begin` block.

I tested this change in a Ruby build on macOS without libyaml installed
and confirmed that `make` continues with a warning instead of aborting:

    *** Following extensions are not compiled:
    psych:
            Could not be configured. It will not be installed.
            ...

This should address <https://bugs.ruby-lang.org/issues/18790>.

https://github.com/ruby/psych/commit/251289ba83
2022-06-15 01:05:51 +09:00
..
lib [ruby/psych] Prepare to develop 5.0.0 2022-05-18 10:03:48 +09:00
.gitignore
depend
extconf.rb [ruby/psych] Fix libyaml download failure rescue under miniruby 2022-06-15 01:05:51 +09:00
extlibs
psych.c
psych.gemspec
psych.h
psych_emitter.c
psych_emitter.h
psych_parser.c
psych_parser.h
psych_to_ruby.c
psych_to_ruby.h
psych_yaml_tree.c
psych_yaml_tree.h