|
142 | 142 | describe "with default gems and a lockfile", :ruby_repo do
|
143 | 143 | before do
|
144 | 144 | necessary_system_gems = ["tsort --version 0.1.0"]
|
145 |
| - necessary_system_gems += ["etc --version 1.4.3"] |
146 | 145 | realworld_system_gems(*necessary_system_gems)
|
147 | 146 | end
|
148 | 147 |
|
|
173 | 172 | bundle "lock", dir: cwd
|
174 | 173 |
|
175 | 174 | bundle "config set --local path #{bundled_app("bundle")}"
|
176 |
| - bundle :install, standalone: true, dir: cwd, env: { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s } |
| 175 | + |
| 176 | + # Make sure rubyinstaller2 does not activate the etc gem in its |
| 177 | + # `operating_system.rb` file, but completely disable that since it's not |
| 178 | + # really needed here |
| 179 | + if Gem.win_platform? |
| 180 | + FileUtils.mkdir_p bundled_app("rubygems/defaults") |
| 181 | + FileUtils.touch bundled_app("rubygems/defaults/operating_system.rb") |
| 182 | + end |
| 183 | + |
| 184 | + bundle :install, standalone: true, dir: cwd, env: { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s }, load_path: bundled_app |
177 | 185 |
|
178 | 186 | load_path_lines = bundled_app("bundle/bundler/setup.rb").read.split("\n").select {|line| line.start_with?("$:.unshift") }
|
179 | 187 |
|
|
184 | 192 | end
|
185 | 193 |
|
186 | 194 | it "works for gems with extensions and points to the vendored copies, not to the default copies" do
|
187 |
| - necessary_gems_in_bundle_path = ["optparse --version 0.1.1", "psych --version 3.3.2", "logger --version 1.4.3", "etc --version 1.4.3", "stringio --version 3.1.0", "shellwords --version 0.2.0", "open3 --version 0.2.1"] |
188 |
| - necessary_gems_in_bundle_path += ["yaml --version 0.1.1"] if Gem.rubygems_version < Gem::Version.new("3.4.a") |
189 |
| - realworld_system_gems(*necessary_gems_in_bundle_path, path: scoped_gem_path(bundled_app("bundle"))) |
| 195 | + simulate_platform "arm64-darwin-23" do |
| 196 | + necessary_gems_in_bundle_path = ["optparse --version 0.1.1", "psych --version 3.3.2", "logger --version 1.4.3", "etc --version 1.4.3", "stringio --version 3.1.0", "shellwords --version 0.2.0", "open3 --version 0.2.1"] |
| 197 | + necessary_gems_in_bundle_path += ["yaml --version 0.1.1"] if Gem.rubygems_version < Gem::Version.new("3.4.a") |
| 198 | + realworld_system_gems(*necessary_gems_in_bundle_path, path: scoped_gem_path(bundled_app("bundle"))) |
190 | 199 |
|
191 |
| - build_gem "baz", "1.0.0", to_system: true, default: true, &:add_c_extension |
| 200 | + build_gem "baz", "1.0.0", to_system: true, default: true, &:add_c_extension |
192 | 201 |
|
193 |
| - build_repo4 do |
194 |
| - build_gem "baz", "1.0.0", &:add_c_extension |
195 |
| - end |
| 202 | + build_repo4 do |
| 203 | + build_gem "baz", "1.0.0", &:add_c_extension |
| 204 | + end |
196 | 205 |
|
197 |
| - gemfile <<-G |
198 |
| - source "https://gem.repo4" |
199 |
| - gem "baz" |
200 |
| - G |
| 206 | + gemfile <<-G |
| 207 | + source "https://gem.repo4" |
| 208 | + gem "baz" |
| 209 | + G |
201 | 210 |
|
202 |
| - bundle "config set --local path #{bundled_app("bundle")}" |
| 211 | + bundle "config set --local path #{bundled_app("bundle")}" |
203 | 212 |
|
204 |
| - simulate_platform "arm64-darwin-23" do |
205 | 213 | bundle "lock", dir: cwd
|
206 | 214 |
|
207 |
| - bundle :install, standalone: true, dir: cwd, env: { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s } |
| 215 | + # Make sure rubyinstaller2 does not activate the etc gem in its |
| 216 | + # `operating_system.rb` file, but completely disable that since it's not |
| 217 | + # really needed here |
| 218 | + if Gem.win_platform? |
| 219 | + FileUtils.mkdir_p bundled_app("rubygems/defaults") |
| 220 | + FileUtils.touch bundled_app("rubygems/defaults/operating_system.rb") |
| 221 | + end |
| 222 | + |
| 223 | + bundle :install, standalone: true, dir: cwd, env: { "BUNDLER_GEM_DEFAULT_DIR" => system_gem_path.to_s }, load_path: bundled_app |
208 | 224 | end
|
209 | 225 |
|
210 | 226 | load_path_lines = bundled_app("bundle/bundler/setup.rb").read.split("\n").select {|line| line.start_with?("$:.unshift") }
|
|
0 commit comments