Skip to content

Commit f1cf945

Browse files
authored
Merge pull request #9420 from Shopify/ec-memory-corruption
Workaround a memory corruption issue on Windows Ruby 3.3
2 parents 3e3ba2a + 532c973 commit f1cf945

2 files changed

Lines changed: 1 addition & 6 deletions

File tree

bundler/lib/bundler/injector.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,10 @@ def remove(gemfile_path, lockfile_path)
8080
def conservative_version(spec)
8181
version = spec.version
8282
return ">= 0" if version.nil?
83-
segments = version.segments
8483
seg_end_index = version >= Gem::Version.new("1.0") ? 1 : 2
8584

8685
prerelease_suffix = version.to_s.delete_prefix(version.release.to_s) if version.prerelease?
87-
"#{version_prefix}#{segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
86+
"#{version_prefix}#{version.segments[0..seg_end_index].join(".")}#{prerelease_suffix}"
8887
end
8988

9089
def version_prefix

spec/commands/add_spec.rb

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,12 @@
5151
end
5252

5353
it "version requirement becomes ~> major.minor.patch.pre when resolved version is < 1.0" do
54-
# Ruby 3.3 on Windows has a native crash (SEGV in rb_ary_cmp during Array#join) related to Object Shape optimization.
55-
skip "Ruby 3.3 on Windows crashes with SEGV in Array#join" if Gem.win_platform? && RUBY_VERSION.start_with?("3.3.")
5654
bundle "add 'cat'"
5755
expect(bundled_app_gemfile.read).to match(/gem "cat", "~> 0.12.3.pre"/)
5856
expect(the_bundle).to include_gems "cat 0.12.3.pre"
5957
end
6058

6159
it "version requirement becomes ~> major.minor.pre when resolved version is > 1.0.pre" do
62-
# Ruby 3.3 on Windows has a native crash (SEGV in rb_ary_cmp during Array#join) related to Object Shape optimization.
63-
skip "Ruby 3.3 on Windows crashes with SEGV in Array#join" if Gem.win_platform? && RUBY_VERSION.start_with?("3.3.")
6460
bundle "add 'dog'"
6561
expect(bundled_app_gemfile.read).to match(/gem "dog", "~> 1.1.pre"/)
6662
expect(the_bundle).to include_gems "dog 1.1.3.pre"

0 commit comments

Comments
 (0)