bastelfreak
08/24/2023, 10:14 PMSlackbot
08/25/2023, 3:31 AMChristian Michael Tan
08/25/2023, 6:25 AMSlackbot
08/25/2023, 7:08 AMSlackbot
08/25/2023, 9:34 AMSlackbot
08/25/2023, 12:36 PMrunlolarun
08/25/2023, 12:56 PM.gitlab-ci.yml
and it worked perfect until yesterday. All of a sudden, the following error appeared:
/opt/puppetlabs/puppet/lib/ruby/2.7.0/mkmf.rb:471:in `try_do': The compiler
failed to generate an executable file. (RuntimeError)
You have to install development tools first.
from /opt/puppetlabs/puppet/lib/ruby/2.7.0/mkmf.rb:564:in `try_link0'
from /opt/puppetlabs/puppet/lib/ruby/2.7.0/mkmf.rb:582:in `try_link'
from /opt/puppetlabs/puppet/lib/ruby/2.7.0/mkmf.rb:684:in `try_ldflags'
from /opt/puppetlabs/puppet/lib/ruby/2.7.0/mkmf.rb:1851:in `pkg_config'
from extconf.rb:9:in `system_libffi_usable?'
from extconf.rb:42:in `<main>'
To see why this extension failed to compile, please check the mkmf.log which can
be found here:
/home/gitlab-runner/builds/9X6pv1Yx/0/csstaff/puppet/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.15.5/mkmf.log
extconf failed, exit code 1
Gem files will remain installed in
/home/gitlab-runner/builds/9X6pv1Yx/0/csstaff/puppet/vendor/bundle/ruby/2.7.0/gems/ffi-1.15.5
for inspection.
Results logged to
/home/gitlab-runner/builds/9X6pv1Yx/0/csstaff/puppet/vendor/bundle/ruby/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.15.5/gem_make.out
An error occurred while installing ffi (1.15.5), and Bundler cannot continue.
Make sure that `gem install ffi -v '1.15.5' --source '<https://rubygems.org/>'`
succeeds before bundling.
In Gemfile:
puppet was resolved to 7.26.0, which depends on
facter was resolved to 4.4.3, which depends on
sys-filesystem was resolved to 1.4.3, which depends on
ffi
After looking into this further, facter’s latest gem was updated from 4.4.2 to 4.4.3, which seems to be causing the problem.runlolarun
08/25/2023, 1:01 PMChristoph Schug
08/25/2023, 1:03 PMsys-filesystem
(it was missing in the .gemspec
of 4.4.2, 4.4.3 fixed that). sys-filesystem
in turn requires ffi
which a C extension, and therefore requires a C compiler to build, which might be missing on your build system. But mkmk.log
should contain more precise details.runlolarun
08/25/2023, 1:04 PMChristoph Schug
08/25/2023, 1:05 PMmountpoints
fact.runlolarun
08/25/2023, 1:05 PMrunlolarun
08/25/2023, 1:05 PMrunlolarun
08/25/2023, 1:06 PMvendor
directory is missing, thus where can i find that mkmf.log file? find
is not producing anything either.runlolarun
08/25/2023, 1:07 PMlibffi
and libffi-devel
are required for `ffi`gem. They are installed.Christoph Schug
08/25/2023, 1:10 PMgem_make.out
?runlolarun
08/25/2023, 1:12 PM/usr/share/include/ruby.h
, while ruby-devel
provides /usr/include/ruby/ruby.h
runlolarun
08/25/2023, 1:13 PMrunlolarun
08/25/2023, 1:14 PM/opt/puppetlabs/puppet/lib/ruby/gems/2.7.0/extensions/x86_64-linux/2.7.0/ffi-1.15.5/gem_make.out
seems “clean”runlolarun
08/25/2023, 1:17 PMrunlolarun
08/25/2023, 1:17 PM"pkg-config --exists libffi"
| pkg-config --libs libffi
=> "-lffi \n"
"gcc -o conftest -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I. -O2 -g -pipe -Wall -Werror=forma
t-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-swi
tches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -mtune=generic -
fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC conftest.c -L. -L/usr/lib64 -L. -Wl,-z,
relro -Wl,-z,now -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -fstack-protector-strong -rdynamic -Wl,-export-dyna
mic -m64 -lruby -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
6: }
/* end */
Christoph Schug
08/25/2023, 1:27 PMruby-devel
?) and the Ruby provided by the Puppet stack, to be honest.runlolarun
08/25/2023, 1:28 PMrunlolarun
08/25/2023, 1:30 PM$ locate ruby.h
/opt/puppetlabs/puppet/include/ruby-2.7.0/ruby.h
/opt/puppetlabs/puppet/include/ruby-2.7.0/ruby/ruby.h
runlolarun
08/25/2023, 1:31 PMChristoph Schug
08/25/2023, 1:33 PM/usr/share/include/ruby.h
because Puppet's Ruby should look at the right spot for include files
/opt/puppetlabs/puppet/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["rubyhdrdir"]'
/opt/puppetlabs/puppet/include/ruby-2.7.0
runlolarun
08/25/2023, 1:34 PMbastelfreak
08/25/2023, 1:35 PMrunlolarun
08/25/2023, 1:35 PMbundle install --without system_tests --without development --path vendor/bundle --jobs $(nproc)
runlolarun
08/25/2023, 1:35 PM