Skip to content

Can't build metasploit-framework because of a stringio build issue #21771

Description

@jvoisin

Steps to reproduce

How'd you do it?

  1. `git clone https://github.com/rapid7/metasploit-framework/
  2. cd metasploit-framework
  3. bundle install --gemfile pwd/Gemfile
  4. get the following stacktrace/error message:
$ bundle install --gemfile `pwd`/Gemfile
Bundler 4.0.16 is running, but your lockfile was generated with 2.5.22. Installing Bundler 2.5.22 and restarting using that version.
Fetching gem metadata from https://rubygems.org/.
Fetching bundler 2.5.22
Installing bundler 2.5.22
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using minitest 6.0.6 (was 5.25.5)
Using unicode-emoji 4.2.0 (was 4.1.0)
Using faraday-retry 2.4.0 (was 2.2.1)
Installing stringio 3.1.1 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/jvoisin/.gems/ruby/4.0.0/gems/stringio-3.1.1/ext/stringio
/usr/bin/ruby -I/usr/share/rubygems extconf.rb
creating Makefile

current directory: /home/jvoisin/.gems/ruby/4.0.0/gems/stringio-3.1.1/ext/stringio
make -j9 DESTDIR\= sitearchdir\=./.gem.20260811-4164546-azrcq4 sitelibdir\=./.gem.20260811-4164546-azrcq4 clean
rm -f 
rm -fr stringio.so stringio.o *.bak mkmf.log .*.time

current directory: /home/jvoisin/.gems/ruby/4.0.0/gems/stringio-3.1.1/ext/stringio
make -j9 DESTDIR\= sitearchdir\=./.gem.20260811-4164546-azrcq4 sitelibdir\=./.gem.20260811-4164546-azrcq4
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.   -fPIC -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 
-mbranch-protection=standard -fasynchronous-unwind-tables -fstack-clash-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -fPIC  -o stringio.o -c stringio.c
stringio.c: In function ‘strio_init’:
stringio.c:294:52: error: passing argument 5 of ‘rb_io_extract_modeenc’ from incompatible pointer type [-Wincompatible-pointer-types]
  294 |     rb_io_extract_modeenc(&vmode, 0, opt, &oflags, &ptr->flags, &convconfig);
      |                                                    ^~~~~~~~~~~
      |                                                    |
      |                                                    int *
In file included from stringio.c:21:
/usr/include/ruby/io.h:892:107: note: expected ‘enum rb_io_mode *’ but argument is of type ‘int *’
  892 | void rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash, int *oflags_p, enum rb_io_mode *fmode_p, rb_io_enc_t *convconfig_p);
      |                                                                                          ~~~~~~~~~~~~~~~~~^~~~~~~
stringio.c: In function ‘strio_set_encoding’:
stringio.c:1844:61: error: passing argument 5 of ‘rb_io_extract_modeenc’ from incompatible pointer type [-Wincompatible-pointer-types]
 1844 |             rb_io_extract_modeenc(&vmode, 0, Qnil, &oflags, &fmode, &convconfig);
      |                                                             ^~~~~~
      |                                                             |
      |                                                             int *
/usr/include/ruby/io.h:892:107: note: expected ‘enum rb_io_mode *’ but argument is of type ‘int *’
  892 | void rb_io_extract_modeenc(VALUE *vmode_p, VALUE *vperm_p, VALUE opthash, int *oflags_p, enum rb_io_mode *fmode_p, rb_io_enc_t *convconfig_p);
      |                                                                                          ~~~~~~~~~~~~~~~~~^~~~~~~
make: *** [Makefile:252: stringio.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/jvoisin/.gems/ruby/4.0.0/gems/stringio-3.1.1 for inspection.
Results logged to /home/jvoisin/.gems/ruby/4.0.0/extensions/aarch64-linux/4.0.0/stringio-3.1.1/gem_make.out

  /usr/share/rubygems/rubygems/ext/builder.rb:145:in 'Gem::Ext::Builder.run'
  /usr/share/rubygems/rubygems/ext/builder.rb:66:in 'block in Gem::Ext::Builder.make'
  /usr/share/rubygems/rubygems/ext/builder.rb:58:in 'Array#each'
  /usr/share/rubygems/rubygems/ext/builder.rb:58:in 'Gem::Ext::Builder.make'
  /usr/share/rubygems/rubygems/ext/ext_conf_builder.rb:44:in 'Gem::Ext::ExtConfBuilder.build'
  /usr/share/rubygems/rubygems/ext/builder.rb:239:in 'Gem::Ext::Builder#build_extension'
  /usr/share/rubygems/rubygems/ext/builder.rb:271:in 'block in Gem::Ext::Builder#build_extensions'
  /usr/share/rubygems/rubygems/ext/builder.rb:270:in 'Array#each'
  /usr/share/rubygems/rubygems/ext/builder.rb:270:in 'Gem::Ext::Builder#build_extensions'
  /usr/share/rubygems/rubygems/installer.rb:822:in 'Gem::Installer#build_extensions'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/rubygems_gem_installer.rb:109:in 'Bundler::RubyGemsGemInstaller#build_extensions'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/rubygems_gem_installer.rb:28:in 'Bundler::RubyGemsGemInstaller#install'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/source/rubygems.rb:205:in 'Bundler::Source::Rubygems#install'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/installer/gem_installer.rb:55:in 'Bundler::GemInstaller#install'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/installer/gem_installer.rb:17:in 'Bundler::GemInstaller#install_from_spec'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/installer/parallel_installer.rb:133:in 'Bundler::ParallelInstaller#do_install'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/installer/parallel_installer.rb:124:in 'block in Bundler::ParallelInstaller#worker_pool'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/worker.rb:62:in 'Bundler::Worker#apply_func'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/worker.rb:57:in 'block in Bundler::Worker#process_queue'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/worker.rb:54:in 'Kernel#loop'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/worker.rb:54:in 'Bundler::Worker#process_queue'
  /home/jvoisin/.gems/ruby/4.0.0/gems/bundler-2.5.22/lib/bundler/worker.rb:90:in 'block (2 levels) in Bundler::Worker#create_threads'

An error occurred while installing stringio (3.1.1), and Bundler cannot continue.

In Gemfile:
  debug was resolved to 1.11.0, which depends on
    irb was resolved to 1.15.2, which depends on
      rdoc was resolved to 6.15.0, which depends on
        psych was resolved to 5.3.1, which depends on
          stringio
[5]
$

stringio 3.1.1 is old, so odds are that some dependencies do need to be updated?

Metasploit version

01c506e7dd937080b3d644815d75cfba5939eb8a (HEAD -> master, origin/master, origin/HEAD) Merge pull request #21748 from zeroSteiner/feat/nyan-banner

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status
    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions