Skip to content

Commit 35cb457

Browse files
authored
Merge pull request #25 from Shopify/v3.3.0-preview2-pshopify1
Add 3.3.0-preview2-pshopify1
2 parents 23d265b + d58057a commit 35cb457

File tree

3 files changed

+47
-5
lines changed

3 files changed

+47
-5
lines changed

lib/shopify_ruby_definitions/ruby_versions.rb

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,19 @@
22

33
module ShopifyRubyDefinitions
44
module RubyVersions
5+
class << self
6+
def build_version_overrides(all_versions)
7+
all_versions.sort_by do |version|
8+
version.scan(/\d+/).map(&:to_i)
9+
end.to_h do |version|
10+
[version.partition("-pshopify").first, version]
11+
end.freeze
12+
end
13+
end
14+
515
VERSIONS_DIRECTORY = File.expand_path("../../../rubies", __FILE__)
616
ALL_VERSIONS = Dir["#{VERSIONS_DIRECTORY}/*"].map { |f| File.basename(f) }
7-
VERSION_OVERRIDES = ALL_VERSIONS.sort_by do |version|
8-
version.scan(/\d+/).map(&:to_i)
9-
end.to_h do |version|
10-
[version.split("-").first, version]
11-
end.freeze
17+
VERSION_OVERRIDES = build_version_overrides(ALL_VERSIONS)
1218

1319
def version_overrides
1420
VERSION_OVERRIDES

rubies/3.3.0-preview2-pshopify1

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# https://github.com/ruby/ruby/compare/v3_3_0_preview2...Shopify:v3.3.0-preview2-pshopify1
2+
3+
# Based off `v3_3_0_preview2`, with backports of:
4+
# @nobu `.NOTPARALLEL` with prerequisites needs recent GNU Make https://github.com/ruby/ruby/pull/8489
5+
# @k0kubun YJIT: Initialize Assembler vectors with capacity https://github.com/ruby/ruby/pull/8437
6+
# @k0kubun YJIT: Initialize Vec with capacity for iterators https://github.com/ruby/ruby/pull/8439
7+
# @k0kubun YJIT: Skip Insn::Comment and format! if disasm is disabled https://github.com/ruby/ruby/pull/8441
8+
# @k0kubun YJIT: Avoid creating a vector in get_temp_regs() https://github.com/ruby/ruby/pull/8446
9+
# @nobu Write crash report in $RUBY_CRASH_REPORT https://github.com/ruby/ruby/pull/8506
10+
11+
install_package "openssl-3.1.2" "https://www.openssl.org/source/openssl-3.1.2.tar.gz#a0ce69b8b97ea6a35b96875235aa453b966ba3cba8af2de23657d8b6767d6539" openssl --if needs_openssl_102_300
12+
install_git "ruby-3.3.0-preview2-pshopify1" "https://github.com/Shopify/ruby.git" "v3.3.0-preview2-pshopify1" ldflags_dirs autoconf standard_build standard_install_with_bundled_gems verify_openssl

test/shopify_ruby_definitions/test_ruby_versions.rb

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,29 @@ def test_version_overrides
2020
def test_resolve_version
2121
assert_equal("3.0.2-pshopify3", ShopifyRubyDefinitions.resolve_version("3.0"))
2222
end
23+
24+
def test_resolve_preview_version
25+
with_versions(["3.3.0-preview2-pshopify1", "3.3.0-pshopify1"]) do
26+
assert_equal("3.3.0-preview2-pshopify1", ShopifyRubyDefinitions.resolve_version("3.3.0-preview2"))
27+
assert_equal("3.3.0-pshopify1", ShopifyRubyDefinitions.resolve_version("3.3"))
28+
end
29+
end
30+
31+
private
32+
33+
def with_versions(new_versions)
34+
old_versions = RubyVersions::ALL_VERSIONS
35+
old_version_overrides = RubyVersions::VERSION_OVERRIDES
36+
RubyVersions.send(:remove_const, :ALL_VERSIONS)
37+
RubyVersions.const_set(:ALL_VERSIONS, new_versions)
38+
RubyVersions.send(:remove_const, :VERSION_OVERRIDES)
39+
RubyVersions.const_set(:VERSION_OVERRIDES, RubyVersions.build_version_overrides(new_versions))
40+
yield
41+
ensure
42+
RubyVersions.send(:remove_const, :ALL_VERSIONS)
43+
RubyVersions.const_set(:ALL_VERSIONS, old_versions)
44+
RubyVersions.send(:remove_const, :VERSION_OVERRIDES)
45+
RubyVersions.const_set(:VERSION_OVERRIDES, old_version_overrides)
46+
end
2347
end
2448
end

0 commit comments

Comments
 (0)