travis-ci / dpl

Dpl (dee-pee-ell) is a deploy tool made for continuous deployment.
MIT License
1.29k stars 367 forks source link

Error during installation of dpl #1287

Open Brenneisen opened 1 month ago

Brenneisen commented 1 month ago

During the installation of dpl the following error occurred:

$ rvm use $(travis_internal_ruby) --fuzzy do ruby -S gem uninstall -aIx dpl
Gem 'dpl' is not installed
$ rvm use $(travis_internal_ruby) --fuzzy do ruby -S gem install dpl --pre
Successfully installed mime-0.4.4
Successfully installed json_pure-2.7.2
Successfully installed excon-0.111.0
Successfully installed travis-packagecloud-ruby-1.1.0
Successfully installed regstry-1.0.15
Successfully installed travis-cl-1.2.4
Successfully installed dpl-2.0.5.beta.2
7 gems installed

Install deployment dependencies
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse

/home/travis/.rvm/rubies/ruby-3.3.5/bin/ruby extconf.rb
creating Makefile

current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse
make DESTDIR\= sitearchdir\=./.gem.20240911-6569-l3m9wr sitelibdir\=./.gem.20240911-6569-l3m9wr clean

current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse
make DESTDIR\= sitearchdir\=./.gem.20240911-6569-l3m9wr sitelibdir\=./.gem.20240911-6569-l3m9wr
compiling cparse.c
gcc: error: unrecognized command-line option ‘-fdeclspec’
gcc: error: unrecognized command-line option ‘-Wextra-tokens’; did you mean ‘-Wextra-semi’?
gcc: error: unrecognized command-line option ‘-Wdivision-by-zero’; did you mean ‘-Wdiv-by-zero’?
gcc: error: unrecognized command-line option ‘-Wshorten-64-to-32’
make: *** [Makefile:248: cparse.o] Error 1

make failed, exit code 2

Gem files will remain installed in /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1 for inspection.
Results logged to /home/travis/.rvm/gems/ruby-3.3.5/extensions/x86_64-linux/3.3.0/racc-1.8.1/gem_make.out

  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:125:in `run'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:51:in `block in make'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `each'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:43:in `make'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:193:in `build_extension'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:227:in `block in build_extensions'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `each'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/ext/builder.rb:224:in `build_extensions'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/3.3.0/rubygems/installer.rb:853:in `build_extensions'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/rubygems_gem_installer.rb:109:in `build_extensions'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/source/rubygems.rb:205:in `install'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/installer/gem_installer.rb:54:in `install'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/installer/parallel_installer.rb:132:in `do_install'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/installer/parallel_installer.rb:123:in `block in worker_pool'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/worker.rb:62:in `apply_func'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/worker.rb:57:in `block in process_queue'
  <internal:kernel>:187:in `loop'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/worker.rb:54:in `process_queue'
  /home/travis/.rvm/rubies/ruby-3.3.5/lib/ruby/gems/3.3.0/gems/bundler-2.5.18/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing racc (1.8.1), and Bundler cannot continue.

In Gemfile:
  nokogiri was resolved to 1.16.7, which depends on
    racc
 (Bundler::InstallError)
failed to deploy
duckstop commented 1 month ago

Bump. This is happening for us as well.

os: linux
dist: focal

language: ruby

rvm:
  - "2.7.5"

services:
  - docker
deploy:
        - provider: elasticbeanstalk
          access_key_id: ${AWS_ACCESS_KEY_ID}
          secret_access_key: ${AWS_SECRET_ACCESS_KEY}
          region: eu-west-1
          app: {our app}
          env: {our env}
          bucket: {our bucket}
          edge: true
          on:
            branch: development

Error:


Install deployment dependencies
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
    current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse

/home/travis/.rvm/rubies/ruby-3.3.5/bin/ruby extconf.rb

creating Makefile
current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse
make DESTDIR\= sitearchdir\=./.gem.20240912-10121-9phwsw sitelibdir\=./.gem.20240912-10121-9phwsw clean
current directory: /home/travis/.rvm/gems/ruby-3.3.5/gems/racc-1.8.1/ext/racc/cparse
make DESTDIR\= sitearchdir\=./.gem.20240912-10121-9phwsw sitelibdir\=./.gem.20240912-10121-9phwsw

compiling cparse.c
gcc: error: unrecognized command line option ‘-fdeclspec’
gcc: error: unrecognized command line option ‘-Wextra-tokens’; did you mean ‘-Wextra-semi’?
gcc: error: unrecognized command line option ‘-Wdivision-by-zero’; did you mean ‘-Wdiv-by-zero’?
gcc: error: unrecognized command line option ‘-Wshorten-64-to-32’

make: *** [Makefile:248: cparse.o] Error 1
make failed, exit code 2`
duckstop commented 1 month ago

EDIT: Apparently bionic, focal and jammy where updated to ruby v3.3.5 -> https://changelog.travis-ci.com/build-environments-updates-deployed-300293. So why changing the dist works, is beyond me.

Fixed by using a dist with an internal ruby version < 3.3.4.

So this will work:

os: linux
dist: bionic

language: ruby

As bionic comes with ruby v3.3.0

RVM seems to have an compiler version mismatch for prebuilt binaries in 3.3.4 and 3.3.5 -> https://github.com/rubygems/rubygems/issues/8015 and https://github.com/rvm/rvm/issues/5502