Subject:
Re: [ruby-ffi] Re: Arch build error due to ruby trunk compile options
From:
Jon
Date:
8/29/12 11:47 AM
To:
ruby-ffi@googlegroups.com

Quick smoke tests on my Arch system for `1.1.6.pre1` look good.

[jon@archee ffi-git]$ uname -a
Linux archee 3.5.3-1-ARCH #1 SMP PREEMPT Sun Aug 26 08:15:06 UTC 2012 i686 GNU/Linux

[jon@archee ffi-git]$ gcc --version
gcc (GCC) 4.7.1 20120721 (prerelease)

[jon@archee ffi-git]$ ruby --version
ruby 2.0.0dev (2012-08-29 trunk 36843) [i686-linux]

[jon@archee ffi-git]$ git ilog -3 --oneline
* 2bb63e5 (HEAD, tag: 1.1.6.pre1, origin/ffi-1.1) Bump version to 1.1.6.pre1
* db3d4ec Merge a lot of warning fixes from master
* 3ba0138 Make more dirs based on target stem

[jon@archee ffi-git]$ rake gem
...
cd pkg/ffi-1.1.6.pre1
  Successfully built RubyGem
  Name: ffi
  Version: 1.1.6.pre1
  File: ffi-1.1.6.pre1.gem
mv ffi-1.1.6.pre1.gem ../ffi-1.1.6.pre1.gem

[jon@archee ffi-git]$ gem i pkg/ffi-1.1.6.pre1.gem --user-install
Building native extensions.  This could take a while...
Successfully installed ffi-1.1.6.pre1
1 gem installed

[jon@archee ffi-git]$ ripl -rffi
>> puts $LOADED_FEATURES.grep(/ffi/)
/home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.6.pre1/lib/ffi_c.so
/home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.6.pre1/lib/ffi/platform.rb
...
>> %w[LIBC NAME ADDRESS_SIZE].each { |i| puts eval("FFI::Platform::#{i}") }
libc.so.6
i386-linux
32



