[rubygems/rubygems] Fix force_ruby_platform: when the lockfile only locks the ruby platform
https://github.com/rubygems/rubygems/commit/7c50064c3c
This commit is contained in:
parent
48c6cea330
commit
83f929316e
@ -202,6 +202,7 @@ module Bundler
|
|||||||
specs_for_name = lookup[dep.name]
|
specs_for_name = lookup[dep.name]
|
||||||
target_platform = dep.force_ruby_platform ? Gem::Platform::RUBY : (platform || Bundler.local_platform)
|
target_platform = dep.force_ruby_platform ? Gem::Platform::RUBY : (platform || Bundler.local_platform)
|
||||||
matching_specs = GemHelpers.select_best_platform_match(specs_for_name, target_platform)
|
matching_specs = GemHelpers.select_best_platform_match(specs_for_name, target_platform)
|
||||||
|
matching_specs.each {|s| s.force_ruby_platform = true } if dep.force_ruby_platform
|
||||||
matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
|
matching_specs.map!(&:materialize_for_installation).compact! if platform.nil?
|
||||||
matching_specs
|
matching_specs
|
||||||
end
|
end
|
||||||
|
@ -114,5 +114,48 @@ RSpec.describe "bundle install with force_ruby_platform DSL option", :jruby do
|
|||||||
expect(the_bundle).to include_gems "depends_on_platform_specific 1.0.0 RUBY"
|
expect(the_bundle).to include_gems "depends_on_platform_specific 1.0.0 RUBY"
|
||||||
expect(the_bundle).to include_gems "platform_specific 1.0.0 #{Bundler.local_platform}"
|
expect(the_bundle).to include_gems "platform_specific 1.0.0 #{Bundler.local_platform}"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it "uses ruby variants for the explicit transitive dependency with a lockile that has only ruby platform" do
|
||||||
|
lockfile <<-L
|
||||||
|
GEM
|
||||||
|
remote: #{file_uri_for(gem_repo4)}
|
||||||
|
specs:
|
||||||
|
dep_level_2 (1.0)
|
||||||
|
depends_on_platform_specific
|
||||||
|
depends_on_platform_specific (1.0)
|
||||||
|
platform_specific
|
||||||
|
platform_specific (1.0)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
dep_level_2
|
||||||
|
platform_specific
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
#{Bundler::VERSION}
|
||||||
|
L
|
||||||
|
|
||||||
|
install_gemfile <<-G, :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }, :artifice => "compact_index", :verbose => true
|
||||||
|
source "#{file_uri_for(gem_repo4)}"
|
||||||
|
|
||||||
|
gem "platform_specific"
|
||||||
|
gem "depends_on_platform_specific"
|
||||||
|
G
|
||||||
|
|
||||||
|
expect(the_bundle).to include_gems "depends_on_platform_specific 1.0.0 #{Bundler.local_platform}"
|
||||||
|
expect(the_bundle).to include_gems "platform_specific 1.0.0 #{Bundler.local_platform}"
|
||||||
|
|
||||||
|
install_gemfile <<-G, :env => { "BUNDLER_SPEC_GEM_REPO" => gem_repo4.to_s }, :artifice => "compact_index"
|
||||||
|
source "#{file_uri_for(gem_repo4)}"
|
||||||
|
|
||||||
|
gem "platform_specific", :force_ruby_platform => true
|
||||||
|
gem "depends_on_platform_specific"
|
||||||
|
G
|
||||||
|
|
||||||
|
expect(the_bundle).to include_gems "depends_on_platform_specific 1.0.0 #{Bundler.local_platform}"
|
||||||
|
expect(the_bundle).to include_gems "platform_specific 1.0.0 RUBY"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user