Skip to content

Commit de67910

Browse files
committed
[bazel] Migrate to Bazel 8
1 parent 00111ed commit de67910

File tree

5 files changed

+17
-7
lines changed

5 files changed

+17
-7
lines changed

.bazelrc

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,9 @@ try-import %workspace%/.bazelrc.windows.local
99
# https://github.com/bazelbuild/bazel/issues/21491
1010

1111
common --lockfile_mode=off
12-
13-
# Prepare for Bazel 8. These become the default in 8.0.0
14-
common --incompatible_disallow_empty_glob
15-
common --incompatible_use_plus_in_repo_names
12+
# We need this for rust and closure targets
13+
common --enable_workspace
14+
common --noincompatible_disallow_struct_provider_syntax
1615

1716
# Ensure Windows support is accurate.
1817

@@ -30,7 +29,6 @@ build --tool_java_language_version=17
3029
build --tool_java_runtime_version=remotejdk_17
3130

3231
# We target java 11 by default
33-
3432
build --javacopt="--release 11"
3533

3634
# Require java dependencies to be used and first-order

.bazelversion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.4.1
1+
8.0.1

py/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ BROWSER_VERSIONS = [
7272
]
7373

7474
TEST_DEPS = [
75+
"@rules_python//python/runfiles",
7576
requirement("attrs"),
7677
requirement("debugpy"),
7778
requirement("filetype"),

py/conftest.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import socket
2121
import subprocess
2222
import time
23+
from pathlib import Path
24+
from python.runfiles import Runfiles
2325
from test.selenium.webdriver.common.network import get_lan_ip
2426
from test.selenium.webdriver.common.webserver import SimpleWebServer
2527
from urllib.request import urlopen
@@ -192,6 +194,7 @@ def get_options(driver_class, config):
192194
options = None
193195

194196
if browser_path or browser_args:
197+
print("Browser path", browser_path, "Browser args", browser_args)
195198
if not options:
196199
options = getattr(webdriver, f"{driver_class}Options")()
197200
if driver_class == "WebKitGTK":
@@ -226,8 +229,15 @@ def get_service(driver_class, executable):
226229
if not executable:
227230
return None
228231

232+
r = Runfiles.Create()
233+
path = r.Rlocation(executable)
234+
print("cwd", os.getcwd())
235+
print("get_service, executable is", executable, path)
236+
if not Path(path).is_file():
237+
raise ValueError(f"Hmph!: {path}")
238+
229239
module = getattr(webdriver, driver_class.lower())
230-
service = module.service.Service(executable_path=executable)
240+
service = module.service.Service(executable_path=path)
231241

232242
return service
233243

py/selenium/webdriver/common/driver_finder.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717
import logging
18+
import os
1819
from pathlib import Path
1920

2021
from selenium.common.exceptions import NoSuchDriverException

0 commit comments

Comments
 (0)