ruby / setup-ruby

An action to download a prebuilt Ruby and add it to the PATH in 5 seconds

Home Page:https://github.com/marketplace/actions/setup-ruby-jruby-and-truffleruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Runner attempting to bundle and install incompatible version of sqlite3 on old(er) rubies

luke-hill opened this issue · comments

Ensure the following before filing this issue

  • I verified it reproduces with the latest version with - uses: ruby/setup-ruby@v1 (see Versioning policy)

  • I tried to reproduce the issue locally by following the workflow steps (including all commands done by ruby/setup-ruby, except for Downloading Ruby & Extracting Ruby),
    and it did not reproduce locally (if it does reproduce locally, it's not a ruby/setup-ruby issue)

Are you running on a GitHub-hosted runner or a self-hosted runner?

GitHub-hosted runner

Link to the failed workflow job (must be a public workflow job, so the necessary information is available)

https://github.com/cucumber/cucumber-rails/actions/runs/5104076118/job/13816426010

Any other notes?

It seems as though for some reason it's using some cached information about the bundled gems. But this cached information is trying to install an invalid gem.

The bundler restrictions are set to use any version from 1.4 onwards for sqlite3 ....

However it's trying to install the latest version, which is not compatible with ruby 2.6. Plenty of versions between 1.4 and the latest are compatible, so not sure why it's trying to install the latest?

@luke-hill

You're not the first, but people often think the issue is here, but it's really a Bundler/RubyGems issue, especially when using older Rubies, and RubyGems needing to backtrack to an earlier version. It may also be affected by the fact that there's a pre-compiled gem. Not.Sure.

I forked the repo, changed the Actions workflow with MSP-Greg/cucumber-rails@8a27f20, and the workflow passed at https://github.com/MSP-Greg/cucumber-rails/actions/runs/5811372249.

Aaaah oki. So it's a bug in the version of bundler. I'll be honest. In the checklist here - it did work locally, but I was using the latest bundler (Or almost latest).

Apologies, and thanks for the quick diagnosis.

@luke-hill

Sorry, yesterday was a bad day, trying to get something to work that can't (long story).

JFYI, I think this is a problem with older RubyGems.

With older RubyGems, if the 'selected' gem version of a dependency matched the gems' version constraint in the app's gemspec/Gemfile, and the 'selected' gem had an upper required_ruby_version constraint in its gemspec, the required_ruby_version constraint would be ignored, and it would try to install the gem, and fail.

Or, using your example (with older RubyGems), sqlite3-1.6.3-x86_64-linux matches the gem version constraint, but its required_ruby_version constaint should cause the gem to be an invalid selection (for Ruby 2.6). Instead, it trys to install it.