-
-
Notifications
You must be signed in to change notification settings - Fork 2k
platform can be of type string so it must be cast into a Gem::Platform #3565
Conversation
@@ -8,7 +8,7 @@ def match_platform(p) | |||
Gem::Platform::RUBY == platform or | |||
platform.nil? or p == platform or | |||
generic(Gem::Platform.new(platform)) == p or | |||
platform === p | |||
Gem::Platform.new(platform) === p |
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.
Since Gem::Platform.new(platform)
is done twice, maybe it should be wrapped in a variable?
@jdmundrawala maybe it would just be better to do this in the initializer for |
@segiddins I'm a little worried about changing |
Ah actually you’re right, I made that very mistake this weeked
|
So reading this again, maybe the |
@@ -5,10 +5,11 @@ module MatchPlatform | |||
include GemHelpers | |||
|
|||
def match_platform(p) | |||
generic_platform = generic(Gem::Platform.new(platform)) | |||
Gem::Platform::RUBY == platform or | |||
platform.nil? or p == platform or |
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.
The vast, vast majority of these comparisons are going to exit on the first three conditions, though, so I think it's a performance loss to create a Platform
before we do the compare... can we switch to just the one ===
and wait to create the Platform
until then?
Not really certain why the tests keep failing.... it "installs the latest version of gxapi_rails", :ruby => "1.9" do
install_gemfile <<-G
source "https://rubygems.org"
gem "sass-rails"
gem "rails", "~> 3"
gem "gxapi_rails"
G
expect(out).to include("gxapi_rails 0.0.6")
end seems to never return. Tried running locally(on a mac) with rubygems 2.2.3 and ruby 1.9.3 with the following Gemfile source "https://rubygems.org"
gem "sass-rails"
gem "rails", "~> 3"
gem "gxapi_rails" never returns. Tried with bundler 1.9.2 and bundler 1.9.3 never in this case means
|
@jdmundrawala that would imply that the resolver is either looping infinitely, or it's missing the match that it needs to terminate in a sane amount of time. |
bundle install 171.70s user 1.46s system 97% cpu 2:58.17 total |
@segiddins that seems like a pretty pathological resolver case, any ideas? |
(For the record, 1-8-stable takes 19 seconds to finish resolving that Gemfile, while 1-9-stable takes... much longer.) |
@jdmundrawala Thanks for the patch! |
#3553 didn't actually fix anything and made things worse (universal gems no longer work on 32 bit ruby on windows)
It seems that the platform can be of type string, so wrapping in in Gem::Platform is necessary.
sorry for the regression