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

Discovering why Berkshelf is busted #19

Closed
wants to merge 8 commits into from
Closed

Conversation

johnmccrae
Copy link

Description

Trying to find out why the Berkshelf gem is not working.

Issues Resolved

Check List

  • New functionality includes tests
  • All tests pass
  • RELEASE_NOTES.md has been updated if required (not required for bugfixes, required for API changes)

John McCrae and others added 4 commits August 30, 2023 16:42
@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@sonarqube-for-infrastructure-prod

SonarQube Quality Gate

Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@adriantaut
Copy link

adriantaut commented Sep 26, 2023

hello @johnmccrae what do you mean by berkshelf is busted?

Suddently getting this error without changing much in my automation, any thoughts?

[root@ip-10-174-6-204 ~]# chef-client --version
Chef Infra Client: 18.0.185

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/ruby -v
ruby 3.1.2p20 (2022-04-12 revision 4491bb740a) [x86_64-linux]

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/gem -v
3.3.7

[root@ip-10-174-6-204 ~]# /opt/chef/embedded/bin/gem install berkshelf
Building native extensions. This could take a while...
ERROR:  Error installing berkshelf:
	ERROR: Failed to build gem native extension.

    current directory: /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ffi-1.16.2/ext/ffi_c
/opt/chef/embedded/bin/ruby -I /opt/chef/embedded/lib/ruby/3.1.0 -r ./siteconf20230926-1695-u46cd0.rb extconf.rb
checking for ffi.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/opt/chef/embedded/bin/$(RUBY_BASE_NAME)
	--with-ffi_c-dir
	--without-ffi_c-dir
	--with-ffi_c-include
	--without-ffi_c-include=${ffi_c-dir}/include
	--with-ffi_c-lib
	--without-ffi_c-lib=${ffi_c-dir}/lib
	--enable-debug
	--disable-debug
	--enable-system-libffi
	--disable-system-libffi
	--with-libffi-dir
	--without-libffi-dir
	--with-libffi-include
	--without-libffi-include=${libffi-dir}/include
	--with-libffi-lib
	--without-libffi-lib=${libffi-dir}/lib
	--with-libffi-config
	--without-libffi-config
	--with-pkg-config
	--without-pkg-config
	--with-ffi-dir
	--without-ffi-dir
	--with-ffi-include
	--without-ffi-include=${ffi-dir}/include
	--with-ffi-lib
	--without-ffi-lib=${ffi-dir}/lib
/opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:509:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:635:in `block in try_compile'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:584:in `with_werror'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:635:in `try_compile'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1171:in `block in have_header'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1018:in `block in checking_for'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:362:in `block (2 levels) in postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:332:in `open'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:362:in `block in postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:332:in `open'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:358:in `postpone'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1017:in `checking_for'
	from /opt/chef/embedded/lib/ruby/3.1.0/mkmf.rb:1170:in `have_header'
	from extconf.rb:10:in `system_libffi_usable?'
	from extconf.rb:46:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /opt/chef/embedded/lib/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.16.2/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /opt/chef/embedded/lib/ruby/gems/3.1.0/gems/ffi-1.16.2 for inspection.
Results logged to /opt/chef/embedded/lib/ruby/gems/3.1.0/extensions/x86_64-linux/3.1.0/ffi-1.16.2/gem_make.out

thank you!

PS: also opened #22

@tpowell-progress
Copy link
Collaborator

@adriantaut ffi gem advanced a minor and a few patch versions from the 1.15.5 that was working before. However, it was happening for others as early as ffi-1.13.1 (ffi/ffi#836)

Copy link

sonarcloud bot commented Aug 9, 2024

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@johnmccrae johnmccrae closed this Aug 14, 2024
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

Successfully merging this pull request may close these issues.

3 participants