rubygems / gemstash

A RubyGems.org cache and private gem server
MIT License
753 stars 121 forks source link

Fix JRuby 9.4 install failure re Bigdecimal 3.1.4 #358

Closed olleolleolle closed 1 year ago

olleolleolle commented 1 year ago

In #355, a non-related JRuby install failure showed up.

EDIT: Sequel gem depends on bigdecimal, now. And there is no -java gem release for bigdecimal, yet.

In Gemfile:
  gemstash was resolved to 2.3.0, which depends on
    sequel was resolved to 5.72.0, which depends on
      bigdecimal
olleolleolle commented 1 year ago

Locally, I was unable to install gemstash with JRuby 9.4

I got this sort of error:

The full CI output for install was

$ rvm use jruby-9.4
Using /Users/olle/.rvm/gems/jruby-9.4
$ bundle
Could not find gem 'gemstash x86_64-darwin-19' in source at `.`.

The source contains the following gems matching 'gemstash':
  * gemstash-2.3.0-java
``` /usr/bin/tar -xz -C /home/runner/.rubies -f /home/runner/work/_temp/0f3fde24-eb4f-4b3a-bd70-2b141c206279 Took 0.50 seconds Print Ruby version /home/runner/.rubies/jruby-9.4.3.0/bin/ruby --version jruby 9.4.3.0 (3.1.4) 2023-06-07 3086960792 OpenJDK 64-Bit Server VM 11.0.20+8 on 11.0.20+8 +jit [x86_64-linux] Took 0.69 seconds Installing Bundler > bundle install /home/runner/.rubies/jruby-9.4.3.0/bin/bundle config --local path /home/runner/work/gemstash/gemstash/vendor/bundle /home/runner/.rubies/jruby-9.4.3.0/bin/bundle lock Fetching gem metadata from https://rubygems.org/........ Resolving dependencies....................... Writing lockfile to /home/runner/work/gemstash/gemstash/Gemfile.lock Cache key: setup-ruby-bundler-cache-v6-ubuntu-22.04-x64-jruby-9.4.3.0-wd-/home/runner/work/gemstash/gemstash-with--without--Gemfile.lock-e617f67e33f827ee50b0da0d09735f4df0795a920f69354a554d49ccb2615467 Received 0 of 39737272 (0.0%), 0.0 MBs/sec Received 39737272 of 39737272 (100.0%), 23.2 MBs/sec Cache Size: ~38 MB (39737272 B) /usr/bin/tar -xf /home/runner/work/_temp/295c33d6-6355-4315-a8d3-f2bf495a7ab8/cache.tzst -P -C /home/runner/work/gemstash/gemstash --use-compress-program unzstd Cache restored successfully Found cache for key: setup-ruby-bundler-cache-v6-ubuntu-22.04-x64-jruby-9.4.3.0-wd-/home/runner/work/gemstash/gemstash-with--without--Gemfile.lock-1434d44d4ca0a6cf3024ce141313d164b8a31ab71e3ca5c46ec4031efa26d90c /home/runner/.rubies/jruby-9.4.3.0/bin/bundle install --jobs 4 Fetching gem metadata from https://rubygems.org/....... Using rake 13.0.6 Using bundler 2.3.26 Using concurrent-ruby 1.2.2 Using contracts 0.17 Using builder 3.2.4 Using cucumber-ci-environment 9.2.0 Using minitest 5.19.0 Fetching cucumber-cucumber-expressions 16.1.2 Using public_suffix 5.0.3 Using diff-lcs 1.5.0 Fetching mini_mime 1.1.5 Using cucumber-tag-expressions 4.1.0 Using multi_test 1.1.0 Using ffi 1.15.5 (java) Fetching cucumber-messages 21.0.1 Using rspec-support 3.12.1 Using thor 1.2.2 Using ast 2.4.2 Using base64 0.1.1 Fetching bigdecimal 3.1.4 Installing cucumber-cucumber-expressions 16.1.2 Installing cucumber-messages 21.0.1 Installing mini_mime 1.1.5 Installing bigdecimal 3.1.4 with native extensions Using citrus 3.0.2 Using dalli 3.2.5 Using faraday-em_http 1.0.0 Using faraday-em_synchrony 1.0.0 Using faraday-excon 1.1.0 Using multipart-post 2.3.0 Using faraday-httpclient 1.0.1 Using faraday-net_http_persistent 1.2.0 Using faraday-net_http 1.0.1 Using faraday-patron 1.0.0 Using faraday-retry 1.0.3 Using faraday-rack 1.0.0 Using ruby2_keywords 0.0.5 Using jdbc-sqlite3 3.42.0.0 Using lru_redux 1.1.0 Using nio4r 2.5.9 (java) Using jar-dependencies 0.4.1 Using server_health_check 1.0.2 Using rack 2.2.8 Using tilt 2.2.0 Using json 2.6.3 (java) Using language_server-protocol 3.17.0.3 Using mock_redis 0.37.0 Using parallel 1.23.0 Using racc 1.7.1 (java) Using redis 3.3.5 Using regexp_parser 2.8.1 Using rexml 3.2.6 Using rainbow 3.1.1 Using ruby-progressbar 1.13.0 Using unicode-display_width 2.4.2 Using i18n 1.14.1 Using tzinfo 2.0.6 Using addressable 2.8.5 Using sys-uname 1.2.3 Using webrick 1.8.1 Using rspec-expectations 3.12.3 Using rspec-core 3.12.2 Using rspec-mocks 3.12.6 Fetching cucumber-gherkin 26.2.0 Fetching cucumber-html-formatter 20.4.0 Using faraday-multipart 1.0.4 Using puma 6.3.1 (java) Using server_health_check-rack 0.1.0 Using mustermann 3.0.0 Using rack-protection 3.1.0 Using parser 3.2.2.3 Using rack-test 2.1.0 Using psych 5.1.0 (java) Using rspec 3.12.0 Using activesupport 7.0.7.2 Using faraday 1.10.3 Using sinatra 3.1.0 Using rubocop-ast 1.29.0 Using faraday_middleware 1.2.0 Using sawyer 0.9.2 Using rubocop 1.56.2 Using octokit 7.1.0 Using rubocop-performance 1.19.0 Installing cucumber-gherkin 26.2.0 Installing cucumber-html-formatter 20.4.0 Fetching cucumber-core 11.1.0 Installing cucumber-core 11.1.0 Fetching cucumber 9.0.1 Installing cucumber 9.0.1 Fetching aruba 2.2.0 Installing aruba 2.2.0 Gem::Ext::BuildError: ERROR: Failed to build gem native extension. current directory: /home/runner/work/gemstash/gemstash/vendor/bundle/jruby/3.1.0/gems/bigdecimal-3.1.4/ext/bigdecimal /home/runner/.rubies/jruby-9.4.3.0/bin/jruby -I /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib extconf.rb checking for __builtin_clz()... *** 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 --without-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=/home/runner/.rubies/jruby-9.4.3.0/bin/jruby RuntimeError: The compiler failed to generate an executable file. You have to install development tools first. try_do at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:456 try_compile at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:571 with_werror at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:524 try_compile at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:571 have_builtin_func at extconf.rb:6 checking_for at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:942 postpone at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:350 open at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:320 postpone at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:350 open at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:320 postpone at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:346 checking_for at /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/mkmf.rb:941 have_builtin_func at extconf.rb:5
at extconf.rb:18 To see why this extension failed to compile, please check the mkmf.log which can be found here: /home/runner/work/gemstash/gemstash/vendor/bundle/jruby/3.1.0/extensions/universal-java-11/3.1.0/bigdecimal-3.1.4/mkmf.log extconf failed, exit code 1 Gem files will remain installed in /home/runner/work/gemstash/gemstash/vendor/bundle/jruby/3.1.0/gems/bigdecimal-3.1.4 for inspection. Results logged to /home/runner/work/gemstash/gemstash/vendor/bundle/jruby/3.1.0/extensions/universal-java-11/3.1.0/bigdecimal-3.1.4/gem_make.out /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/ext/builder.rb:102:in `run' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/ext/ext_conf_builder.rb:28:in `build' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/ext/builder.rb:171:in `build_extension' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/ext/builder.rb:205:in `block in build_extensions' org/jruby/RubyArray.java:1989:in `each' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/ext/builder.rb:202:in `build_extensions' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/rubygems/installer.rb:843:in `build_extensions' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/rubygems_gem_installer.rb:72:in `build_extensions' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/rubygems_gem_installer.rb:28:in `install' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/source/rubygems.rb:207:in `install' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/installer/gem_installer.rb:54:in `install' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/installer/gem_installer.rb:16:in `install_from_spec' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/installer/parallel_installer.rb:186:in `do_install' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/worker.rb:62:in `apply_func' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/worker.rb:57:in `block in process_queue' org/jruby/RubyKernel.java:1601:in `loop' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/worker.rb:54:in `process_queue' /home/runner/.rubies/jruby-9.4.3.0/lib/ruby/stdlib/bundler/worker.rb:91:in `block in create_threads' An error occurred while installing bigdecimal (3.1.4), and Bundler cannot continue. In Gemfile: gemstash was resolved to 2.3.0, which depends on sequel was resolved to 5.72.0, which depends on bigdecimal Error: The process '/home/runner/.rubies/jruby-9.4.3.0/bin/bundle' failed with exit code 5 ```
headius commented 1 year ago

So it seems that sequel now depends on the bigdecimal gem, which has no JRuby version. Our best option going forward would be to help the bigdecimal maintainer create a stub -java version of the gem, which must be released with every bigdecimal version.

headius commented 1 year ago

I'm trying to get things moving again getting a bigdecimal-java gem released. See https://github.com/ruby/bigdecimal/issues/169

olleolleolle commented 1 year ago

I am rerunning an earlier-failing PR, and it can now install, so thank you @headius for all the upstream work. ❤️