Bug #9897

Build fails for fiddle with libffi version 3.1

Added by Juergen Daubert about 1 year ago. Updated 12 months ago.

[ruby-core:62920]
Status:Closed
Priority:Normal
Assignee:Nobuyoshi Nakada
ruby -v:ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-linux] Backport:2.0.0: DONTNEED, 2.1: DONE

Description

ext/fiddle/extconf.rb expects a 3-digit version string from the libffi pkg-config.
Latest libffi is version 3.1 and building of fiddle fails because version is only 2-digit.

Associated revisions

Revision 46485
Added by Nobuyoshi Nakada about 1 year ago

fiddle/extconf.rb: supply 0

  • ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION with 3-digit. libffi 3.1 returns just 2-digit. [Bug #9897]

Revision 46485
Added by Nobuyoshi Nakada about 1 year ago

fiddle/extconf.rb: supply 0

  • ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION with 3-digit. libffi 3.1 returns just 2-digit. [Bug #9897]

Revision 46609
Added by Tomoyuki Chikanaga about 1 year ago

merge revision(s) r46485: [Backport #9897]

* ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION
  with 3-digit.  libffi 3.1 returns just 2-digit.
   [Bug #9897]

History

#1 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Open to Feedback

Does this work?

diff --git a/ext/fiddle/extconf.rb b/ext/fiddle/extconf.rb
index 2190aa9..466d77e 100644
--- a/ext/fiddle/extconf.rb
+++ b/ext/fiddle/extconf.rb
@@ -7,7 +7,8 @@ dir_config 'libffi'
 pkg_config("libffi")
 if ver = pkg_config("libffi", "modversion")
   ver = ver.gsub(/-rc\d+/, '') # If ver contains rc version, just ignored.
-  $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver.split('.') }})
+  ver = (ver.split('.') + [0,0])[0,3]
+  $defs.push(%{-DRUBY_LIBFFI_MODVERSION=#{ '%d%03d%03d' % ver }})
 end

 unless have_header('ffi.h')

#2 Updated by Juergen Daubert about 1 year ago

Yes, that works :) Thank you very much for the quick fix.

#3 Updated by Nobuyoshi Nakada about 1 year ago

  • Backport changed from 2.0.0: UNKNOWN, 2.1: UNKNOWN to 2.0.0: REQUIRED, 2.1: REQUIRED

#4 Updated by Nobuyoshi Nakada about 1 year ago

  • Status changed from Feedback to Closed
  • % Done changed from 0 to 100

Applied in changeset r46485.


fiddle/extconf.rb: supply 0

  • ext/fiddle/extconf.rb: supply 0 to fill RUBY_LIBFFI_MODVERSION with 3-digit. libffi 3.1 returns just 2-digit. [Bug #9897]

#5 Updated by Tomoyuki Chikanaga about 1 year ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: REQUIRED to 2.0.0: REQUIRED, 2.1: DONE

Backported into ruby_2_1 branch at r46609.

#6 Updated by Usaku NAKAMURA 12 months ago

  • Backport changed from 2.0.0: REQUIRED, 2.1: DONE to 2.0.0: DONTNEED, 2.1: DONE

Also available in: Atom PDF