mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[rubygems/rubygems] Fix truffleruby failing to install sorbet-static when there's no lockfile
The generic Ruby platform was getting unconditionally added in
truffleruby, preventing resolution in situations where there's no
generic ruby version (sorbet-static). Instead, the generic platform
should be considered per dependency, not globally.
a96afc5351
This commit is contained in:
parent
15e9dc19fb
commit
e42f1aaa5a
4 changed files with 18 additions and 3 deletions
|
@ -740,7 +740,6 @@ module Bundler
|
|||
def start_resolution
|
||||
local_platform_needed_for_resolvability = @most_specific_non_local_locked_platform && !@platforms.include?(Bundler.local_platform)
|
||||
@platforms << Bundler.local_platform if local_platform_needed_for_resolvability
|
||||
add_platform(Gem::Platform::RUBY) if RUBY_ENGINE == "truffleruby"
|
||||
|
||||
result = SpecSet.new(resolver.start)
|
||||
|
||||
|
|
|
@ -21,6 +21,7 @@ module Bundler
|
|||
@locked_version = locked_specs.version_for(name)
|
||||
@unlock = unlock
|
||||
@dependency = dependency || Dependency.new(name, @locked_version)
|
||||
@platforms |= [Gem::Platform::RUBY] if @dependency.default_force_ruby_platform
|
||||
@top_level = !dependency.nil?
|
||||
@prerelease = @dependency.prerelease? || @locked_version&.prerelease? || prerelease ? :consider_first : :ignore
|
||||
@prefer_local = prefer_local
|
||||
|
|
|
@ -2237,7 +2237,6 @@ RSpec.describe "bundle lock" do
|
|||
nokogiri (1.14.2-x86_64-linux)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
x86_64-linux
|
||||
|
||||
DEPENDENCIES
|
||||
|
|
|
@ -392,7 +392,23 @@ RSpec.describe "bundle install with specific platforms" do
|
|||
end
|
||||
end
|
||||
|
||||
it "installs sorbet-static, which does not provide a pure ruby variant, just fine", :truffleruby do
|
||||
it "installs sorbet-static, which does not provide a pure ruby variant, in absence of a lockfile, just fine", :truffleruby do
|
||||
skip "does not apply to Windows" if Gem.win_platform?
|
||||
|
||||
build_repo2 do
|
||||
build_gem("sorbet-static", "0.5.6403") {|s| s.platform = Bundler.local_platform }
|
||||
end
|
||||
|
||||
gemfile <<~G
|
||||
source "https://gem.repo2"
|
||||
|
||||
gem "sorbet-static", "0.5.6403"
|
||||
G
|
||||
|
||||
bundle "install --verbose"
|
||||
end
|
||||
|
||||
it "installs sorbet-static, which does not provide a pure ruby variant, in presence of a lockfile, just fine", :truffleruby do
|
||||
skip "does not apply to Windows" if Gem.win_platform?
|
||||
|
||||
build_repo2 do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue