-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
[build] Support os architecture in pinned chrome browser #17268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
nvborisenko
wants to merge
1
commit into
SeleniumHQ:trunk
Choose a base branch
from
nvborisenko:bazel-pibrowsers-arch-chrome
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+127
−38
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,9 +6,14 @@ load("//common/private:dmg_archive.bzl", "dmg_archive") | |
| load("//common/private:drivers.bzl", "local_drivers") | ||
| load("//common/private:pkg_archive.bzl", "pkg_archive") | ||
|
|
||
| def pin_browsers(): | ||
| def pin_browsers(arch): | ||
| local_drivers(name = "local_drivers") | ||
|
|
||
| if arch == "x86_64": | ||
| chrome_arch = "x64" | ||
| else: | ||
| chrome_arch = "arm64" | ||
|
|
||
|
Comment on lines
+9
to
+16
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 2. Generator not updated common/repositories.bzl is generated by scripts/pinned_browsers.py, but this PR changes the generated output shape (pin_browsers now takes arch and extension passes _ctx.os.arch) without updating the generator, so regenerating will overwrite and remove the arch-aware pinning. Agent Prompt
|
||
| http_archive( | ||
| name = "linux_firefox", | ||
| url = "https://ftp.mozilla.org/pub/firefox/releases/149.0/linux-x86_64/en-US/firefox-149.0.tar.xz", | ||
|
|
@@ -218,16 +223,17 @@ js_library( | |
| ) | ||
| """, | ||
| ) | ||
| http_archive( | ||
| name = "mac_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-arm64/chrome-mac-arm64.zip", | ||
| sha256 = "41f692f646dd3ce07ed377d71a15f90e8f2f9a3e3af383c5dde0718f034d6b52", | ||
| strip_prefix = "chrome-mac-arm64", | ||
| 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 = """ | ||
| if chrome_arch == "x64": | ||
| http_archive( | ||
| name = "mac_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-x64/chrome-mac-x64.zip", | ||
| sha256 = "266fe088699a2bdaec210ecb5a4951d9f6047ab5a54d58b220d9602ca0b00a5f", | ||
| 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 = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
|
|
@@ -238,7 +244,29 @@ js_library( | |
| data = glob(["Chrome.app/**/*"]), | ||
| ) | ||
| """, | ||
| ) | ||
| ) | ||
| else: | ||
| http_archive( | ||
| name = "mac_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-arm64/chrome-mac-arm64.zip", | ||
| sha256 = "41f692f646dd3ce07ed377d71a15f90e8f2f9a3e3af383c5dde0718f034d6b52", | ||
| strip_prefix = "chrome-mac-arm64", | ||
| 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 = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| exports_files(["Chrome.app"]) | ||
|
|
||
| js_library( | ||
| name = "chrome-js", | ||
| data = glob(["Chrome.app/**/*"]), | ||
| ) | ||
| """, | ||
| ) | ||
| http_archive( | ||
| name = "linux_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/linux64/chromedriver-linux64.zip", | ||
|
|
@@ -257,12 +285,13 @@ js_library( | |
| """, | ||
| ) | ||
|
|
||
| http_archive( | ||
| name = "mac_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-arm64/chromedriver-mac-arm64.zip", | ||
| sha256 = "43115f874f6590de5525eadf1eb441a02cb1cb907f2a3973f820ca808425d8d6", | ||
| strip_prefix = "chromedriver-mac-arm64", | ||
| build_file_content = """ | ||
| if chrome_arch == "x64": | ||
| http_archive( | ||
| name = "mac_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-x64/chromedriver-mac-x64.zip", | ||
| sha256 = "691fa9d77ec37cf6f7b0d10331dbe433a41e9f7fad810996956423dd820369e3", | ||
| strip_prefix = "chromedriver-mac-x64", | ||
| build_file_content = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
|
|
@@ -273,7 +302,25 @@ js_library( | |
| data = ["chromedriver"], | ||
| ) | ||
| """, | ||
| ) | ||
| ) | ||
| else: | ||
| http_archive( | ||
| name = "mac_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/146.0.7680.165/mac-arm64/chromedriver-mac-arm64.zip", | ||
| sha256 = "43115f874f6590de5525eadf1eb441a02cb1cb907f2a3973f820ca808425d8d6", | ||
| strip_prefix = "chromedriver-mac-arm64", | ||
| build_file_content = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| exports_files(["chromedriver"]) | ||
|
|
||
| js_library( | ||
| name = "chromedriver-js", | ||
| data = ["chromedriver"], | ||
| ) | ||
| """, | ||
| ) | ||
|
|
||
| http_archive( | ||
| name = "linux_beta_chrome", | ||
|
|
@@ -296,16 +343,17 @@ js_library( | |
| ) | ||
| """, | ||
| ) | ||
| http_archive( | ||
| name = "mac_beta_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-arm64/chrome-mac-arm64.zip", | ||
| sha256 = "37da2605bae9b5d349546eb9b6700ee6af27aa9b643ee4c58d7bc22d1209a03f", | ||
| strip_prefix = "chrome-mac-arm64", | ||
| 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 = """ | ||
| if chrome_arch == "x64": | ||
| http_archive( | ||
| name = "mac_beta_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-x64/chrome-mac-x64.zip", | ||
| sha256 = "02a0a7ff74a3994fb6bdb6391c1f20319b102af569828f15248d1398c3e414a2", | ||
| 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 = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
|
|
@@ -316,7 +364,29 @@ js_library( | |
| data = glob(["Chrome.app/**/*"]), | ||
| ) | ||
| """, | ||
| ) | ||
| ) | ||
| else: | ||
| http_archive( | ||
| name = "mac_beta_chrome", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-arm64/chrome-mac-arm64.zip", | ||
| sha256 = "37da2605bae9b5d349546eb9b6700ee6af27aa9b643ee4c58d7bc22d1209a03f", | ||
| strip_prefix = "chrome-mac-arm64", | ||
| 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 = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| exports_files(["Chrome.app"]) | ||
|
|
||
| js_library( | ||
| name = "chrome-js", | ||
| data = glob(["Chrome.app/**/*"]), | ||
| ) | ||
| """, | ||
| ) | ||
| http_archive( | ||
| name = "linux_beta_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/linux64/chromedriver-linux64.zip", | ||
|
|
@@ -335,12 +405,13 @@ js_library( | |
| """, | ||
| ) | ||
|
|
||
| http_archive( | ||
| name = "mac_beta_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-arm64/chromedriver-mac-arm64.zip", | ||
| sha256 = "76cc4a27016387fbe8fa0905bd73e1c715905b6f1240053103299ee293cfde9c", | ||
| strip_prefix = "chromedriver-mac-arm64", | ||
| build_file_content = """ | ||
| if chrome_arch == "x64": | ||
| http_archive( | ||
| name = "mac_beta_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-x64/chromedriver-mac-x64.zip", | ||
| sha256 = "c1f1520e8ea57b8c49f18310448929ca4503df596df76415a748ddeeaabe6d7d", | ||
| strip_prefix = "chromedriver-mac-x64", | ||
| build_file_content = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
|
|
@@ -351,10 +422,28 @@ js_library( | |
| data = ["chromedriver"], | ||
| ) | ||
| """, | ||
| ) | ||
| ) | ||
| else: | ||
| http_archive( | ||
| name = "mac_beta_chromedriver", | ||
| url = "https://storage.googleapis.com/chrome-for-testing-public/147.0.7727.24/mac-arm64/chromedriver-mac-arm64.zip", | ||
| sha256 = "76cc4a27016387fbe8fa0905bd73e1c715905b6f1240053103299ee293cfde9c", | ||
| strip_prefix = "chromedriver-mac-arm64", | ||
| build_file_content = """ | ||
| load("@aspect_rules_js//js:defs.bzl", "js_library") | ||
| package(default_visibility = ["//visibility:public"]) | ||
|
|
||
| exports_files(["chromedriver"]) | ||
|
|
||
| js_library( | ||
| name = "chromedriver-js", | ||
| data = ["chromedriver"], | ||
| ) | ||
| """, | ||
| ) | ||
|
|
||
| def _pin_browsers_extension_impl(_ctx): | ||
| pin_browsers() | ||
| pin_browsers(arch = _ctx.os.arch) | ||
|
|
||
| pin_browsers_extension = module_extension( | ||
| implementation = _pin_browsers_extension_impl, | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1. pin_browsers() signature changed
📘 Rule violation✓ CorrectnessAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools