Skip to content

Commit ab11545

Browse files
Materialize platforms strictly on Windows too
1 parent 26c8bab commit ab11545

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

.github/workflows/install-rubygems.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,8 @@ jobs:
121121
- name: Check we can install a Gemfile with git sources
122122
run: bundle init && bundle add fileutils --git https://github.com/ruby/fileutils
123123
shell: bash
124+
- name: Generate a Rails application
125+
run: gem install rails && rails new foo
126+
shell: bash
124127

125128
timeout-minutes: 10

bundler/lib/bundler/lazy_specification.rb

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,15 +144,18 @@ def method_missing(method, *args, &blk)
144144

145145
#
146146
# For backwards compatibility with existing lockfiles, if the most specific
147-
# locked platform is RUBY, we keep the previous behaviour of resolving the
147+
# locked platform is not a specific platform like x86_64-linux or
148+
# universal-java-11, then we keep the previous behaviour of resolving the
148149
# best platform variant at materiliazation time. For previous bundler
149150
# versions (before 2.2.0) this was always the case (except when the lockfile
150151
# only included non-ruby platforms), but we're also keeping this behaviour
151152
# on newer bundlers unless users generate the lockfile from scratch or
152153
# explicitly add a more specific platform.
153154
#
154155
def ruby_platform_materializes_to_ruby_platform?
155-
!Bundler.most_specific_locked_platform?(generic_local_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
156+
generic_platform = generic_local_platform == Gem::Platform::JAVA ? Gem::Platform::JAVA : Gem::Platform::RUBY
157+
158+
!Bundler.most_specific_locked_platform?(generic_platform) || force_ruby_platform || Bundler.settings[:force_ruby_platform]
156159
end
157160
end
158161
end

0 commit comments

Comments
 (0)