Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing 2.0.0-p0 fails (BUILD FAILED) #309

Closed
paulschreiber opened this issue Feb 25, 2013 · 23 comments
Closed

Installing 2.0.0-p0 fails (BUILD FAILED) #309

paulschreiber opened this issue Feb 25, 2013 · 23 comments

Comments

@paulschreiber
Copy link

Installing 2.0.0 fails, even with CC set manually. Here's the full log:
https://gist.github.com/paulschreiber/5025554

I have Mac OS X 10.8.2 and Xcode 4.6 installed.

And what I saw in console:

$ CC=gcc rbenv install 2.0.0-p0
Downloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...
Installed openssl-1.0.1e to /Users/paul/.rbenv/versions/2.0.0-p0

Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224132426.23268
Results logged to /var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224132426.23268.log

Last 10 log lines:
    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [encdb.h] Abort trap: 6
@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

@paulschreiber - What failure led you to try CC=gcc? You should be able to compile without any override.

@paulschreiber
Copy link
Author

Because it didn't work without CC=gcc, and CC=gcc did fix the compile error I had with 1.9.3-p392.

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

OK. This won't work with gcc since it's symlinked to Xcode's llvm-gcc. Let's address the root issue you encountered instead.

@jeremy jeremy closed this as completed Feb 25, 2013
@paulschreiber
Copy link
Author

Can you stop playing hot potato and closing bug reports? Let's get the problem fixed.

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Sure. What'd you run into without CC set?

@paulschreiber
Copy link
Author

$ rbenv install 2.0.0-p0
Downloading openssl-1.0.1e.tar.gz...
-> https://www.openssl.org/source/openssl-1.0.1e.tar.gz
Installing openssl-1.0.1e...
Installed openssl-1.0.1e to /Users/paul/.rbenv/versions/2.0.0-p0

Downloading ruby-2.0.0-p0.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/2.0/ruby-2.0.0-p0.tar.gz
Installing ruby-2.0.0-p0...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224234545.59265
Results logged to /var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224234545.59265.log

Last 10 log lines:
installing default gems:      /Users/paul/.rbenv/versions/2.0.0-p0/lib/ruby/gems/2.0.0 (build_info, cache, doc, gems, specifications)
                              bigdecimal 1.2.0
                              io-console 0.4.2
                              json 1.7.7
                              minitest 4.3.2
                              psych 2.0.0
                              rake 0.9.6
                              rdoc 4.0.0
                              test-unit 2.0.0.0
The Ruby openssl extension was not compiled. Missing the OpenSSL lib?

Full log: https://gist.github.com/paulschreiber/5027864

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Looks like openssl was built & installed fine, then the ruby extension was configured, but was neither compiled or installed.

Could you keep the build dir, then check ext/openssl/mkmf.log?

@paulschreiber
Copy link
Author

$ cat ruby-2.0.0-p0/ext/openssl/mkmf.log
Failed to configure openssl. It will not be installed.

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Argh. Very informative :trollface:

Perhaps try make in ext/openssl and see whether it gives a little more info.

@paulschreiber
Copy link
Author

Pauls-MBP:openssl paul$ make
make: Nothing to be done for `all'.
Pauls-MBP:openssl paul$ make clean
Pauls-MBP:openssl paul$ make
make: Nothing to be done for `all'.
Pauls-MBP:openssl paul$ ls
Makefile        ossl_bn.c       ossl_ns_spki.c      ossl_pkey_dh.c      ossl_x509attr.c
deprecation.rb      ossl_bn.h       ossl_ns_spki.h      ossl_pkey_dsa.c     ossl_x509cert.c
extconf.rb      ossl_cipher.c       ossl_ocsp.c     ossl_pkey_ec.c      ossl_x509crl.c
lib/            ossl_cipher.h       ossl_ocsp.h     ossl_pkey_rsa.c     ossl_x509ext.c
openssl_missing.c   ossl_config.c       ossl_pkcs12.c       ossl_rand.c     ossl_x509name.c
openssl_missing.h   ossl_config.h       ossl_pkcs12.h       ossl_rand.h     ossl_x509req.c
ossl.c          ossl_digest.c       ossl_pkcs5.c        ossl_ssl.c      ossl_x509revoked.c
ossl.h          ossl_digest.h       ossl_pkcs5.h        ossl_ssl.h      ossl_x509store.c
ossl_asn1.c     ossl_engine.c       ossl_pkcs7.c        ossl_ssl_session.c  ruby_missing.h
ossl_asn1.h     ossl_engine.h       ossl_pkcs7.h        ossl_version.h
ossl_bio.c      ossl_hmac.c     ossl_pkey.c     ossl_x509.c
ossl_bio.h      ossl_hmac.h     ossl_pkey.h     ossl_x509.h

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Looks like some others have had issues building openssl with zlib vs zlib-dynamic.

#304 (comment)

$ ~/.rbenv/versions/2.0.0-p0/openssl/bin/openssl version -f
compiler: cc -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM

Do you show -DZLIB ?

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Ah, try ruby extconf.rb to configure.

@paulschreiber
Copy link
Author

Pauls-MBP:openssl-1.0.1e paul$ ./apps/openssl version -f
WARNING: can't open config file: /Users/paul/.rbenv/versions/2.0.0-p0/openssl/ssl/openssl.cnf
compiler: cc -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -arch x86_64 -O3 -DL_ENDIAN -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM

@paulschreiber
Copy link
Author

Pauls-MBP:openssl paul$ ruby extconf.rb
checking for t_open() in -lnsl... no
checking for socket() in -lsocket... no
checking for assert.h... yes
checking for openssl/ssl.h... yes
checking for OpenSSL_add_all_digests() in -lcrypto... yes
checking for SSL_library_init() in -lssl... yes
checking for openssl/conf_api.h... yes
/private/var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224234545.59265/ruby-2.0.0-p0/ext/openssl/deprecation.rb:8:in `deprecated_warning_flag': undefined method `<<' for nil:NilClass (NoMethodError)
    from /private/var/folders/_1/853w7p5x7p97mt8jw45hvd480000gn/T/ruby-build.20130224234545.59265/ruby-2.0.0-p0/ext/openssl/deprecation.rb:18:in `check_func'
    from extconf.rb:61
Pauls-MBP:openssl paul$ ruby -v
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Thanks @paulschreiber. One more thing: could you try changing https://github.com/sstephenson/ruby-build/blob/master/bin/ruby-build#L551-L552 from no-shared to shared? Seems to have resolved this issue for a couple other people.

@paulschreiber
Copy link
Author

That seems to have fixed it. I didn't actually check the results (had to reboot), but rbenv versions shows 2.0.0-p0 as installed, and rbenv shell 2.0.0-p0 and ruby -v shows 2.0.0p0.

@jeremy
Copy link
Member

jeremy commented Feb 25, 2013

Great! Committed the change.

@tadast
Copy link

tadast commented Feb 27, 2013

I am still having issues with the current master. It seems to get past the openssl stage but fails later with

[BUG] Stack consistency error (sp: 30, bp: 28)

Here's the full log.

I've succeeded to compile by passing in CC=clang, but I've no idea what are the implications of that

@sferik
Copy link
Contributor

sferik commented Feb 27, 2013

@tadast Can you update to the latest Xcode (install the Command Line Tools) and try again?

@tadast
Copy link

tadast commented Feb 28, 2013

@sferik, I have the latest version of Xcode. I've updated the command line tools as well.

✗ gcc -v
Using built-in specs.
Target: i686-apple-darwin11
Configured with: /private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/src/configure --disable-checking --enable-werror --prefix=/Applications/Xcode.app/Contents/Developer/usr/llvm-gcc-4.2 --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-prefix=llvm- --program-transform-name=/^[cg][^.-]*$/s/$/-4.2/ --with-slibdir=/usr/lib --build=i686-apple-darwin11 --enable-llvm=/private/var/tmp/llvmgcc42/llvmgcc42-2336.11~148/dst-llvmCore/Developer/usr/local --program-prefix=i686-apple-darwin11- --host=x86_64-apple-darwin11 --target=i686-apple-darwin11 --with-gxx-include-dir=/usr/include/c++/4.2.1
Thread model: posix
gcc version 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.11.00)

I tried rbenv install with no options and with both CC=/usr/bin/gcc and CC=/usr/bin/gcc-4.2 with the same outcome. Only CC=clang worked. Is there anything else I can do to debug this?

@mauriciomdea
Copy link

I'm having the exact same problem as @tadast here.

@mauriciomdea
Copy link

17 libdyld.dylib 0x00007fff8a49e7e1 start + 0
18 ??? 0x000000000000000b 0x0 + 11

-- Other runtime information -----------------------------------------------

  • Loaded script: ./tool/generic_erb.rb

  • Loaded features:

    0 enumerator.so
    1 /private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/cgi/util.rb

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

/private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:111: [BUG] Stack consistency error (sp: 38, bp: 36)
ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.1]

-- Crash Report log information --------------------------------------------
See Crash Report log file under the one of following:
* ~/Library/Logs/CrashReporter
* /Library/Logs/CrashReporter
* ~/Library/Logs/DiagnosticReports
* /Library/Logs/DiagnosticReports
the more detail of.

-- Control frame information -----------------------------------------------
c:0006 p:0038 s:0038 e:000037 CLASS /private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:111
c:0005 p:0035 s:0034 e:000033 CLASS /private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:107
c:0004 p:0009 s:0032 e:000031 TOP /private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:85 [FINISH]
c:0003 p:---- s:0030 e:000029 CFUNC :require
c:0002 p:0098 s:0026 E:001698 EVAL ./tool/mkconfig.rb:11 [FINISH]
c:0001 p:0000 s:0002 E:001f98 TOP [FINISH]

./tool/mkconfig.rb:11:in <main>' ./tool/mkconfig.rb:11:inrequire'
/private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:85:in <top (required)>' /private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:107:inmodule:FileUtils'
/private/var/folders/t4/64nzkdp91g39j1ynt5mjh_4m0000gn/T/ruby-build.20130509222256.98762/ruby-2.0.0-p0/lib/fileutils.rb:111:in `module:NoWrite'

-- C level backtrace information -------------------------------------------
0 miniruby 0x00000001070bee24 rb_vm_bugreport + 164
1 miniruby 0x0000000106f9695e report_bug + 302
2 miniruby 0x0000000106f96c14 rb_bug + 180
3 miniruby 0x00000001070b4ea0 vm_exec_core + 32080
4 miniruby 0x00000001070b507e vm_exec + 94
5 miniruby 0x00000001070b5f5a rb_iseq_eval + 266
6 miniruby 0x0000000106f9b572 rb_load_internal + 306
7 miniruby 0x0000000106f9ccc1 rb_require_safe + 1313
8 miniruby 0x00000001070a4c54 call_cfunc_1 + 20
9 miniruby 0x00000001070ab126 vm_call_cfunc + 1046
10 miniruby 0x00000001070b9ce0 vm_call_method + 224
11 miniruby 0x00000001070b0363 vm_exec_core + 12819
12 miniruby 0x00000001070b507e vm_exec + 94
13 miniruby 0x00000001070b5e2e rb_iseq_eval_main + 206
14 miniruby 0x0000000106f99cdf ruby_exec_internal + 111
15 miniruby 0x0000000106f9acc2 ruby_run_node + 82
16 miniruby 0x0000000106f610cf main + 79
17 libdyld.dylib 0x00007fff8a49e7e1 start + 0
18 ??? 0x0000000000000009 0x0 + 9

-- Other runtime information -----------------------------------------------

  • Loaded script: ./tool/mkconfig.rb

  • Loaded features:

    0 enumerator.so

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html

make: *** [.rbconfig.time] Abort trap: 6
make: *** Waiting for unfinished jobs....
make: *** [encdb.h] Abort trap: 6

@jeremy
Copy link
Member

jeremy commented May 10, 2013

@tadast @mauriciomdea This is a Ruby 2.0.0 bug: https://bugs.ruby-lang.org/issues/8171

Workaround is to build with clang instead of gcc, or hack around the Ruby typo:

RUBY_CFLAGS="-D_x86_64__" rbenv install 2.0.0-p0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants