3
3
class PortableRuby < PortableFormula
4
4
desc "Powerful, clean, object-oriented scripting language"
5
5
homepage "https://www.ruby-lang.org/"
6
- url "https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.4 .tar.gz"
7
- sha256 "fe6a30f97d54e029768f2ddf4923699c416cdbc3a6e96db3e2d5716c7db96a34 "
6
+ url "https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.5 .tar.gz"
7
+ sha256 "3781a3504222c2f26cb4b9eb9c1a12dbf4944d366ce24a9ff8cf99ecbce75196 "
8
8
license "Ruby"
9
- revision 1
10
9
11
10
# This regex restricts matching to versions other than X.Y.0.
12
11
livecheck do
@@ -37,8 +36,8 @@ class PortableRuby < PortableFormula
37
36
end
38
37
39
38
resource "bootsnap" do
40
- url "https://rubygems.org/downloads/bootsnap-1.18.3 .gem"
41
- sha256 "d7b70de761e2fb1d63d21dd941b393c881c5cab5575211369cede788dfc034eb "
39
+ url "https://rubygems.org/downloads/bootsnap-1.18.4 .gem"
40
+ sha256 "ac4c42af397f7ee15521820198daeff545e4c360d2772c601fbdc2c07d92af55 "
42
41
43
42
livecheck do
44
43
url "https://rubygems.org/api/v1/versions/bootsnap.json"
@@ -48,12 +47,33 @@ class PortableRuby < PortableFormula
48
47
end
49
48
end
50
49
51
- # Fix rare hang on forking. Affected Homebrew/core CI, especially on macOS 14 x86_64.
52
- # Patch in production use at Stripe.
53
- # https://github.com/sorbet/sorbet/pull/7928
50
+ # Fix gem warning breaking change introduced in Ruby 3.3.5 (reverted in 3.3.6).
51
+ # https://bugs.ruby-lang.org/issues/20713
54
52
patch do
55
- url "https://raw.githubusercontent.com/sorbet/sorbet/2d91ebab7b642b900e02233bd49f593ad355469d/third_party/ruby/reinit_native_sched_lock.patch"
56
- sha256 "ded85ab6979b897d5b39af14ba46434e8d235200ac8cc82af2345f2166b5d185"
53
+ url "https://github.com/ruby/ruby/commit/4e59e7d35fbd6ff87f63cd0aa5d6a2f923323fee.patch?full_index=1"
54
+ sha256 "b031c4f838ee78866e3f4b0de7ea60fbd4b4a4ae57eb3f9de620f1c8e26e4ab2"
55
+ end
56
+
57
+ # Fix .lock files being created in the `bin` directory.
58
+ # https://bugs.ruby-lang.org/issues/20721
59
+ # Instead of cherry-picking the relevant fixes (which themselves had since-fixed regressions),
60
+ # do what upstream do and simply update Rubygems to 3.5.20.
61
+ # Remove with Ruby 3.3.6.
62
+ patch do
63
+ url "https://github.com/ruby/ruby/commit/95f72a4a32396cae7475b39d7739fb534242b625.patch?full_index=1"
64
+ sha256 "24764ed8fc29dfd88235db7c5050f4fba40aa9dac0e2e41aff47fc016b633e76"
65
+ end
66
+ patch do
67
+ url "https://github.com/ruby/ruby/commit/ef3c4a7aa7c0a79a00f4daa50e0be1184d9fe536.patch?full_index=1"
68
+ sha256 "e893cd4b6a61f91b2095192bc905825c2b54bf849c1f5714256c7923f8b1dae4"
69
+ end
70
+ patch do
71
+ url "https://github.com/ruby/ruby/commit/3894841182c32de231b3998502bf1a9dba7cdb4f.patch?full_index=1"
72
+ sha256 "cf1b9aaa805426b3911bbcd29957dd5beb3fdfacea910a01b4a5c374f2afb9c2"
73
+ end
74
+ patch do
75
+ url "https://github.com/ruby/ruby/commit/77fb1bf434d7be9cf5d892404b04b20c18fa6f06.patch?full_index=1"
76
+ sha256 "744deac64ba9f52b1b03e7169333a8a6df42d77eb351130c16837ab69647ae5a"
57
77
end
58
78
59
79
def install
@@ -179,7 +199,13 @@ def install
179
199
shell_output ( "#{ ruby } -ropenssl -e 'puts OpenSSL::Digest::SHA256.hexdigest(\" \" )'" ) . chomp
180
200
assert_match "200" ,
181
201
shell_output ( "#{ ruby } -ropen-uri -e 'URI.open(\" https://google.com\" ) { |f| puts f.status.first }'" ) . chomp
182
- system ruby , "--disable-gems" , "-rrbconfig" , "-rportable_ruby_gems" , "-rdebug" , "-rfiddle" , "-rbootsnap" , "-e" , ""
202
+ system ruby , "-rrbconfig" , "-e" , <<~EOS
203
+ Gem.discover_gems_on_require = false
204
+ require "portable_ruby_gems"
205
+ require "debug"
206
+ require "fiddle"
207
+ require "bootsnap"
208
+ EOS
183
209
system testpath /"bin/gem" , "environment"
184
210
system testpath /"bin/bundle" , "init"
185
211
# install gem with native components
0 commit comments