summaryrefslogtreecommitdiff
path: root/ext/psych/extconf.rb
diff options
context:
space:
mode:
Diffstat (limited to 'ext/psych/extconf.rb')
-rw-r--r--ext/psych/extconf.rb16
1 files changed, 9 insertions, 7 deletions
diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb
index b9cd12033d..6d03870436 100644
--- a/ext/psych/extconf.rb
+++ b/ext/psych/extconf.rb
@@ -19,15 +19,17 @@ if yaml_source == true
# search the latest libyaml source under $srcdir
yaml_source = Dir.glob("#{$srcdir}/yaml{,-*}/").max_by {|n| File.basename(n).scan(/\d+/).map(&:to_i)}
unless yaml_source
- download_failure = "failed to download libyaml source"
+ download_failure = "failed to download libyaml source. Try manually installing libyaml?"
begin
require_relative '../../tool/extlibs.rb'
- extlibs = ExtLibs.new(cache_dir: File.expand_path("../../tmp/download_cache", $srcdir))
- unless extlibs.process_under($srcdir)
- raise download_failure
- end
- rescue
- # Implicitly captures Exception#cause. Newer rubies show it in the backtrace.
+ rescue LoadError
+ # When running in ruby/ruby, we use miniruby and don't have stdlib.
+ # Avoid LoadError because it aborts the whole build. Usually when
+ # stdlib extension fail to configure we skip it and continue.
+ raise download_failure
+ end
+ extlibs = ExtLibs.new(cache_dir: File.expand_path("../../tmp/download_cache", $srcdir))
+ unless extlibs.process_under($srcdir)
raise download_failure
end
yaml_source, = Dir.glob("#{$srcdir}/yaml-*/")