compile ruby 3.2.0 failed
FRedwuSong opened this issue · comments
I was using asdf install Ruby 3.2.0, but it build failed
My comment : asdf install ruby 3.2.0
the error look like this:
ssl_pkey_ec.c:489:5: warning: assigning to 'EC_KEY *' (aka 'struct ec_key_st *') from 'const struct ec_key_st *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
GetEC(self, ec);
^~~~~~~~~~~~~~~
ossl_pkey_ec.c:24:11: note: expanded from macro 'GetEC'
(key) = EVP_PKEY_get0_EC_KEY(_pkey); \
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
�[33;1m*** Following extensions are not compiled:�[m
�[31;1mpsych:�[m
Could not be configured. It will not be installed.
Check ext/psych/mkmf.log for more details.
�[33;1m*** Fix the problems, then remove these directories and try again if you want.�[m
Generating RDoc documentation
/private/var/folders/tl/26byp2g966l3786lk339pt640000gn/T/ruby-build.20230101014425.1647.MR0fKf/ruby-3.2.0/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
uh-oh! RDoc had a problem:
cannot load such file -- psych
In particular, install libyaml and reinstall your ruby.
@MSP-Greg happy new year, thanks your information.
I brew install libyaml
before. brew list
I guess maybe ruby 3.2 are not compiled because this error.
ssl_pkey_ec.c:489:5: warning: assigning to 'EC_KEY *' (aka 'struct ec_key_st *') from 'const struct ec_key_st *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
GetEC(self, ec);
^~~~~~~~~~~~~~~
ossl_pkey_ec.c:24:11: note: expanded from macro 'GetEC'
(key) = EVP_PKEY_get0_EC_KEY(_pkey); \
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
Thank you, and a Happy New Year to you also.
Normally, warnings are just that, they won't stop a compile. Errors will. There is a setting to make warnings into errors, can't recall it (Puma uses it).
Do you get any output with ruby -rpsych -e "puts Psych::LIBYAML_VERSION"
?
Yes @MSP-Greg
ruby -rpsych -e "puts Psych::LIBYAML_VERSION"
The out put : 0.2.5
and current Ruby version is 3.1.3
.
Sorry, that won't work, as you're building Ruby 3.2.0. Forgot about that...
If you look at Ruby 3.1.3, see https://github.com/ruby/ruby/tree/v3_1_3/ext/psych, and notice the yaml
folder. Ruby 3.2.0, https://github.com/ruby/ruby/tree/v3_2_0/ext/psych, doesn't have that folder. Hence, Psych stopped vendoring the libyaml code. I suspect the Ruby 3.2.0 build can't find the libyaml install?
Seeing arm64 in the log, you might have a look at ruby/psych#600...
thanks you @MSP-Greg
the error look like this:
ssl_pkey_ec.c:489:5: warning: assigning to 'EC_KEY *' (aka 'struct ec_key_st *') from 'const struct ec_key_st *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers] GetEC(self, ec); ^~~~~~~~~~~~~~~ ossl_pkey_ec.c:24:11: note: expanded from macro 'GetEC' (key) = EVP_PKEY_get0_EC_KEY(_pkey); \ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
This is a warning, not an error, and can be safely ignored. This is fixed by 6fb3499 but Ruby 3.2.0 didn't include this yet. According to the log file, openssl
was compiled successfully.
The console output you posted in ruby/psych#600 indeed looks like the lack of the libyaml header file.
thank @rhenium 's explanation, and Happy New year.
Sorry, I response lately.