-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix problem with missing gem specs #213
Conversation
59af73a
to
2ceecac
Compare
Also run `bundle lock --add-platform=ruby` before running tests so that we end up installing the native executable of Nokogiri when we do `bundle install` which would exhibit the difference in behaviour.
Some specs could be missing when trying to materialized the spec set, for example, a gem could depend on another gem for one platform but not depend on it for the current platform, which would make that dependency exist in the lockfile but result in a missing spec for the current platform. The fix is to pass an empty array to `materialize` which would collect the names of the gems that have missing specs.
Since the minimum supported Ruby version of Nokogiri is 2.5
68c7a34
to
5d6cd8f
Compare
Gemfile
Outdated
@@ -10,7 +10,7 @@ group(:deployment, :development) do | |||
gem("rake") | |||
end | |||
|
|||
gem("bundler", "~> 1.17") | |||
gem("bundler", ">= 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.
Should not bundler be in the gemspec since it is a runtime dependency? Can tapioca run without bundler being installed?
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.
Ooops, that's correct. Fixing it now.
c4caaf4
to
cefea35
Compare
cefea35
to
db305d5
Compare
Motivation
Fix #208.
Implementation
Bundler::SpecSet#materialize
has an optional extra parameter that can be supplied an array, which will be used to collect the names of the missing gem specs when materializing. This prevents missing gem specs from raising errors, so by passing an empty array for this parameter, we can prevent Tapioca from crashing when it runs into missing specs for dependencies that don't make sense for the current platform.Tests
Added a
nokogiri
dependency on the test repo and added a test to ensure that its optional dependency does not get processed.