Page MenuHomePhabricator

translatewiki-ruby2.7-rake job failing because install job now needs lib-ffi, not pre-installed on base image
Closed, ResolvedPublic

Description

13:21:56 Installing fiddle 1.1.8 with native extensions
13:21:57 Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
13:21:57 
13:21:57     current directory: /cache/bundle/ruby/2.7.0/gems/fiddle-1.1.8/ext/fiddle
13:21:57 /usr/bin/ruby2.7 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20260226-50-aa1drn.rb
13:21:57 extconf.rb
13:21:57 checking for --enable-debug-build option... no
13:21:57 checking for ffi.h... no
13:21:57 checking for ffi/ffi.h... no
13:21:57 *** extconf.rb failed ***
13:21:57 Could not create Makefile due to some reason, probably lack of necessary
13:21:57 libraries and/or headers.  Check the mkmf.log file for more details.  You may
13:21:57 need configuration options.
13:21:57 
13:21:57 Provided configuration options:
13:21:57 	--with-opt-dir
13:21:57 	--without-opt-dir
13:21:57 	--with-opt-include
13:21:57 	--without-opt-include=${opt-dir}/include
13:21:57 	--with-opt-lib
13:21:57 	--without-opt-lib=${opt-dir}/lib
13:21:57 	--with-make-prog
13:21:57 	--without-make-prog
13:21:57 	--srcdir=.
13:21:57 	--curdir
13:21:57 	--ruby=/usr/bin/$(RUBY_BASE_NAME)2.7
13:21:57 	--enable-debug-build
13:21:57 	--disable-debug-build
13:21:57 	--with-libffi-source-dir
13:21:57 	--without-libffi-source-dir
13:21:57 	--with-libffi-dir
13:21:57 	--without-libffi-dir
13:21:57 	--with-libffi-include
13:21:57 	--without-libffi-include=${libffi-dir}/include
13:21:57 	--with-libffi-lib
13:21:57 	--without-libffi-lib=${libffi-dir}/lib
13:21:57 	--with-libffi-config
13:21:57 	--without-libffi-config
13:21:57 	--with-pkg-config
13:21:57 	--without-pkg-config
13:21:57 	--with-ffi-dir
13:21:57 	--without-ffi-dir
13:21:57 	--with-ffi-include
13:21:57 	--without-ffi-include=${ffi-dir}/include
13:21:57 	--with-ffi-lib
13:21:57 	--without-ffi-lib=${ffi-dir}/lib
13:21:57 extconf.rb:86:in `<main>': missing libffi. Please install libffi or use
13:21:57 --with-libffi-source-dir with libffi source location. (RuntimeError)
13:21:57 
13:21:57 To see why this extension failed to compile, please check the mkmf.log which can
13:21:57 be found here:
13:21:57 
13:21:57   /cache/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/fiddle-1.1.8/mkmf.log
13:21:57 
13:21:57 extconf failed, exit code 1
13:21:57 
13:21:57 Gem files will remain installed in /cache/bundle/ruby/2.7.0/gems/fiddle-1.1.8
13:21:57 for inspection.
13:21:57 Results logged to
13:21:57 /cache/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/fiddle-1.1.8/gem_make.out
13:21:57 
13:21:57 An error occurred while installing fiddle (1.1.8), and Bundler cannot continue.
13:21:57 Make sure that `gem install fiddle -v '1.1.8' --source 'https://rubygems.org/'`
13:21:57 succeeds before bundling.
13:21:57 
13:21:57 In Gemfile:
13:21:57   puppet was resolved to 4.10.12, which depends on
13:21:57     gettext-setup was resolved to 0.34, which depends on
13:21:57       gettext was resolved to 3.2.9, which depends on
13:21:57         locale was resolved to 2.1.5, which depends on
13:21:57           fiddle
13:21:58 Build step 'Execute shell' marked build as failure

Our Gemfile contents are

source 'https://rubygems.org'

gem 'sync'
gem 'rake'
gem 'xmlrpc'
gem 'puppet', ENV['PUPPET_GEM_VERSION'] || '~> 4.10.9'
gem 'puppetlabs_spec_helper'

Noticed in https://gerrit.wikimedia.org/r/c/translatewiki/+/1244604. Probably some recent update in packages or in the build environment.

Event Timeline

The last re-build of the rake-ruby2.7 image (to 0.2.0-s1) was 2147f1833 back in July last year. This looks like an upstream Ruby change instead that now requires this library? The "Fetching gem metadata from https://rubygems.org/." step suggests it's not our infrastructure that's changed, certainly.

Change #1248003 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] Docker: [rake-ruby2.7] Add ruby-ffi

https://gerrit.wikimedia.org/r/1248003

Looking at https://integration.wikimedia.org/ci/job/translatewiki-ruby2.7-rake/ it seems like it passed on 2026-02-06 but failed on 2026-02-26, so presumably something upstream (fiddle?) made a release with the breaking change between those dates.

I'll add the ruby-ffi for now to unblock this.

Longer-term, can we fix the CI job to have these things installed in the image rather than run an install at run time that can randomly break?

Change #1248003 merged by jenkins-bot:

[integration/config@master] Docker: [rake-ruby2.7] Add ruby-ffi

https://gerrit.wikimedia.org/r/1248003

Mentioned in SAL (#wikimedia-releng) [2026-03-04T13:59:57Z] <James_F> Docker: [rake-ruby2.7] Add ruby-ffi for T418463

Jdforrester-WMF renamed this task from https://integration.wikimedia.org/ci/job/translatewiki-ruby2.7-rake/32/console : FAILURE to translatewiki-ruby2.7-rake job failing because install job now needs lib-ffi, not pre-installed on base image.Mar 4 2026, 2:00 PM

Change #1248010 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] jjb: Use rake-ruby2.7 image with ruby-ffi

https://gerrit.wikimedia.org/r/1248010

Change #1248030 had a related patch set uploaded (by Jforrester; author: Jforrester):

[integration/config@master] Docker: [rake-ruby2.7] Add libffi-dev too

https://gerrit.wikimedia.org/r/1248030

Change #1248030 merged by jenkins-bot:

[integration/config@master] Docker: [rake-ruby2.7] Add libffi-dev too

https://gerrit.wikimedia.org/r/1248030

Mentioned in SAL (#wikimedia-releng) [2026-03-04T15:37:54Z] <James_F> Docker: [rake-ruby2.7] Add libffi-dev too, for T418463

Change #1248010 merged by jenkins-bot:

[integration/config@master] jjb: Use rake-ruby2.7 image with ruby-ffi and libffi-dev

https://gerrit.wikimedia.org/r/1248010