Skip to content

Commit

Permalink
[bazel] Move pinned browsers to MODULE
Browse files Browse the repository at this point in the history
  • Loading branch information
p0deje committed Mar 23, 2024
1 parent f1041d9 commit 76956e3
Show file tree
Hide file tree
Showing 6 changed files with 575 additions and 95 deletions.
30 changes: 29 additions & 1 deletion MODULE.bazel
Expand Up @@ -5,6 +5,7 @@ bazel_dep(name = "aspect_rules_esbuild", version = "0.18.0")
bazel_dep(name = "aspect_rules_js", version = "1.35.0")
bazel_dep(name = "aspect_rules_ts", version = "2.1.0")
bazel_dep(name = "bazel_features", version = "1.9.0")
bazel_dep(name = "bazel_skylib", version = "1.5.0")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
bazel_dep(name = "contrib_rules_jvm", version = "0.24.0")
bazel_dep(name = "platforms", version = "0.0.8")
Expand Down Expand Up @@ -328,4 +329,31 @@ crate.from_cargo(
use_repo(crate, "crates")

selenium_manager_artifacts = use_extension("//common:selenium_manager.bzl", "selenium_manager_artifacts")
use_repo(selenium_manager_artifacts, "download_sm_linux", "download_sm_macos", "download_sm_windows")
use_repo(
selenium_manager_artifacts,
"download_sm_linux",
"download_sm_macos",
"download_sm_windows",
)

pin_browsers_extension = use_extension("//common:repositories.bzl", "pin_browsers_extension")
use_repo(
pin_browsers_extension,
"linux_firefox",
"mac_firefox",
"linux_beta_firefox",
"mac_beta_firefox",
"linux_geckodriver",
"mac_geckodriver",
"linux_edge",
"mac_edge",
"linux_edgedriver",
"mac_edgedriver",
"linux_chrome",
"mac_chrome",
"linux_chromedriver",
"mac_chromedriver",
)

local_drivers = use_repo_rule("//common/private:drivers.bzl", "local_drivers")
local_drivers(name = "local_drivers")
281 changes: 250 additions & 31 deletions MODULE.bazel.lock
@@ -1,6 +1,6 @@
{
"lockFileVersion": 6,
"moduleFileHash": "5033931fac34032b67be998a839cabd443081a8434d3d754633f12717453ad77",
"moduleFileHash": "2c27cdea1dfa8abf9ac2025db3c201b35029e652b5f70761ff54c4ba9a6e9622",
"flags": {
"cmdRegistries": [
"https://bcr.bazel.build/"
Expand Down Expand Up @@ -806,6 +806,66 @@
"tags": [],
"hasDevUseExtension": false,
"hasNonDevUseExtension": true
},
{
"extensionBzlFile": "@selenium//common:repositories.bzl",
"extensionName": "pin_browsers_extension",
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 339,
"column": 39
},
"imports": {
"linux_firefox": "linux_firefox",
"mac_firefox": "mac_firefox",
"linux_beta_firefox": "linux_beta_firefox",
"mac_beta_firefox": "mac_beta_firefox",
"linux_geckodriver": "linux_geckodriver",
"mac_geckodriver": "mac_geckodriver",
"linux_edge": "linux_edge",
"mac_edge": "mac_edge",
"linux_edgedriver": "linux_edgedriver",
"mac_edgedriver": "mac_edgedriver",
"linux_chrome": "linux_chrome",
"mac_chrome": "mac_chrome",
"linux_chromedriver": "linux_chromedriver",
"mac_chromedriver": "mac_chromedriver"
},
"devImports": [],
"tags": [],
"hasDevUseExtension": false,
"hasNonDevUseExtension": true
},
{
"extensionBzlFile": "//:MODULE.bazel",
"extensionName": "_repo_rules",
"usingModule": "<root>",
"location": {
"file": "@@//:MODULE.bazel",
"line": 0,
"column": 0
},
"imports": {
"local_drivers": "local_drivers"
},
"devImports": [],
"tags": [
{
"tagName": "//common/private:drivers.bzl%local_drivers",
"attributeValues": {
"name": "local_drivers"
},
"devDependency": false,
"location": {
"file": "@@//:MODULE.bazel",
"line": 359,
"column": 14
}
}
],
"hasDevUseExtension": false,
"hasNonDevUseExtension": true
}
],
"deps": {
Expand All @@ -814,6 +874,7 @@
"aspect_rules_js": "aspect_rules_js@1.35.0",
"aspect_rules_ts": "aspect_rules_ts@2.1.0",
"bazel_features": "bazel_features@1.9.0",
"bazel_skylib": "bazel_skylib@1.5.0",
"buildifier_prebuilt": "buildifier_prebuilt@6.4.0",
"contrib_rules_jvm": "contrib_rules_jvm@0.24.0",
"platforms": "platforms@0.0.8",
Expand Down Expand Up @@ -1133,6 +1194,36 @@
}
}
},
"bazel_skylib@1.5.0": {
"name": "bazel_skylib",
"version": "1.5.0",
"key": "bazel_skylib@1.5.0",
"repoName": "bazel_skylib",
"executionPlatformsToRegister": [],
"toolchainsToRegister": [
"//toolchains/unittest:cmd_toolchain",
"//toolchains/unittest:bash_toolchain"
],
"extensionUsages": [],
"deps": {
"platforms": "platforms@0.0.8",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
},
"repoSpec": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"urls": [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"
],
"integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=",
"strip_prefix": "",
"remote_patches": {},
"remote_patch_strip": 0
}
}
},
"buildifier_prebuilt@6.4.0": {
"name": "buildifier_prebuilt",
"version": "6.4.0",
Expand Down Expand Up @@ -2820,36 +2911,6 @@
"bazel_tools": "bazel_tools@_"
}
},
"bazel_skylib@1.5.0": {
"name": "bazel_skylib",
"version": "1.5.0",
"key": "bazel_skylib@1.5.0",
"repoName": "bazel_skylib",
"executionPlatformsToRegister": [],
"toolchainsToRegister": [
"//toolchains/unittest:cmd_toolchain",
"//toolchains/unittest:bash_toolchain"
],
"extensionUsages": [],
"deps": {
"platforms": "platforms@0.0.8",
"bazel_tools": "bazel_tools@_",
"local_config_platform": "local_config_platform@_"
},
"repoSpec": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"urls": [
"https://github.com/bazelbuild/bazel-skylib/releases/download/1.5.0/bazel-skylib-1.5.0.tar.gz"
],
"integrity": "sha256-zVWgYudjuTSZIfD124w5MyiNyLpPdt2UFqrGis7jy5Q=",
"strip_prefix": "",
"remote_patches": {},
"remote_patch_strip": 0
}
}
},
"stardoc@0.5.6": {
"name": "stardoc",
"version": "0.5.6",
Expand Down Expand Up @@ -3848,6 +3909,164 @@
}
},
"moduleExtensions": {
"//common:repositories.bzl%pin_browsers_extension": {
"general": {
"bzlTransitiveDigest": "lIRd1pRHzimXYycAOry9rFVBqTYsS1WpsUpBPcdRmiw=",
"recordedFileInputs": {},
"recordedDirentsInputs": {},
"envVariables": {},
"generatedRepoSpecs": {
"local_drivers": {
"bzlFile": "@@//common/private:drivers.bzl",
"ruleClassName": "local_drivers",
"attributes": {}
},
"mac_chromedriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/mac-x64/chromedriver-mac-x64.zip",
"sha256": "41d2fd29a9a5b955fa908218e85ef3c4a2f997b72586c13b416196c3861152d3",
"strip_prefix": "chromedriver-mac-x64",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"chromedriver\"])\n\njs_library(\n name = \"chromedriver-js\",\n data = [\"chromedriver\"],\n)\n"
}
},
"linux_edgedriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://msedgedriver.azureedge.net/122.0.2365.80/edgedriver_linux64.zip",
"sha256": "ce49a0e62695ae10226903c00bb15bd296d563a009f03544394228bedf250ab5",
"build_file_content": "exports_files([\"msedgedriver\"])"
}
},
"mac_edgedriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://msedgedriver.azureedge.net/122.0.2365.80/edgedriver_mac64.zip",
"sha256": "a12f5030963240e0838670e4cbaf826bd9e5a92565e5efa2e0066729cb34b523",
"build_file_content": "exports_files([\"msedgedriver\"])"
}
},
"mac_firefox": {
"bzlFile": "@@//common/private:dmg_archive.bzl",
"ruleClassName": "dmg_archive",
"attributes": {
"url": "https://ftp.mozilla.org/pub/firefox/releases/123.0.1/mac/en-US/Firefox%20123.0.1.dmg",
"sha256": "35885bacbe7c838c8de476ced3aa2dc0f8642d613c0db5b462e919da1b6cf8c7",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"Firefox.app\"])\n\njs_library(\n name = \"firefox-js\",\n data = glob([\"Firefox.app/**/*\"]),\n)\n"
}
},
"mac_geckodriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-macos.tar.gz",
"sha256": "9cec1546585b532959782c8220599aa97c1f99265bb2d75ad00cd56ef98f650c",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"geckodriver\"])\n\njs_library(\n name = \"geckodriver-js\",\n data = [\n \"geckodriver\",\n ],\n)\n"
}
},
"linux_beta_firefox": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://ftp.mozilla.org/pub/firefox/releases/124.0b9/linux-x86_64/en-US/firefox-124.0b9.tar.bz2",
"sha256": "80208d269dc8d251a7f9f292a7a6ea9ad217189a01075ff6d77326cb0352c1db",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"files\",\n srcs = glob([\"**/*\"]),\n visibility = [\"//visibility:public\"],\n)\n\nexports_files(\n [\"firefox/firefox\"],\n)\n\njs_library(\n name = \"firefox-js\",\n data = [\":files\"],\n)\n"
}
},
"linux_firefox": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://ftp.mozilla.org/pub/firefox/releases/123.0.1/linux-x86_64/en-US/firefox-123.0.1.tar.bz2",
"sha256": "3b8534ecd870f25434fc7ac8b7a26470492484f24fefe3be8eed0b41db52fe43",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"files\",\n srcs = glob([\"**/*\"]),\n)\n\nexports_files(\n [\"firefox/firefox\"],\n)\n\njs_library(\n name = \"firefox-js\",\n data = [\":files\"],\n)\n"
}
},
"linux_chrome": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/linux64/chrome-linux64.zip",
"sha256": "d20be2808665743423536a2ce030ffa8f6092b9dd9a29f72cd8999ef71955700",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nfilegroup(\n name = \"files\",\n srcs = glob([\"**/*\"]),\n)\n\nexports_files(\n [\"chrome-linux64/chrome\"],\n)\n\njs_library(\n name = \"chrome-js\",\n data = [\":files\"],\n)\n"
}
},
"mac_beta_firefox": {
"bzlFile": "@@//common/private:dmg_archive.bzl",
"ruleClassName": "dmg_archive",
"attributes": {
"url": "https://ftp.mozilla.org/pub/firefox/releases/124.0b9/mac/en-US/Firefox%20124.0b9.dmg",
"sha256": "c716240f5fd76937cccbe93e9ffdb681782fbacb9af1face7416351a6e71a1a3",
"build_file_content": "exports_files([\"Firefox.app\"])"
}
},
"linux_geckodriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://github.com/mozilla/geckodriver/releases/download/v0.34.0/geckodriver-v0.34.0-linux64.tar.gz",
"sha256": "79b2e77edd02c0ec890395140d7cdc04a7ff0ec64503e62a0b74f88674ef1313",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"geckodriver\"])\n\njs_library(\n name = \"geckodriver-js\",\n data = [\n \"geckodriver\",\n ],\n)\n"
}
},
"mac_edge": {
"bzlFile": "@@//common/private:pkg_archive.bzl",
"ruleClassName": "pkg_archive",
"attributes": {
"url": "https://msedge.sf.dl.delivery.mp.microsoft.com/filestreamingservice/files/61b13da3-c921-482a-9166-743689310b71/MicrosoftEdge-122.0.2365.92.pkg",
"sha256": "304243a7ef631781b707c0d9cb8fd35e718cebad91c29078e389bb4e813afef9",
"move": {
"MicrosoftEdge-122.0.2365.92.pkg/Payload/Microsoft Edge.app": "Edge.app"
},
"build_file_content": "exports_files([\"Edge.app\"])"
}
},
"mac_chrome": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/mac-x64/chrome-mac-x64.zip",
"sha256": "f4efaa5dbe4e02d5d324ac862427be2facbca1bed1c75c5bacaa4c922ab5b643",
"strip_prefix": "chrome-mac-x64",
"patch_cmds": [
"mv 'Google Chrome for Testing.app' Chrome.app",
"mv 'Chrome.app/Contents/MacOS/Google Chrome for Testing' Chrome.app/Contents/MacOS/Chrome"
],
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"Chrome.app\"])\n\njs_library(\n name = \"chrome-js\",\n data = glob([\"Chrome.app/**/*\"]),\n)\n"
}
},
"linux_chromedriver": {
"bzlFile": "@@bazel_tools//tools/build_defs/repo:http.bzl",
"ruleClassName": "http_archive",
"attributes": {
"url": "https://storage.googleapis.com/chrome-for-testing-public/122.0.6261.128/linux64/chromedriver-linux64.zip",
"sha256": "40aaf6063c9d88fe43dd3e5b79cc101de1662b42ccac81616ecb0310ba921103",
"strip_prefix": "chromedriver-linux64",
"build_file_content": "\nload(\"@aspect_rules_js//js:defs.bzl\", \"js_library\")\npackage(default_visibility = [\"//visibility:public\"])\n\nexports_files([\"chromedriver\"])\n\njs_library(\n name = \"chromedriver-js\",\n data = [\"chromedriver\"],\n)\n"
}
},
"linux_edge": {
"bzlFile": "@@//common/private:deb_archive.bzl",
"ruleClassName": "deb_archive",
"attributes": {
"url": "https://packages.microsoft.com/repos/edge/pool/main/m/microsoft-edge-stable/microsoft-edge-stable_122.0.2365.92-1_amd64.deb",
"sha256": "eab115c454b669dbc42f83b6b9ccc94ec4f2df5a2cf6be762069c75f18f703e8",
"build_file_content": "\nfilegroup(\n name = \"files\",\n srcs = glob([\"**/*\"]),\n visibility = [\"//visibility:public\"],\n)\n\nexports_files(\n [\"opt/microsoft/msedge/microsoft-edge\"],\n)\n"
}
}
},
"recordedRepoMappingEntries": [
[
"",
"bazel_tools",
"bazel_tools"
]
]
}
},
"//common:selenium_manager.bzl%selenium_manager_artifacts": {
"general": {
"bzlTransitiveDigest": "Yz54SfSuut4/+OMYy+rksIRgHlNIF+uwxnKXHdyUbiM=",
Expand Down
4 changes: 0 additions & 4 deletions WORKSPACE.bzlmod
Expand Up @@ -24,7 +24,3 @@ load("@io_bazel_rules_closure//closure:repositories.bzl", "rules_closure_depende
rules_closure_dependencies()

rules_closure_toolchains()

load("//common:repositories.bzl", "pin_browsers")

pin_browsers()
5 changes: 1 addition & 4 deletions common/private/drivers.bzl
Expand Up @@ -28,9 +28,6 @@ def _local_drivers_impl(repository_ctx):

repository_ctx.file("BUILD.bazel", "\n".join(contents))

_local_drivers = repository_rule(
local_drivers = repository_rule(
_local_drivers_impl,
)

def local_drivers():
_local_drivers(name = "local_drivers")

0 comments on commit 76956e3

Please sign in to comment.