-
-
Notifications
You must be signed in to change notification settings - Fork 753
Restrict certain gems on certain versions of ruby #2750
Conversation
Simplecov has changed ruby version requirements for simplecov-html apparently. We could define the version of simplecov-html to install but there's no benefit to running coverage on every version so lets just install simplecov on newer versions like we do for rubocop
dd418f9
to
c35b6eb
Compare
Alright I think this probably needs to be a maintainer from here
|
@@ -16,6 +16,8 @@ if RUBY_VERSION < '1.9.3' | |||
gem 'rake', '< 11.0.0' # rake 11 requires Ruby 1.9.3 or later | |||
elsif RUBY_VERSION < '2.0.0' | |||
gem 'rake', '< 12.0.0' # rake 12 requires Ruby 2.0.0 or later | |||
elsif RUBY_VERSION < '2.2.0' | |||
gem 'rake', '< 13.0.0' # rake 13 requires Ruby 2.2.0 or later | |||
else | |||
gem 'rake', '> 12.3.2' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should change to > 13.0.0
in this sort of matrix
Its considered best practise to do so by the way, it ensures that builds don't go stale locked to some outdated dependency while your users get fresh ones, in fact we have cron builds that check |
Sorry, I'm a bit out of context. What problem exactly this change is addressing, @robotdana ? Were there build failures? |
yeah there were sometimes build failures depending on whether the bundler cache was there or not (if it was there, bundler happily used the working versions and had no issues. if it wasn't there, then bundler would fetch the newest versions, which did have ruby version incompatibilities) e.g. this build: https://travis-ci.org/github/rspec/rspec-core/jobs/717498044 I've just done a bit of reading on bundler and required_ruby_version, and i'm so much more confused than i was before. it seems like it should work. it demonstrably doesn't, at least, not consistently
if you mean the this build https://travis-ci.org/github/rspec/rspec-core/jobs/717567773 its doesn't necessarily consider the latest versions bundler would resolve instead whatever versions were cached, only updating things that it needs to to match the Gemfile. |
I've noticed an increase in flakey builds due to bundler issues of late, but they are typically resolved with a job restart as I've demonstrated, but if these changes increase the reliability of the build I guess I'm for them |
More those two changes actually rspec/rspec-rails#2366 rspec/rspec-rails#2360 I understand now, this is to protect from the same flakiness. But I still don't understand the need for the cache removal. |
the intent was to force bundler to not use whatever versions that it has cached that still satisfy the gemfile, and instead fetch the latest version of the gem that satisfies the gemfile |
though if bundler address this: rubygems/rubygems#3594 the problem goes away |
Thats a very interesting issue, that sounds plausible thats what we're hitting, as with Travis kicking off a large amounts of builds simultaneously the chances of that happening go up. |
I wouldn't rely on that
There's evidence that it's not as simple as that. rspec/rspec-rails#2366 (comment) |
We are relying on a more stable Bundler API right now. Also, RubyGems version support DB was retroactively updated. |
As rspec gitignores its Gemfile.lock it can mean new prs can fail with unrelated changes because bundler will get the most recent versions of gems which might have new and exciting incompatibilities. (as i found with #2749)
Also because the travis agents cache these bundles and don't force an update it can sometimes just work