[MacPorts] #69604: ruby-build fails with fatal error: 'yaml.h' file not found

MacPorts noreply at macports.org
Wed Mar 27 16:50:57 UTC 2024


#69604: ruby-build fails with fatal error: 'yaml.h' file not found
--------------------+------------------------
 Reporter:  breun   |      Owner:  mojca
     Type:  defect  |     Status:  assigned
 Priority:  Normal  |  Milestone:
Component:  ports   |    Version:
 Keywords:          |       Port:  ruby-build
--------------------+------------------------
 I have installed the `rbenv` and `ruby-build` ports, and then tried to
 install Ruby 3.3.0, but this fails:

 {{{
 ❯ rbenv install 3.3.0
 ==> Downloading openssl-3.1.4.tar.gz...
 -> curl -q -fL -o openssl-3.1.4.tar.gz
 https://dqw8nmjcqpjn7.cloudfront.net/840af5366ab9b522bde525826be3ef0fb0af81c6a9ebd84caa600fea1731eee3
   % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                  Dload  Upload   Total   Spent    Left
 Speed
 100 14.8M  100 14.8M    0     0  31.7M      0 --:--:-- --:--:-- --:--:--
 31.7M
 ==> Installing openssl-3.1.4...
 -> ./config "--prefix=$HOME/.rbenv/versions/3.3.0/openssl" "--
 openssldir=$HOME/.rbenv/versions/3.3.0/openssl/ssl" zlib-dynamic no-ssl3
 shared
 -> make -j 10
 -> make install_sw install_ssldirs
 ==> Installed openssl-3.1.4 to /Users/breun/.rbenv/versions/3.3.0
 ==> Downloading ruby-3.3.0.tar.gz...
 -> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-
 lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
   % Total    % Received % Xferd  Average Speed   Time    Time     Time
 Current
                                  Dload  Upload   Total   Spent    Left
 Speed
 100 21.0M  100 21.0M    0     0  40.3M      0 --:--:-- --:--:-- --:--:--
 40.3M
 ==> Installing ruby-3.3.0...
 -> ./configure "--prefix=$HOME/.rbenv/versions/3.3.0" "--with-openssl-
 dir=$HOME/.rbenv/versions/3.3.0/openssl" --enable-shared --with-
 ext=openssl,psych,+
 -> make -j 10
 *** Following extensions are not compiled:
 psych:
         Could not be configured. It will not be installed.
         Check /var/folders/m7/7n1s8z9r8vlfjs008k8z7sr80000gn/T/ruby-
 build.20240327173636.655.zYSH3n/ruby-3.3.0/ext/psych/mkmf.log for more
 details.

 BUILD FAILED (macOS 14.4.1 on arm64 using ruby-build 20240318)

 You can inspect the build directory at
 /var/folders/m7/7n1s8z9r8vlfjs008k8z7sr80000gn/T/ruby-
 build.20240327173636.655.zYSH3n
 See the full build log at /var/folders/m7/7n1s8z9r8vlfjs008k8z7sr80000gn/T
 /ruby-build.20240327173636.655.log
 }}}

 The log file contains:

 {{{
 package configuration for yaml-0.1 is not found
 find_header: checking for yaml.h... -------------------- no

 DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang -o conftest
 -I../../.ext/include/arm64-darwin23 -I../.././include -I../.././ext/psych
 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens
 -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-
 function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-
 arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-
 noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-
 long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-
 parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-
 unused-parameter -Wno-unused-value -Wunused-variable -Wundef  -fno-common
 -pipe conftest.c  -L. -L../.. -L. -fstack-protector-strong
 -lruby.3.2-static -framework CoreFoundation -ldl -lobjc -lpthread
 -lpthread  "
 ld: warning: ignoring duplicate libraries: '-lpthread'
 checked program was:
 /* begin */
 1: #include "ruby.h"
 2:
 3: int main(int argc, char **argv)
 4: {
 5:   return !!argv[argc];
 6: }
 /* end */

 DYLD_FALLBACK_LIBRARY_PATH=.:../.. "clang
 -I../../.ext/include/arm64-darwin23 -I../.././include -I../.././ext/psych
 -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT
 -fdeclspec -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wextra-tokens
 -Wdeprecated-declarations -Wdivision-by-zero -Wdiv-by-zero -Wimplicit-
 function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-
 arith -Wshorten-64-to-32 -Wwrite-strings -Wold-style-definition -Wmissing-
 noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-
 long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-
 parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-
 unused-parameter -Wno-unused-value -Wunused-variable -Wundef  -fno-common
 -pipe   -c conftest.c"
 conftest.c:3:10: fatal error: 'yaml.h' file not found
 #include <yaml.h>
          ^~~~~~~~
 1 error generated.
 checked program was:
 /* begin */
 1: #include "ruby.h"
 2:
 3: #include <yaml.h>
 /* end */

 --------------------


 }}}

 I get a similar error when trying to install Ruby 3.2.3 this way.

 I see that the `libyaml` port includes `/opt/local/include/yaml.h`, but
 I'm not sure if that is the right file, and if so, how to make this
 process use it.

 Is this a bug, or am I doing something wrong?

-- 
Ticket URL: <https://trac.macports.org/ticket/69604>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list