carlhuda/bundler — Issue #1513: Bundler fail to build ffi with native extensions
Author: ccocchi
Created: 2011-11-02 21:04:55+00:00
State: open

Trying to run `bundle install` get me this error

```
/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:552:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/Users/Coki/.rvm/rubies/ruby-1.9.3-p0/bin/ruby extconf.rb
checking for ffi.h in /usr/local/include... no
checking for rb_thread_blocking_region()... yes
checking for ruby_thread_has_gvl_p()... no
checking for ruby_native_thread_p()... yes
checking for rb_thread_call_with_gvl()... yes
creating extconf.h
creating Makefile

make
Configuring libffi
cd /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.7/ext/ffi_c/libffi && make
make "AR_FLAGS=" "CC_FOR_BUILD=" "CFLAGS=" "CXXFLAGS=" "CFLAGS_FOR_BUILD=" "CFLAGS_FOR_TARGET=" "INSTALL=/usr/bin/install -c" "INSTALL_DATA=/usr/bin/install -c -m 644" "INSTALL_PROGRAM=/usr/bin/install -c" "INSTALL_SCRIPT=/usr/bin/install -c" "JC1FLAGS=" "LDFLAGS=" "LIBCFLAGS=" "LIBCFLAGS_FOR_TARGET=" "MAKE=make" "MAKEINFO=/bin/sh /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.7/ext/ffi_c/libffi/missing --run makeinfo " "PICFLAG=" "PICFLAG_FOR_TARGET=" "RUNTESTFLAGS=" "SHELL=/bin/sh" "exec_prefix=/usr/local" "infodir=/usr/local/share/info" "libdir=/usr/local/lib" "prefix=/usr/local" "AR=ar" "AS=as" "CC=/usr/bin/gcc-4.2" "CXX=g++" "LD=ld" "NM=/usr/bin/nm" "RANLIB=ranlib" "DESTDIR=" all-recursive
Making all in include
make[3]: Nothing to be done for `all'.
Making all in testsuite
make[3]: Nothing to be done for `all'.
Making all in man
make[3]: Nothing to be done for `all'.
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/debug.lo src/debug.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/debug.c -fno-common -DPIC -o src/.libs/debug.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/prep_cif.lo src/prep_cif.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/prep_cif.c -fno-common -DPIC -o src/.libs/prep_cif.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/types.lo src/types.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/types.c -fno-common -DPIC -o src/.libs/types.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/raw_api.lo src/raw_api.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/raw_api.c -fno-common -DPIC -o src/.libs/raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/java_raw_api.lo src/java_raw_api.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/java_raw_api.c -fno-common -DPIC -o src/.libs/java_raw_api.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/closures.lo src/closures.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/closures.c -fno-common -DPIC -o src/.libs/closures.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/x86/ffi.lo src/x86/ffi.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/x86/ffi.c -fno-common -DPIC -o src/x86/.libs/ffi.o
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c -o src/x86/darwin.lo src/x86/darwin.S
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c src/x86/darwin.S -fno-common -DPIC -o src/x86/.libs/darwin.o
/bin/sh ./libtool --tag=CC --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c -o src/x86/ffi64.lo src/x86/ffi64.c
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -Wall -g -fexceptions -c src/x86/ffi64.c -fno-common -DPIC -o src/x86/.libs/ffi64.o
/bin/sh ./libtool --mode=compile /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c -o src/x86/darwin64.lo src/x86/darwin64.S
libtool: compile: /usr/bin/gcc-4.2 -DHAVE_CONFIG_H -I. -I. -I./include -Iinclude -I./src -I. -I./include -Iinclude -I./src -c src/x86/darwin64.S -fno-common -DPIC -o src/x86/.libs/darwin64.o
/bin/sh ./libtool --tag=CC --mode=link /usr/bin/gcc-4.2 -Wall -g -fexceptions -version-info `grep -v '^#' ./libtool-version` -o libffi.la -rpath /usr/local/lib src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/darwin.lo src/x86/ffi64.lo src/x86/darwin64.lo
libtool: link: /usr/bin/gcc-4.2 -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o .libs/libffi.5.dylib src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/darwin.o src/x86/.libs/ffi64.o src/x86/.libs/darwin64.o -install_name /usr/local/lib/libffi.5.dylib -compatibility_version 6 -current_version 6.10 -Wl,-single_module
libtool: link: dsymutil .libs/libffi.5.dylib || :
libtool: link: (cd ".libs" && rm -f "libffi.dylib" && ln -s "libffi.5.dylib" "libffi.dylib")
libtool: link: ( cd ".libs" && rm -f "libffi.la" && ln -s "../libffi.la" "libffi.la" )
/bin/sh ./libtool --tag=CC --mode=link /usr/bin/gcc-4.2 -Wall -g -fexceptions -o libffi_convenience.la src/debug.lo src/prep_cif.lo src/types.lo src/raw_api.lo src/java_raw_api.lo src/closures.lo src/x86/ffi.lo src/x86/darwin.lo src/x86/ffi64.lo src/x86/darwin64.lo
libtool: link: ar cru .libs/libffi_convenience.a src/.libs/debug.o src/.libs/prep_cif.o src/.libs/types.o src/.libs/raw_api.o src/.libs/java_raw_api.o src/.libs/closures.o src/x86/.libs/ffi.o src/x86/.libs/darwin.o src/x86/.libs/ffi64.o src/x86/.libs/darwin64.o
libtool: link: ranlib .libs/libffi_convenience.a
ranlib: file: .libs/libffi_convenience.a(ffi.o) has no symbols
ranlib: file: .libs/libffi_convenience.a(darwin.o) has no symbols
libtool: link: ( cd ".libs" && rm -f "libffi_convenience.la" && ln -s "../libffi_convenience.la" "libffi_convenience.la" )
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
compiling ClosurePool.c
ClosurePool.c: In function ‘rbffi_ClosurePool_Free’:
ClosurePool.c:113: warning: implicit conversion shortens 64-bit value into a 32-bit value
ClosurePool.c: In function ‘rbffi_Closure_Free’:
ClosurePool.c:199: warning: implicit conversion shortens 64-bit value into a 32-bit value
ClosurePool.c: In function ‘getPageSize’:
ClosurePool.c:221: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling DataConverter.c
compiling DynamicLibrary.c
compiling ffi.c
compiling Function.c
compiling FunctionInfo.c
FunctionInfo.c: In function ‘fntype_initialize’:
FunctionInfo.c:108: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling LastError.c
compiling MappedType.c
compiling MemoryPointer.c
MemoryPointer.c: In function ‘memptr_malloc’:
MemoryPointer.c:95: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling MethodHandle.c
MethodHandle.c: In function ‘trampoline_offset’:
MethodHandle.c:271: warning: implicit conversion shortens 64-bit value into a 32-bit value
MethodHandle.c: In function ‘trampoline_size’:
MethodHandle.c:310: warning: implicit conversion shortens 64-bit value into a 32-bit value
compiling Platform.c
compiling Pointer.c
compiling Struct.c
Struct.c: In function ‘struct_initialize’:
Struct.c:100: warning: implicit conversion shortens 64-bit value into a 32-bit value
Struct.c: In function ‘struct_set_pointer’:
Struct.c:316: warning: comparison between signed and unsigned
Struct.c: In function ‘inline_array_offset’:
Struct.c:453: warning: comparison between signed and unsigned
Struct.c:457: warning: implicit conversion shortens 64-bit value into a 32-bit value
Struct.c: In function ‘inline_array_each’:
Struct.c:543: warning: comparison between signed and unsigned
Struct.c: In function ‘inline_array_to_a’:
Struct.c:561: warning: comparison between signed and unsigned
compiling StructByReference.c
compiling StructByValue.c
compiling StructLayout.c
StructLayout.c: In function ‘struct_layout_initialize’:
StructLayout.c:351: warning: implicit conversion shortens 64-bit value into a 32-bit value
StructLayout.c:377: error: lvalue required as left operand of assignment
make: *** [StructLayout.o] Error 1

Gem files will remain installed in /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.7 for inspection.
Results logged to /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.7/ext/ffi_c/gem_make.out
from /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:530:in `block in build_extensions'
from /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `each'
from /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:505:in `build_extensions'
from /Users/Coki/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:180:in `install'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/source.rb:90:in `block in install'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:78:in `preserve_paths'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/source.rb:89:in `install'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/installer.rb:73:in `block in install_gem_from_spec'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/rubygems_integration.rb:93:in `with_build_args'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/installer.rb:72:in `install_gem_from_spec'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/installer.rb:56:in `block in run'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/installer.rb:55:in `run'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/installer.rb:12:in `install'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/cli.rb:219:in `install'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/vendor/thor/task.rb:22:in `run'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/vendor/thor.rb:263:in `dispatch'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/lib/bundler/vendor/thor/base.rb:386:in `start'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.1.rc/bin/bundle:13:in `'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/bin/bundle:19:in `load'
from /Users/Coki/.rvm/gems/ruby-1.9.3-p0/bin/bundle:19:in `

'
```

with ruby-1.9.3-p0 and bundler 1.1rc