Skip to content

Commit 4305bc5

Browse files
chenrui333cho-m
andcommitted
v8 13.5.212.10
Add livechecks for resources. These may not work for autobump as V8 uses git revisions which are not monotonically increasing. However, it should at least help provide all necessary revision updates in one command: `brew livecheck --resources v8` Co-authored-by: Michael Cho <[email protected]>
1 parent 1f72150 commit 4305bc5

File tree

1 file changed

+127
-40
lines changed

1 file changed

+127
-40
lines changed

Formula/v/v8.rb

Lines changed: 127 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@ class V8 < Formula
22
desc "Google's JavaScript engine"
33
homepage "https://v8.dev/docs"
44
# Track V8 version from Chrome stable: https://chromiumdash.appspot.com/releases?platform=Mac
5-
url "https://github.com/v8/v8/archive/refs/tags/13.4.114.19.tar.gz"
6-
sha256 "6ed878b3bb97b38431ec427d8b3a837c579dc5bafb8e8b706de85f160037197c"
5+
# Check `brew livecheck --resources v8` for any resource updates
6+
url "https://github.com/v8/v8/archive/refs/tags/13.5.212.10.tar.gz"
7+
sha256 "2c47b3de22591f4384f75aa462301eb9fdb9d661ee07f73cab95a89d0a75d5ae"
78
license "BSD-3-Clause"
89

910
livecheck do
@@ -31,17 +32,18 @@ class V8 < Formula
3132
sha256 cellar: :any_skip_relocation, x86_64_linux: "4424792b53407e75eaa8c774874f0f0ef5bed25efcf5473fca62c2dce2828461"
3233
end
3334

35+
depends_on "llvm" => :build
3436
depends_on "ninja" => :build
3537
depends_on xcode: ["10.0", :build] # for xcodebuild, min version required by v8
3638

3739
uses_from_macos "python" => :build
3840

3941
on_macos do
40-
depends_on "llvm" => :build
4142
depends_on "llvm" if DevelopmentTools.clang_build_version <= 1400
4243
end
4344

4445
on_linux do
46+
depends_on "lld" => :build
4547
depends_on "pkgconf" => :build
4648
depends_on "glib"
4749
end
@@ -50,79 +52,162 @@ class V8 < Formula
5052
# e.g. for CIPD dependency gn: https://chromium.googlesource.com/v8/v8.git/+/refs/tags/<version>/DEPS#74
5153
resource "gn" do
5254
url "https://gn.googlesource.com/gn.git",
53-
revision: "ed1abc107815210dc66ec439542bee2f6cbabc00"
55+
revision: "4a8016dc391553fa1644c0740cc04eaac844121e"
56+
version "4a8016dc391553fa1644c0740cc04eaac844121e"
57+
58+
livecheck do
59+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
60+
regex(/["']gn_version["']:\s*["']git_revision:([0-9a-f]+)["']/i)
61+
end
5462
end
5563

56-
resource "v8/build" do
64+
resource "build" do
5765
url "https://chromium.googlesource.com/chromium/src/build.git",
58-
revision: "a9640b2af4c541cbe6b716f447315d487351ae46"
66+
revision: "efb3303345a5501074564393470197a904b4afb7"
67+
version "efb3303345a5501074564393470197a904b4afb7"
68+
69+
livecheck do
70+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
71+
regex(%r{["']/chromium/src/build\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
72+
end
73+
end
74+
75+
resource "buildtools" do
76+
url "https://chromium.googlesource.com/chromium/src/buildtools.git",
77+
revision: "b248db940ef3dd7e5f4694ebf4d8a3f67aa0086d"
78+
version "b248db940ef3dd7e5f4694ebf4d8a3f67aa0086d"
79+
80+
livecheck do
81+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
82+
regex(%r{["']/chromium/src/buildtools\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
83+
end
84+
end
85+
86+
resource "third_party/abseil-cpp" do
87+
url "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
88+
revision: "2705c6655c0008cc3fb152dae27890d44bc335f1"
89+
version "2705c6655c0008cc3fb152dae27890d44bc335f1"
90+
91+
livecheck do
92+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
93+
regex(%r{["']/chromium/src/third_party/abseil-cpp\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
94+
end
5995
end
6096

61-
resource "v8/third_party/fast_float/src" do
97+
resource "third_party/fast_float/src" do
6298
url "https://chromium.googlesource.com/external/github.com/fastfloat/fast_float.git",
6399
revision: "cb1d42aaa1e14b09e1452cfdef373d051b8c02a4"
100+
version "cb1d42aaa1e14b09e1452cfdef373d051b8c02a4"
101+
102+
livecheck do
103+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
104+
regex(%r{["']/external/github.com/fastfloat/fast_float\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
105+
end
64106
end
65107

66-
resource "v8/third_party/fp16/src" do
108+
resource "third_party/fp16/src" do
67109
url "https://chromium.googlesource.com/external/github.com/Maratyszcza/FP16.git",
68110
revision: "0a92994d729ff76a58f692d3028ca1b64b145d91"
111+
version "0a92994d729ff76a58f692d3028ca1b64b145d91"
112+
113+
livecheck do
114+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
115+
regex(%r{["']/external/github.com/Maratyszcza/FP16\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
116+
end
69117
end
70118

71-
resource "v8/third_party/googletest/src" do
119+
resource "third_party/googletest/src" do
72120
url "https://chromium.googlesource.com/external/github.com/google/googletest.git",
73-
revision: "e235eb34c6c4fed790ccdad4b16394301360dcd4"
121+
revision: "24a9e940d481f992ba852599c78bb2217362847b"
122+
version "24a9e940d481f992ba852599c78bb2217362847b"
123+
124+
livecheck do
125+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
126+
regex(%r{["']/external/github.com/google/googletest\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
127+
end
74128
end
75129

76130
resource "third_party/highway/src" do
77131
url "https://chromium.googlesource.com/external/github.com/google/highway.git",
78132
revision: "00fe003dac355b979f36157f9407c7c46448958e"
133+
version "00fe003dac355b979f36157f9407c7c46448958e"
134+
135+
livecheck do
136+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
137+
regex(%r{["']/external/github.com/google/highway\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
138+
end
79139
end
80140

81-
resource "v8/third_party/icu" do
141+
resource "third_party/icu" do
82142
url "https://chromium.googlesource.com/chromium/deps/icu.git",
83-
revision: "bbccc2f6efc1b825de5f2c903c48be685cd0cf22"
143+
revision: "d30b7b0bb3829f2e220df403ed461a1ede78b774"
144+
version "d30b7b0bb3829f2e220df403ed461a1ede78b774"
145+
146+
livecheck do
147+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
148+
regex(%r{["']/chromium/deps/icu\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
149+
end
84150
end
85151

86-
resource "v8/third_party/jinja2" do
152+
resource "third_party/jinja2" do
87153
url "https://chromium.googlesource.com/chromium/src/third_party/jinja2.git",
88154
revision: "5e1ee241ab04b38889f8d517f2da8b3df7cfbd9a"
155+
version "5e1ee241ab04b38889f8d517f2da8b3df7cfbd9a"
156+
157+
livecheck do
158+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
159+
regex(%r{["']/chromium/src/third_party/jinja2\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
160+
end
89161
end
90162

91-
resource "v8/third_party/markupsafe" do
163+
resource "third_party/markupsafe" do
92164
url "https://chromium.googlesource.com/chromium/src/third_party/markupsafe.git",
93165
revision: "9f8efc8637f847ab1ba984212598e6fb9cf1b3d4"
94-
end
166+
version "9f8efc8637f847ab1ba984212598e6fb9cf1b3d4"
95167

96-
resource "v8/third_party/zlib" do
97-
url "https://chromium.googlesource.com/chromium/src/third_party/zlib.git",
98-
revision: "5634698162b2182c350e4cb360a0f4dd7706afec"
168+
livecheck do
169+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
170+
regex(%r{["']/chromium/src/third_party/markupsafe\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
171+
end
99172
end
100173

101-
resource "v8/third_party/abseil-cpp" do
102-
url "https://chromium.googlesource.com/chromium/src/third_party/abseil-cpp.git",
103-
revision: "aaed376e01b9f98ff29f70fd47468b7e806e1639"
174+
resource "third_party/partition_alloc" do
175+
url "https://chromium.googlesource.com/chromium/src/base/allocator/partition_allocator.git",
176+
revision: "46d880ff62f340854a5a70142b0abf604c7af221"
177+
version "46d880ff62f340854a5a70142b0abf604c7af221"
178+
179+
livecheck do
180+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
181+
regex(/["']partition_alloc_version["']:\s*["']([0-9a-f]+)["']/i)
182+
end
104183
end
105184

106-
resource "v8/third_party/simdutf" do
185+
resource "third_party/simdutf" do
107186
url "https://chromium.googlesource.com/chromium/src/third_party/simdutf.git",
108187
revision: "5a9a2134b280c1b956ad68a0643797fe26dd1c94"
188+
version "5a9a2134b280c1b956ad68a0643797fe26dd1c94"
189+
190+
livecheck do
191+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
192+
regex(%r{["']/chromium/src/third_party/simdutf["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
193+
end
194+
end
195+
196+
resource "third_party/zlib" do
197+
url "https://chromium.googlesource.com/chromium/src/third_party/zlib.git",
198+
revision: "788cb3c270e8700b425c7bdca1f9ce6b0c1400a9"
199+
version "788cb3c270e8700b425c7bdca1f9ce6b0c1400a9"
200+
201+
livecheck do
202+
url "https://raw.githubusercontent.com/v8/v8/refs/tags/#{LATEST_VERSION}/DEPS"
203+
regex(%r{["']/chromium/src/third_party/zlib\.git["']\s*\+\s*["']@["']\s*\+\s*["']([0-9a-f]+)["']}i)
204+
end
109205
end
110206

111207
def install
112-
(buildpath/"build").install resource("v8/build")
113-
(buildpath/"third_party/jinja2").install resource("v8/third_party/jinja2")
114-
(buildpath/"third_party/markupsafe").install resource("v8/third_party/markupsafe")
115-
(buildpath/"third_party/fast_float/src").install resource("v8/third_party/fast_float/src")
116-
(buildpath/"third_party/fp16/src").install resource("v8/third_party/fp16/src")
117-
(buildpath/"third_party/googletest/src").install resource("v8/third_party/googletest/src")
118-
(buildpath/"third_party/highway/src").install resource("third_party/highway/src")
119-
(buildpath/"third_party/icu").install resource("v8/third_party/icu")
120-
(buildpath/"third_party/zlib").install resource("v8/third_party/zlib")
121-
(buildpath/"third_party/abseil-cpp").install resource("v8/third_party/abseil-cpp")
122-
(buildpath/"third_party/simdutf").install resource("v8/third_party/simdutf")
208+
resources.each { |r| r.stage(buildpath/r.name) }
123209

124210
# Build gn from source and add it to the PATH
125-
(buildpath/"gn").install resource("gn")
126211
cd "gn" do
127212
system "python3", "build/gen.py"
128213
system "ninja", "-C", "out/", "gn"
@@ -146,21 +231,23 @@ def install
146231
clang_use_chrome_plugins: false, # disable the usage of Google's custom clang plugins
147232
use_custom_libcxx: false, # uses system libc++ instead of Google's custom one
148233
treat_warnings_as_errors: false, # ignore not yet supported clang argument warnings
149-
use_lld: false, # upstream use LLD but this leads to build failure on ARM
150234
}
151235

236+
# uses Homebrew clang instead of Google clang
237+
gn_args[:clang_base_path] = "\"#{Formula["llvm"].opt_prefix}\""
238+
gn_args[:clang_version] = "\"#{Formula["llvm"].version.major}\""
239+
152240
if OS.linux?
153-
gn_args[:is_clang] = false # use GCC on Linux
241+
ENV.llvm_clang
242+
ENV["AR"] = DevelopmentTools.locate("ar")
243+
ENV["NM"] = DevelopmentTools.locate("nm")
154244
gn_args[:use_sysroot] = false # don't use sysroot
155245
gn_args[:custom_toolchain] = "\"//build/toolchain/linux/unbundle:default\"" # uses system toolchain
156246
gn_args[:host_toolchain] = "\"//build/toolchain/linux/unbundle:default\"" # to respect passed LDFLAGS
157-
ENV["AR"] = DevelopmentTools.locate("ar")
158-
ENV["NM"] = DevelopmentTools.locate("nm")
159247
gn_args[:use_rbe] = false
160248
else
161249
ENV["DEVELOPER_DIR"] = ENV["HOMEBREW_DEVELOPER_DIR"] # help run xcodebuild when xcode-select is set to CLT
162-
gn_args[:clang_base_path] = "\"#{Formula["llvm"].opt_prefix}\"" # uses Homebrew clang instead of Google clang
163-
gn_args[:clang_version] = "\"#{Formula["llvm"].version.major}\""
250+
gn_args[:use_lld] = false # upstream use LLD but this leads to build failure on ARM
164251
# Work around failure mixing newer `llvm` headers with older Xcode's libc++:
165252
# Undefined symbols for architecture x86_64:
166253
# "std::__1::__libcpp_verbose_abort(char const*, ...)", referenced from:

0 commit comments

Comments
 (0)