@@ -139,7 +139,7 @@ alias(
139
139
)
140
140
"""
141
141
142
- def _local_firefox_repository_impl (repository_ctx ):
142
+ def _firefox_local_repository_impl (repository_ctx ):
143
143
repository_ctx .file ("WORKSPACE.bazel" , """workspace(name = "{}")""" .format (
144
144
repository_ctx .name ,
145
145
))
@@ -168,7 +168,7 @@ def _local_firefox_repository_impl(repository_ctx):
168
168
169
169
repository_ctx .file ("BUILD.bazel" , _FIREFOX_BUILD_CONTENT_WINDOWS if is_windows else _FIREFOX_BUILD_CONTENT_UNIX )
170
170
171
- local_firefox_repository = repository_rule (
171
+ firefox_local_repository = repository_rule (
172
172
doc = """\
173
173
A repository rule for wrapping the path to a host installed firefox binary
174
174
@@ -177,7 +177,7 @@ Note that firefox binaries can be found here: https://ftp.mozilla.org/pub/firefo
177
177
However, for platforms like MacOS and Windows, the storage formats are not something that can be extracted
178
178
in a repository rule.
179
179
""" ,
180
- implementation = _local_firefox_repository_impl ,
180
+ implementation = _firefox_local_repository_impl ,
181
181
environ = ["FIREFOX_BINARY" ],
182
182
)
183
183
@@ -226,10 +226,41 @@ def firefox_deps():
226
226
build_file = Label ("//private/webdrivers:BUILD.geckodriver.bazel" ),
227
227
)
228
228
229
+ firefox_version = "136.0"
230
+
231
+ for platform , integrity in {
232
+ "linux-aarch64" : "sha256-vveh8MLGr9pl8cHtvj4T/dk1wzaxYkMMfTUTkidAgAo=" ,
233
+ "linux-x86_64" : "sha256-UiL1HKrPzK8PDPeVEX8K03Qi/p1BPvGPLBceFiK5RVo=" ,
234
+ }.items ():
235
+ archive = "tar.xz"
236
+ tool = "firefox"
237
+ name = "firefox_{}" .format (platform .replace ("-" , "_" ))
238
+ direct_deps .append (struct (repo = name ))
239
+ maybe (
240
+ webdriver_repository ,
241
+ name = name ,
242
+ original_name = name ,
243
+ urls = ["https://ftp.mozilla.org/pub/firefox/releases/{version}/{platform}/en-US/firefox-{version}.{archive}" .format (
244
+ version = firefox_version ,
245
+ platform = platform ,
246
+ archive = archive ,
247
+ )],
248
+ strip_prefix = "firefox" ,
249
+ integrity = integrity ,
250
+ tool = tool ,
251
+ )
252
+
253
+ direct_deps .append (struct (repo = "firefox_local" ))
254
+ maybe (
255
+ firefox_local_repository ,
256
+ name = "firefox_local" ,
257
+ )
258
+
229
259
direct_deps .append (struct (repo = "firefox" ))
230
260
maybe (
231
- local_firefox_repository ,
261
+ build_file_repository ,
232
262
name = "firefox" ,
263
+ build_file = Label ("//private/webdrivers:BUILD.firefox.bazel" ),
233
264
)
234
265
235
266
return direct_deps
0 commit comments