ruby-changes:71523
From: Yusuke <ko1@a...>
Date: Sun, 27 Mar 2022 19:34:25 +0900 (JST)
Subject: [ruby-changes:71523] ca85f16a7d (master): ext/psych/extconf.rb: Fail when libyaml is unavailable
https://git.ruby-lang.org/ruby.git/commit/?id=ca85f16a7d From ca85f16a7dc50145a61998c5caed2d49ef48b73c Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Fri, 25 Mar 2022 17:33:30 +0900 Subject: ext/psych/extconf.rb: Fail when libyaml is unavailable WHen libyaml is not installed, make fails with the following cryptic message: ``` gmake[2]: Entering directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych' gmake[2]: *** No rule to make target 'yaml/yaml.h', needed by 'psych.o'. Stop. gmake[2]: Leaving directory '/home/chkbuild/chkbuild-crossruby/tmp/build/20220325T045825Z/ruby/ext/psych' ``` I think it should give up building psych with a clear message. --- ext/psych/extconf.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ext/psych/extconf.rb b/ext/psych/extconf.rb index 7da73760e3..0e4fb86a0b 100644 --- a/ext/psych/extconf.rb +++ b/ext/psych/extconf.rb @@ -10,6 +10,11 @@ dir_config 'libyaml' https://github.com/ruby/ruby/blob/trunk/ext/psych/extconf.rb#L10 if enable_config("bundled-libyaml", false) || !pkg_config('yaml-0.1') && !(find_header('yaml.h') && find_library('yaml', 'yaml_get_version')) # Embed libyaml since we could not find it. + unless File.exist?("#{$srcdir}/yaml") + puts "failed to build psych because no libyaml is available" + exit + end + $VPATH << "$(srcdir)/yaml" $INCFLAGS << " -I$(srcdir)/yaml" -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/