> I pushed those changes in 1.2.0.dev4 and 1.1.6.pre1
> 
> It'd be nice if 1.1.6.pre1 in particular got some testing love by people 
> running ruby-head.
> 
> On Friday, 24 August 2012 02:28:01 UTC+10, Jon wrote:
> >
> > :) 
> >
> > [jon@archee ffi-git]$ git log -1 --oneline 
> > 20c243a Add back ffiStatus lvar to rbffi_MethodHandle_Init() 
> >
> > [jon@archee ffi-git]$ gem i pkg/ffi-1.2.0.devmaster.gem --user-install 
> > Building native extensions.  This could take a while... 
> > Successfully installed ffi-1.2.0.devmaster 
> > 1 gem installed 
> >
> >
> > > eek => MethodHandle.c:340:5: error: 'ffiStatus' undeclared (first use in 
> > this function) 
> > > 
> > > 
> > > [jon@archee ~]$ gem i ffi --pre --user-install 
> > > Fetching: ffi-1.2.0.dev3.gem (100%) 
> > > Building native extensions.  This could take a while... 
> > > ERROR:  Error installing ffi: 
> > >         ERROR: Failed to build gem native extension. 
> > > 
> > >         /usr/local/bin/ruby extconf.rb 
> > > checking for ffi_call() in -lffi... yes 
> > > checking for ffi_prep_closure()... yes 
> > > checking for ffi_raw_call()... yes 
> > > checking for ffi_prep_raw_closure()... yes 
> > > checking for rb_thread_blocking_region()... yes 
> > > checking for ruby_native_thread_p()... yes 
> > > checking for rb_thread_call_with_gvl()... yes 
> > > checking for ffi_prep_cif_var()... yes 
> > > creating extconf.h 
> > > creating Makefile 
> > > 
> > > make 
> > > compiling Pointer.c 
> > > compiling Platform.c 
> > > compiling Types.c 
> > > compiling MappedType.c 
> > > compiling Buffer.c 
> > > compiling Call.c 
> > > Call.c: In function 'do_blocking_call': 
> > > Call.c:281:5: warning: 'rb_thread_blocking_region' is deprecated 
> > (declared at /usr/local/include/ruby-2.0.0/ruby/intern.h:823) 
> > [-Wdeprecated-declarations] 
> > > compiling LongDouble.c 
> > > compiling ClosurePool.c 
> > > compiling StructByReference.c 
> > > compiling ArrayType.c 
> > > compiling Variadic.c 
> > > compiling MemoryPointer.c 
> > > compiling Struct.c 
> > > compiling AbstractMemory.c 
> > > compiling MethodHandle.c 
> > > MethodHandle.c: In function 'rbffi_MethodHandle_Init': 
> > > MethodHandle.c:340:5: error: 'ffiStatus' undeclared (first use in this 
> > function) 
> > > MethodHandle.c:340:5: note: each undeclared identifier is reported only 
> > once for each function it appears in 
> > > make: *** [MethodHandle.o] Error 1 
> > > 
> > > 
> > > 
> > > > Can you try 1.2.0.dev3 ?  It should eliminate the warnflags MRI puts 
> > in 
> > > > there. 
> > > > 
> > > > On Friday, 10 August 2012 06:16:10 UTC+10, Jon wrote: 
> > > > > 
> > > > > With ruby trunk the last few ffi gem releases have failed to build 
> > on my 
> > > > > Arch 3.4.7 32bit dev system with gcc 4.7.1 (20120721). 
> > > > > 
> > > > > Given the details and workaround info below, the root cause appears 
> > to be 
> > > > > recent `configure.in` ansi compliance mods: 
> > > > > 
> > > > >   https://github.com/ruby/ruby/blob/trunk/configure.in#L619-635 
> > > > > 
> > > > > Looks like others are running into as well 
> > > > > 
> > > > >   https://github.com/flori/json/issues/142 
> > > > > 
> > > > > While I've only briefly investigated, I don't have time to fully 
> > look into 
> > > > > it. But I don't want to forget about it. 
> > > > > 
> > > > > 
> > > > > 
> > > > > *** GEM UPDATE FAILURE *** 
> > > > > 
> > > > > [jon@archee ~]$ gem update ffi --user-install 
> > > > > Updating installed gems 
> > > > > Updating ffi 
> > > > > Fetching: ffi-1.1.5.gem (100%) 
> > > > > Building native extensions.  This could take a while... 
> > > > > ERROR:  Error installing ffi: 
> > > > >         ERROR: Failed to build gem native extension. 
> > > > > 
> > > > >         /usr/local/bin/ruby extconf.rb 
> > > > > checking for ffi_call() in -lffi... yes 
> > > > > checking for ffi_prep_closure()... yes 
> > > > > checking for ffi_raw_call()... yes 
> > > > > checking for ffi_prep_raw_closure()... yes 
> > > > > checking for rb_thread_blocking_region()... yes 
> > > > > checking for ruby_native_thread_p()... yes 
> > > > > checking for rb_thread_call_with_gvl()... yes 
> > > > > creating extconf.h 
> > > > > creating Makefile 
> > > > > 
> > > > > make 
> > > > > compiling Pointer.c 
> > > > > In file included from Pointer.c:34:0: 
> > > > > rbffi_endian.h:46:4: error: #error "Cannot determine the endian-ness 
> > of 
> > > > > this platform" 
> > > > > Pointer.c: In function 'ptr_order': 
> > > > > Pointer.c:339:59: error: 'BYTE_ORDER' undeclared (first use in this 
> > > > > function) 
> > > > > Pointer.c:339:59: note: each undeclared identifier is reported only 
> > once 
> > > > > for each function it appears in 
> > > > > Pointer.c:339:72: error: 'BIG_ENDIAN' undeclared (first use in this 
> > > > > function) 
> > > > > Pointer.c:351:25: error: 'LITTLE_ENDIAN' undeclared (first use in 
> > this 
> > > > > function) 
> > > > > Pointer.c:368:1: warning: control reaches end of non-void function 
> > > > > [-Wreturn-type] 
> > > > > make: *** [Pointer.o] Error 1 
> > > > > 
> > > > > 
> > > > > Gem files will remain installed in 
> > > > > /home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.5 for inspection. 
> > > > > Results logged to 
> > > > > /home/jon/.gem/ruby/2.0.0/gems/ffi-1.1.5/ext/ffi_c/gem_make.out 
> > > > > Nothing to update 
> > > > > 
> > > > > 
> > > > > 
> > > > > *** WORKAROUND *** 
> > > > > 
> > > > > gem update ffi --user-install -- --with-cflags='--std=gnu99' 
> > > > > 
> > > > > 
> > > > > 
> > > > > *** SYSTEM INFO *** 
> > > > > 
> > > > > # rbconfig.rb contents: 
> > > > >   CONFIG["warnflags"] = "-Wall -Wextra -Wno-unused-parameter 
> > > > > -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers 
> > > > > -Wunused-variable -Werror=pointer-arith -Werror=write-strings 
> > > > > -Werror=declaration-after-statement 
> > -Werror=implicit-function-declaration 
> > > > > -ansi -std=iso9899:199409" 
> > > > >   CONFIG["WERRORFLAG"] = "-Werror" 
> > > > > 
> > > > > 
> > > > > [jon@archee ~]$ gem env 
> > > > > RubyGems Environment: 
> > > > >   - RUBYGEMS VERSION: 1.8.24 
> > > > >   - RUBY VERSION: 2.0.0 (2012-08-10 patchlevel -1) [i686-linux] 
> > > > >   - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.0.0 
> > > > >   - RUBY EXECUTABLE: /usr/local/bin/ruby 
> > > > >   - EXECUTABLE DIRECTORY: /usr/local/bin 
> > > > >   - RUBYGEMS PLATFORMS: 
> > > > >     - ruby 
> > > > >     - x86-linux 
> > > > >   - GEM PATHS: 
> > > > >      - /usr/local/lib/ruby/gems/2.0.0 
> > > > >      - /home/jon/.gem/ruby/2.0.0 
> > > > >   - GEM CONFIGURATION: 
> > > > >      - :update_sources => true 
> > > > >      - :verbose => true 
> > > > >      - :benchmark => false 
> > > > >      - :backtrace => false 
> > > > >      - :bulk_threshold => 1000 
> > > > >      - :sources => ["http://rubygems.org"] 
> > > > >      - "gem" => "--no-ri --no-rdoc" 
> > > > >   - REMOTE SOURCES: 
> > > > >      - http://rubygems.org 
> > > > > 
> > > > > 
> > > > > Jon 
> > > > > 
> > > > > --- 
> > > > > Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. 
> > > > > http://thecodeshop.github.com | http://jonforums.github.com/ 
> > > > > twitter: @jonforums 
> > > > > 
> > > 
> > > 
> > > Jon 
> > > 
> > > --- 
> > > Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. 
> > > http://thecodeshop.github.com | http://jonforums.github.com/ 
> > > twitter: @jonforums 
> >
> >
> > Jon 
> >
> > --- 
> > Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat. 
> > http://thecodeshop.github.com | http://jonforums.github.com/ 
> > twitter: @jonforums 
> >


Jon

---
Fail fast. Fail often. Fail publicly. Learn. Adapt. Repeat.
http://thecodeshop.github.com | http://jonforums.github.com/
twitter: @jonforums