Bug #7227

failed to build native extension for bcrypt-ruby gem under cygwin on windows xp

Added by Abraham Polishchuk over 1 year ago. Updated 9 months ago.

[ruby-core:48514]
Status:Rejected
Priority:Normal
Assignee:Aaron Patterson
Category:build
Target version:next minor
ruby -v:1.9.3-p286 Backport:

Description

I am setting up a testing agent on Windows XP for a Rails App. This question was posted by me on Stackoverflow, where, members of the community suggested that this was in fact a Ruby Bug I should report here. For consistency purposes, the original StackOverflow Post can be found here:
http://stackoverflow.com/questions/13057452/failed-to-build-native-extension-for-bcrypt-ruby-gem-under-cygwin-on-windows-xp

To enforce consistency between Agents, I am installing it through Bundler with RVM with Cygwin.

The following is the result of running bundle install in the project directory(EDIT: Note that running gem install bcrypt-ruby produces identical output):

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

/goBaltoEngineering/.rvm/rubies/ruby-1.9.3-p125/bin/ruby.exe extconf.rb

creating Makefile

make
compiling bcryptext.c
compiling crypt.c
compiling crypt
blowfish.c
compiling cryptgensalt.c
compiling wrapper.c
In file included from wrapper.c:27:0:
/goBaltoEngineering/.rvm/rubies/ruby-1.9.3-p125/include/ruby-1.9.1/ruby/backward/util.h:2:2: warning: #warning use "ruby/util.h" instead of bare "util.h"
linking shared-object bcrypt
ext.so
bcryptext.o:bcryptext.c:(.text+0x29): undefined reference to _ruby_bcrypt'
collect2: ld returned 1 exit status
Makefile:207: recipe for target
bcryptext.so' failed
make: *** [bcrypt
ext.so] Error 1

Gem files will remain installed in /goBaltoEngineering/.rvm/gems/ruby-1.9.3-p125@togo/gems/bcrypt-ruby-3.0.1 for inspection.
Results logged to /goBaltoEngineering/.rvm/gems/ruby-1.9.3-p125@togo/gems/bcrypt-ruby-3.0.1/ext/mri/gem_make.out
An error occurred while installing bcrypt-ruby (3.0.1), and Bundler cannot continue.
Make sure that gem install bcrypt-ruby -v '3.0.1' succeeds before bundling.
the cygwin gcc package is installed:

$ whereis gcc
gcc: /bin/gcc.exe /usr/bin/gcc.exe /lib/gcc /usr/lib/gcc /cygdrive/e/Cygwin/bin/gcc.exe /usr/share/man/man1/gcc.1.gz

$ gcc -v
Using built-in specs.
COLLECTGCC=gcc
COLLECT
LTOWRAPPER=/usr/lib/gcc/i686-pc-cygwin/4.5.3/lto-wrapper.exe
Target: i686-pc-cygwin
Configured with: /gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3/configure --srcdir=/gnu/gcc/releases/respins/4.5.3-3/gcc4-4.5.3-3/src/gcc-4.5.3 --prefix=/usr --exec- prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib -- datadir=/usr/share --localstatedir=/var --sysconfdir=/etc --datarootdir=/usr/share -- docdir=/usr/share/doc/gcc4 -C --datadir=/usr/share --infodir=/usr/share/info -- mandir=/usr/share/man -v --with-gmp=/usr --with-mpfr=/usr --enable-bootstrap --enable-version-specific-runtime-libs --libexecdir=/usr/lib --enable-static --enable-shared --enable-shared-libgcc --disable-
cxaatexit --with-gnu-ld --with-gnu-as --with-dwarf2 --disable-sjlj-exceptions --enable-languages=ada,c,c++,fortran,java,lto,objc,obj-c++ --enable-graphite --enable-lto --enable-java-awt=gtk --disable-symvers --enable-libjava --program-suffix=-4 --enable-libgomp --enable-libssp --enable-libada --enable-threads=posix --with-arch=i686 --with-tune=generic --enable-libgcj-sublibs CC=gcc-4 CXX=g++-4 CCFORTARGET=gcc-4 CXXFORTARGET=g++-4 GNATMAKEFORTARGET=gnatmake GNATBINDFORTARGET=gnatbind --with-ecj-jar=/usr/share/java/ecj.jar
Thread model: posix
gcc version 4.5.3 (GCC)
as is bcrypt:

$ whereis bcrypt
bcrypt: /bin/bcrypt.exe /usr/bin/bcrypt.exe /cygdrive/e/Cygwin/bin/bcrypt.exe /usr/share/man/man1/bcrypt.1.gz

bcrypt -v
bcrypt: unknown option -- v
Usage is: /bin/bcrypt -[orc][-sN] file1 file2..
-o Write output to standard out
-r Do NOT remove input files after processing
-c Do NOT compress files before encryption
-sN How many times to overwrite input files with random data
Results of further research:

Setting

    rvm use system

(in my case 1.9.3-p286) allows bcrypt-ruby to install without incident

Installing 1.9.3-p286 through rvm and setting

    rvm use 1.9.3-p286

Results in an identical (bar the ruby version) error message.

Installing on Mac OS X works without a hitch on numerous developer stations and several Mac Agents.

History

#1 Updated by Yusuke Endoh over 1 year ago

  • Status changed from Open to Assigned
  • Assignee set to Aaron Patterson

Aaron, are you one of bcrypt-ruby developers?
Do you know anything about this issue?
Looks related to: https://github.com/codahale/bcrypt-ruby/issues/46

Yusuke Endoh mame@tsg.ne.jp

#2 Updated by Yui NARUSE about 1 year ago

  • Target version changed from 1.9.3 to next minor

#3 Updated by Aaron Patterson 9 months ago

  • Status changed from Assigned to Rejected

Looks like Aman fixed this in the bcrypt repository. It is not a bug in MRI, but a problem with the bcrypt-ruby extension.

Also available in: Atom PDF