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

Build failure on 1.9.3: ruby/thread.h: No such file or directory #700

Closed
olleolleolle opened this issue May 20, 2019 · 5 comments
Closed

Comments

@olleolleolle
Copy link
Contributor

olleolleolle commented May 20, 2019

This issue is about the build failure in https://travis-ci.org/colszowka/simplecov/jobs/534519517

Details

There was a build failure putting ffi together in a Travis build:

Build failure message

current directory:
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/ffi-1.11.0/ext/ffi_c
/home/travis/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r
./siteconf20190519-6015-12z6hsq.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_closure_alloc()... yes
checking for shlwapi.h... no
checking for rb_thread_call_without_gvl()... yes
checking for ruby_native_thread_p()... yes
checking for ruby_thread_has_gvl_p()... no
checking for ffi_prep_cif_var()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
creating extconf.h
creating Makefile
current directory:
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/ffi-1.11.0/ext/ffi_c
make  clean
current directory:
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/ffi-1.11.0/ext/ffi_c
make
compiling Call.c
Call.c:46:25: fatal error: ruby/thread.h: No such file or directory
 #include <ruby/thread.h>
                         ^
compilation terminated.
make: *** [Call.o] Error 1
make failed, exit code 2
Gem files will remain installed in
/home/travis/.rvm/gems/ruby-1.9.3-p551/gems/ffi-1.11.0 for inspection.
Results logged to
/home/travis/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-linux/1.9.1/ffi-1.11.0/gem_make.out
An error occurred while installing ffi (1.11.0), and Bundler cannot
continue.
Make sure that `gem install ffi -v '1.11.0' --source 'https://rubygems.org/'`
succeeds before bundling.
In ruby_19.gemfile:
  aruba was resolved to 0.14.9, which depends on
    ffi

Proposed Solution

Either: add a check for "does thread.h exist here?"

Related: eventmachine/eventmachine#508 checks for thread.h in extconf.rb.

Or: Pin to ffi-1.10.0 as a workaround in projects. Thanks, @bilcus for finding this.

Related: FFI's #683 removed 1.9 and 1.8 compatibility code.

@olleolleolle olleolleolle changed the title Failed to build ffi on 1.9.3 Build failure on 1.9.3: ruby/thread.h: No such file or directory May 20, 2019
@olleolleolle
Copy link
Contributor Author

@larskanis Does this description explain what I mean?

@bilcus
Copy link

bilcus commented May 20, 2019

Can confirm that this error was introduced in ffi-1.11.0. Pin to ffi-1.10.0 as a workaround.

@larskanis
Copy link
Member

Ruby-ffi is no longer compatible to ruby-1.9.3. I'll release a new ffi version which clarifies this in the gemspec. See also #699

@pohmelie
Copy link

@larskanis
If you release new version, then 1.11.0 still will fail on installation in case of dependency. I mean, if I want to install lets say fpm on ruby 1.9.x, then package manager will still download and use 1.11.0. Am I right?

@larskanis
Copy link
Member

@pohmelie You can try it out now. On ruby-1.9.3-p448 rubygems-2.1.5 isn't smart enough to pick an older version, but complains about the required ruby version of ffi-1.11.1. However bundler-1.17.3 automatically switched to ffi-1.10.0 after I yanked ffi-1.11.0.

Sorry for the inconvenience. I hope this fixes the issue for you...

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

4 participants