1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

[rubygems/rubygems] Fix force_ruby_platform ignored when lockfile includes the current specific platform

https://github.com/rubygems/rubygems/commit/9ca371adf8
This commit is contained in:
David Rodríguez 2022-01-24 12:04:11 +01:00 committed by git
parent cc8064ba2e
commit c925d3b668
2 changed files with 15 additions and 0 deletions

View file

@ -496,6 +496,7 @@ module Bundler
def current_ruby_platform_locked?
return false unless generic_local_platform == Gem::Platform::RUBY
return false if Bundler.settings[:force_ruby_platform] && !@platforms.include?(Gem::Platform::RUBY)
current_platform_locked?
end

View file

@ -232,6 +232,20 @@ RSpec.describe "Bundler.setup with multi platform stuff" do
expect(the_bundle).to include_gems "nokogiri 1.4.2", "platform_specific 1.0 RUBY"
end
it "allows specifying only-ruby-platform even if the lockfile is locked to a specific compatible platform" do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"
gem "nokogiri"
gem "platform_specific"
G
bundle "config set force_ruby_platform true"
bundle "install"
expect(the_bundle).to include_gems "nokogiri 1.4.2", "platform_specific 1.0 RUBY"
end
it "doesn't pull platform specific gems on truffleruby", :truffleruby do
install_gemfile <<-G
source "#{file_uri_for(gem_repo1)}"