Skip to content

[bazel] Bump to Bazel 8 #15512

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
wants to merge 9 commits into
base: trunk
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -8,11 +8,12 @@ try-import %workspace%/.bazelrc.windows.local
# https://github.com/bazelbuild/bazel/issues/20369
# https://github.com/bazelbuild/bazel/issues/21491

common --lockfile_mode=off
# Required to enable pinned browsers locally. Remove this once we get rid of `$(location)` macros
common --legacy_external_runfiles

# Prepare for Bazel 8. These become the default in 8.0.0
common --incompatible_disallow_empty_glob
common --incompatible_use_plus_in_repo_names
# Required for rules_closure
common --enable_workspace
common --noincompatible_disallow_struct_provider_syntax

# Ensure Windows support is accurate.

@@ -44,7 +45,7 @@ build --javacopt="-Xep:ImpossibleNullComparison:OFF"
build --nobuild_runfile_links

# More JS magic
build --experimental_allow_unresolved_symlinks
build --allow_unresolved_symlinks
# Avoid a warning about directory tracking being unsound
startup --host_jvm_args=-DBAZEL_TRACK_SOURCE_DIRECTORIES=1

@@ -63,8 +64,8 @@ build --incompatible_strict_action_env

# Required to get `protobuf` compiling, which is required for `rules_closure`
build --incompatible_enable_cc_toolchain_resolution
build --cxxopt=-std=c++14
build --host_cxxopt=-std=c++14
build --cxxopt=-std=c++17
build --host_cxxopt=-std=c++17

# For build stamping

@@ -114,7 +115,6 @@ test --test_timeout=1800
test:node_debug --test_output=streamed --test_strategy=exclusive --test_timeout=9999 --nocache_test_results
test:ruby_debug --test_output=streamed --test_env=RUBY_DEBUG_FORK_MODE=parent --run_under="@bundle//bin:rdbg --nonstop --open --command"


build:release --stamp
build:release --compilation_mode=opt

2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
7.4.1
8.1.1
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -133,6 +133,7 @@ MODULE.bazel.lock
/.vscode/
/.scannerwork/
/.bazelrc.local
/MODULE.bazel.lock

# Engflow
*.crt
8 changes: 4 additions & 4 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -3,8 +3,8 @@ module(name = "selenium")
bazel_dep(name = "apple_rules_lint", version = "0.4.0")
bazel_dep(name = "aspect_bazel_lib", version = "2.13.0")
bazel_dep(name = "aspect_rules_esbuild", version = "0.21.0")
bazel_dep(name = "aspect_rules_js", version = "2.1.3")
bazel_dep(name = "aspect_rules_ts", version = "3.4.0")
bazel_dep(name = "aspect_rules_js", version = "2.3.3")
bazel_dep(name = "aspect_rules_ts", version = "3.5.1")
bazel_dep(name = "bazel_features", version = "1.23.0")
bazel_dep(name = "bazel_skylib", version = "1.7.1")
bazel_dep(name = "buildifier_prebuilt", version = "6.4.0")
@@ -19,8 +19,8 @@ bazel_dep(name = "rules_cc", version = "0.1.1", dev_dependency = True)

