Skip to content

Commit

Permalink
[bazel] Bump to 7.1.0 without bzlmod (#13713)
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c authored Mar 21, 2024
1 parent d431dc8 commit 12344fe
Show file tree
Hide file tree
Showing 10 changed files with 35 additions and 22 deletions.
7 changes: 5 additions & 2 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
try-import .bazelrc.local
try-import .bazelrc.windows.local

# Disable bzlmod until we're ready to use it
common --noenable_bzlmod

# Ensure Windows support is accurate.

startup --windows_enable_symlinks
Expand Down Expand Up @@ -147,8 +150,8 @@ build:remote --//common:pin_browsers
# The remote build machines are pretty small, and 50 threads may leave them
# thrashing, but our dev machines are a lot larger. Scale the workload so we
# make reasonable usage of everything, everywhere, all at once.
build:remote --local_cpu_resources='HOST_CPUS*10'
build:remote --local_ram_resources='HOST_RAM*4.0'
build:remote --local_resources=cpu='HOST_CPUS*10'
build:remote --local_resources=memory='HOST_RAM*4.0'

# A small hint that we're running our tests remotely
test:remote --test_env=REMOTE_BUILD=1
Expand Down
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.5.0
7.1.0
1 change: 1 addition & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module(name = "selenium")
6 changes: 3 additions & 3 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ http_archive(
patches = [
"//java:rules_jvm_external_javadoc.patch",
],
sha256 = "f86fd42a809e1871ca0aabe89db0d440451219c3ce46c58da240c7dcdc00125f",
strip_prefix = "rules_jvm_external-5.2",
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/5.2/rules_jvm_external-5.2.tar.gz",
sha256 = "85fd6bad58ac76cc3a27c8e051e4255ff9ccd8c92ba879670d195622e7c0a9b7",
strip_prefix = "rules_jvm_external-6.0",
url = "https://github.com/bazelbuild/rules_jvm_external/releases/download/6.0/rules_jvm_external-6.0.tar.gz",
)

load("@rules_jvm_external//:repositories.bzl", "rules_jvm_external_deps")
Expand Down
2 changes: 2 additions & 0 deletions WORKSPACE.bzlmod
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
workspace(name = "selenium")

8 changes: 5 additions & 3 deletions java/private/export.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,11 @@ def java_export(
name = "%s.publish" % name,
coordinates = maven_coordinates,
pom = "%s-pom" % name,
javadocs = "%s-docs" % name,
artifact_jar = ":%s-maven-module" % name,
source_jar = ":%s-maven-source" % name,
artifact = ":%s-maven-module" % name,
classifier_artifacts = {
":%s-docs" % name: "javadoc",
":%s-maven-source" % name: "sources",
},
visibility = visibility,
)

Expand Down
1 change: 1 addition & 0 deletions java/private/module.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,5 @@ java_module = rule(
cfg = "exec",
),
},
toolchains = ["@bazel_tools//tools/jdk:toolchain_type"],
)
1 change: 0 additions & 1 deletion java/private/selenium_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ def selenium_test(name, test_class, size = "medium", browsers = DEFAULT_BROWSERS
size = size,
jvm_flags = BROWSERS[browser]["jvm_flags"] + jvm_flags + [
"-Dselenium.browser.remote=true",
"-Dselenium.browser.remote.path=$(location @selenium//java/src/org/openqa/selenium/grid:selenium_server)",
],
# No need to lint remote tests as the code for non-remote is the same and they get linted
tags = BROWSERS[browser]["tags"] + tags + ["remote-browser", "no-lint"],
Expand Down
1 change: 1 addition & 0 deletions java/test/org/openqa/selenium/testing/drivers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,6 @@ java_library(
"//java/test/org/openqa/selenium/build",
artifact("com.google.guava:guava"),
artifact("org.junit.jupiter:junit-jupiter-api"),
"@bazel_tools//tools/java/runfiles",
] + JUNIT5_DEPS,
)
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,21 @@

import static java.util.concurrent.TimeUnit.SECONDS;

import com.google.devtools.build.runfiles.Runfiles;
import java.io.File;
import java.io.IOException;
import java.net.MalformedURLException;
import java.net.URL;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.logging.Logger;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.openqa.selenium.Platform;
import org.openqa.selenium.build.BazelBuild;
import org.openqa.selenium.build.DevMode;
import org.openqa.selenium.build.InProject;
import org.openqa.selenium.chrome.ChromeDriverService;
import org.openqa.selenium.edge.EdgeDriverService;
import org.openqa.selenium.firefox.GeckoDriverService;
Expand Down Expand Up @@ -165,16 +166,19 @@ public void stop() {
}

private String buildServerAndClasspath() {
if (DevMode.isInDevMode()) {
Path serverJar =
InProject.locate("bazel-bin/java/src/org/openqa/selenium/grid/selenium_server");
if (serverJar == null) {
new BazelBuild().build("grid");
serverJar = InProject.locate("bazel-bin/java/src/org/openqa/selenium/grid/selenium_server");
}
if (serverJar != null) {
return serverJar.toAbsolutePath().toString();
try {
Runfiles.Preloaded runfiles = Runfiles.preload();
String location =
runfiles
.unmapped()
.rlocation("selenium/java/src/org/openqa/selenium/grid/selenium_server");
System.err.println("Location found is: " + location);
Path path = Paths.get(location);
if (Files.exists(path)) {
return location;
}
} catch (IOException e) {
// Fall through
}

if (System.getProperty("selenium.browser.remote.path") != null) {
Expand Down

0 comments on commit 12344fe

Please sign in to comment.