Ruby-build: BUILD FAILED (OS X 10.14.6 using ruby-build 20191002-2-g786b89f)

Created on 3 Oct 2019  ยท  10Comments  ยท  Source: rbenv/ruby-build

I'm hitting an error installing with compiling Ruby's OpenSSL stuff:

1607   โ”‚ ossl_x509cert.c:334:59: error: member reference type 'int' is not a pointer
1608   โ”‚     if (!i2a_ASN1_OBJECT(out, X509_get0_tbs_sigalg(x509)->algorithm)) {
1609   โ”‚                               ~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
1610   โ”‚ ossl_x509cert.c:424:22: warning: implicit declaration of function 'X509_get0_notBefore' is invalid in C99 [-Wimplicit-function-declaration]
1611   โ”‚     if (!(asn1time = X509_get0_notBefore(x509))) {
1612   โ”‚                      ^
1613   โ”‚ ossl_x509cert.c:424:20: warning: incompatible integer to pointer conversion assigning to 'const ASN1_TIME *' (aka 'const struct asn1_string_st *') from 'int' [-Wint-conversion]
1614   โ”‚     if (!(asn1time = X509_get0_notBefore(x509))) {
1615   โ”‚                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~~
1616   โ”‚ ossl_x509cert.c:443:10: warning: implicit declaration of function 'X509_set1_notBefore' is invalid in C99 [-Wimplicit-function-declaration]
1617   โ”‚     if (!X509_set1_notBefore(x509, asn1time)) {
1618   โ”‚          ^
1619   โ”‚ ossl_x509cert.c:463:22: warning: implicit declaration of function 'X509_get0_notAfter' is invalid in C99 [-Wimplicit-function-declaration]
1620   โ”‚     if (!(asn1time = X509_get0_notAfter(x509))) {
1621   โ”‚                      ^
1622   โ”‚ ossl_x509cert.c:463:20: warning: incompatible integer to pointer conversion assigning to 'const ASN1_TIME *' (aka 'const struct asn1_string_st *') from 'int' [-Wint-conversion]
1623   โ”‚     if (!(asn1time = X509_get0_notAfter(x509))) {
1624   โ”‚                    ^ ~~~~~~~~~~~~~~~~~~~~~~~~
1625   โ”‚ ossl_x509cert.c:482:10: warning: implicit declaration of function 'X509_set1_notAfter' is invalid in C99 [-Wimplicit-function-declaration]
1626   โ”‚     if (!X509_set1_notAfter(x509, asn1time)) {

Full log:

ruby-build.20191003115834.1719.log

I have OpenSSL 1.1.1d from Homebrew:

[email protected]: stable 1.1.1d [keg-only]

Version of ruby-build is in title. It is using "openssl from homebrew" and it is adding it to the configure options:

./configure --prefix=/Users/jgoebel/.rbenv/versions/2.6.5 --with-openssl-dir=/Users/jgoebel/.brew/opt/[email protected] --with-readline-dir=/Users/jgoebel/.brew/opt/readline

Any ideas? Homebrew manages to build it's own Ruby 2.6.5 just fine, so this has got to be something funky.

Most helpful comment

File access times... I think it's the first time in my life I've used them for anything useful:

ls -lu ~/.brew/Cellar/*/*/bin/* | grep 'Oct  4 09:4'

Damn pkg-config from Brew. Dunno what it's getting jammed up on but just brew unlink pkg-config (temporarily) fixes the build. I could probably modify it to log it's called options, but I'm about done with this, just adding this info in case anyone else has the same issue.

All 10 comments

All the Googling I did pointed to issues with not using the proper SSL and adding options like --with-openssl-dir but AFAICT it's trying to compile with SSL 1.1, and it's already passing that so I'm confused.

I resolved this by removing ~/.brew/bin and ~/.brew/sbin from my PATH and symlinking brew into ~/bin (which is still in my path). This is so that the "auto-use openssl from new" stuff still works automagically.

Now it "just works". So one of the brew binaries I have installed is breaking the install. That leaves only 226 possible culprits. Sheesh.

Ruby-build doesn't have any easy way to guarantee a sane build environment or tweak the environment or anything like that, does it?

Trying to think about how to isolate this to find out which package is the issue...

File access times... I think it's the first time in my life I've used them for anything useful:

ls -lu ~/.brew/Cellar/*/*/bin/* | grep 'Oct  4 09:4'

Damn pkg-config from Brew. Dunno what it's getting jammed up on but just brew unlink pkg-config (temporarily) fixes the build. I could probably modify it to log it's called options, but I'm about done with this, just adding this info in case anyone else has the same issue.

Thanks for all this research and (sort of weird?) fix.

I was attempting to install 2.6.5 with ruby-build (via asdf) and getting the same error re: openssl. I also had openssl 1.1 from homebrew. Unlinking pkg-config fixed the issue.

Well I do feel better that my figuring it out has helped another person. :-)

I bet it's asking pkg-config about openSSL and getting told something confusing... so it's half using OpenSSL 1.0 and half using 1.1... just a guess.

Unlinking pgk-config worked for me. Very grateful to yyyc514, I had problems installing ruby with rvm, then tried rbenv, and finally got to this. Days in the wilderness! However, it is unclear to me what I should do after the ruby is installed. Should I relink with brew link pkg-config until I need to install another ruby?

Should I relink with brew link pkg-config until I need to install another ruby?

That's what I'd do. I imagine it's helpful for keeping the whole brew build env in sync.

Wow! thank you guys. This also works on OSx 10.15.1 when installing ruby-2.6.5 via ruby-install. I want to make sure this comes higher in the google search. I've been having this issue for a while.

Do we need [email protected] from homebrew? Do we need to relink the pkg-config? what would happen if we didn't?

Cheers guys!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kriscard picture kriscard  ยท  5Comments

arpitchauhan picture arpitchauhan  ยท  4Comments

edap picture edap  ยท  3Comments

tom-mayer picture tom-mayer  ยท  3Comments

dpaluy picture dpaluy  ยท  6Comments