bazel_dep(name = "rules_dotnet", version = "0.17.5")
bazel_dep(name = "rules_java", version = "8.7.1")
bazel_dep(name = "rules_jvm_external", version = "6.6")
bazel_dep(name = "rules_nodejs", version = "6.3.2")
bazel_dep(name = "rules_jvm_external", version = "6.7")
bazel_dep(name = "rules_nodejs", version = "6.3.4")
bazel_dep(name = "rules_oci", version = "1.8.0")
bazel_dep(name = "rules_pkg", version = "1.0.1")
bazel_dep(name = "rules_python", version = "1.1.0")
8 changes: 8 additions & 0 deletions java/src/org/openqa/selenium/grid/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -34,12 +34,16 @@ java_binary(
"//common:linux": [
"@linux_chrome//:chrome-linux64/chrome",
"@linux_chromedriver//:chromedriver",
"@linux_edge//:opt/microsoft/msedge/microsoft-edge",
"@linux_edgedriver//:msedgedriver",
"@linux_firefox//:firefox/firefox",
"@linux_geckodriver//:geckodriver",
],
"//common:macos": [
"@mac_chrome//:Chrome.app",
"@mac_chromedriver//:chromedriver",
"@mac_edge//:Edge.app",
"@mac_edgedriver//:msedgedriver",
"@mac_firefox//:Firefox.app",
"@mac_geckodriver//:geckodriver",
],
@@ -49,12 +53,16 @@ java_binary(
"//common:linux": [
"-Dwebdriver.chrome.driver=$(location @linux_chromedriver//:chromedriver)",
"-Dwebdriver.chrome.binary=$(location @linux_chrome//:chrome-linux64/chrome)",
"-Dwebdriver.edge.binary=$(location @linux_edge//:opt/microsoft/msedge/microsoft-edge)",
"-Dwebdriver.edge.driver=$(location @linux_edgedriver//:msedgedriver)",
"-Dwebdriver.gecko.driver=$(location @linux_geckodriver//:geckodriver)",
"-Dwebdriver.firefox.bin=$(location @linux_firefox//:firefox/firefox)",
],
"//common:macos": [
"-Dwebdriver.chrome.driver=$(location @mac_chromedriver//:chromedriver)",
"-Dwebdriver.chrome.binary=$(location @mac_chrome//:Chrome.app)/Contents/MacOS/Chrome",
"-Dwebdriver.edge.binary=\"$(location @mac_edge//:Edge.app)/Contents/MacOS/Microsoft Edge\"",
"-Dwebdriver.edge.driver=$(location @mac_edgedriver//:msedgedriver)",
"-Dwebdriver.gecko.driver=$(location @mac_geckodriver//:geckodriver)",
"-Dwebdriver.firefox.bin=$(location @mac_firefox//:Firefox.app)/Contents/MacOS/firefox",
],
6 changes: 3 additions & 3 deletions javascript/grid-ui/package.json
Original file line number Diff line number Diff line change
@@ -4,11 +4,11 @@
"private": true,
"type": "module",
"dependencies": {
"@apollo/client": "3.12.6",
"@apollo/client": "3.13.5",
"@emotion/react": "11.14.0",
"@emotion/styled": "11.14.0",
"@mui/icons-material": "5.15.18",
"@mui/material": "5.15.18",
"@mui/icons-material": "5.17.1",
"@mui/material": "5.17.1",
"@novnc/novnc": "1.5.0",
"@types/jest": "29.5.14",
"@types/node": "20.12.12",
114 changes: 22 additions & 92 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions py/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -72,6 +72,7 @@ BROWSER_VERSIONS = [

TEST_DEPS = [
requirement("attrs"),
requirement("bazel_runfiles"),
requirement("debugpy"),
requirement("filetype"),
requirement("idna"),
19 changes: 19 additions & 0 deletions py/conftest.py
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
from urllib.request import urlopen

import pytest
from runfiles import Runfiles

from selenium import webdriver

@@ -191,6 +192,16 @@ def get_options(driver_class, config):
bidi = bool(config.option.bidi)
options = None

# Check to see if the `browser_path` exists
if browser_path:
if not os.path.exists(browser_path):
# Maybe it's hiding in the runfiles
r = Runfiles.Create()
rlocation_path = r.Rlocation(browser_path)
if not os.path.exists(rlocation_path):
raise Exception("Unable to find browser at " + browser_path)
browser_path = rlocation_path

if browser_path or browser_args:
if not options:
options = getattr(webdriver, f"{driver_class}Options")()
@@ -226,6 +237,14 @@ def get_service(driver_class, executable):
if not executable:
return None

# Make sure the executable exists
if not os.path.exists(executable):
r = Runfiles.Create()
rlocation_path = r.Rlocation(executable)
if not os.path.exists(rlocation_path):
raise Exception("Unable to find driver executable: " + executable)
executable = rlocation_path

module = getattr(webdriver, driver_class.lower())
service = module.service.Service(executable_path=executable)

Loading