From 2e96f46d57e2dad865fff7e13eebd8b619c809b8 Mon Sep 17 00:00:00 2001 From: Simon Mavi Stewart Date: Mon, 3 Feb 2025 10:34:28 +0000 Subject: [PATCH 1/2] [bazel] Remove empty globs In Bazel 8, the default is to disallow empty globs. Rather than make more changes as we update, instead we'll flip the flag now and fix up any issues. This will make the Bazel 8 update simpler. --- .bazelrc | 5 ++- dotnet/src/support/BUILD.bazel | 2 -- dotnet/test/support/Events/BUILD.bazel | 5 +-- .../openqa/selenium/grid/session/BUILD.bazel | 1 - .../selenium/grid/sessionqueue/BUILD.bazel | 31 ------------------- .../selenium/remote/codec/jwp/BUILD.bazel | 17 ---------- javascript/grid-ui/BUILD.bazel | 1 - .../node/selenium-webdriver/BUILD.bazel | 1 - rb/BUILD.bazel | 1 - 9 files changed, 5 insertions(+), 59 deletions(-) delete mode 100644 java/test/org/openqa/selenium/remote/codec/jwp/BUILD.bazel diff --git a/.bazelrc b/.bazelrc index e4834f9759d01..9e75d42ea46ef 100644 --- a/.bazelrc +++ b/.bazelrc @@ -8,7 +8,10 @@ try-import %workspace%/.bazelrc.windows.local # https://github.com/bazelbuild/bazel/issues/20369 # https://github.com/bazelbuild/bazel/issues/21491 -common --enable_bzlmod --lockfile_mode=off +common --lockfile_mode=off + +# Prepare for Bazel 8. This becomes the default in 8.0.0 +common --incompatible_disallow_empty_glob # Ensure Windows support is accurate. diff --git a/dotnet/src/support/BUILD.bazel b/dotnet/src/support/BUILD.bazel index 815b0b81ccbc3..85cc060bcc324 100644 --- a/dotnet/src/support/BUILD.bazel +++ b/dotnet/src/support/BUILD.bazel @@ -31,7 +31,6 @@ csharp_library( "*.cs", "Events/*.cs", "Extensions/*.cs", - "PageObjects/**/*.cs", "UI/*.cs", ]) + [":assembly-info"], out = "WebDriver.Support", @@ -71,7 +70,6 @@ csharp_library( "*.cs", "Events/*.cs", "Extensions/*.cs", - "PageObjects/**/*.cs", "UI/*.cs", ]) + [":assembly-info"], out = "WebDriver.Support.StrongNamed", diff --git a/dotnet/test/support/Events/BUILD.bazel b/dotnet/test/support/Events/BUILD.bazel index 250be2b042394..7c3d1841832e2 100644 --- a/dotnet/test/support/Events/BUILD.bazel +++ b/dotnet/test/support/Events/BUILD.bazel @@ -22,10 +22,7 @@ dotnet_nunit_test_suite( name = "LargeTests", size = "large", srcs = glob( - [ - "**/*Test.cs", - "**/*Tests.cs", - ], + ["*Test.cs"], exclude = SMALL_TESTS, ) + [ "//dotnet/test/common:assembly-fixtures", diff --git a/java/src/org/openqa/selenium/grid/session/BUILD.bazel b/java/src/org/openqa/selenium/grid/session/BUILD.bazel index 551ed759669d4..4195249e38602 100644 --- a/java/src/org/openqa/selenium/grid/session/BUILD.bazel +++ b/java/src/org/openqa/selenium/grid/session/BUILD.bazel @@ -5,7 +5,6 @@ java_library( name = "session", srcs = glob([ "*.java", - "remote/*.java", ]), visibility = [ "//java/src/org/openqa/selenium/grid:__subpackages__", diff --git a/java/test/org/openqa/selenium/grid/sessionqueue/BUILD.bazel b/java/test/org/openqa/selenium/grid/sessionqueue/BUILD.bazel index 2bc8b16e2f145..e69de29bb2d1d 100644 --- a/java/test/org/openqa/selenium/grid/sessionqueue/BUILD.bazel +++ b/java/test/org/openqa/selenium/grid/sessionqueue/BUILD.bazel @@ -1,31 +0,0 @@ -load("@rules_jvm_external//:defs.bzl", "artifact") -load("//java:defs.bzl", "JUNIT5_DEPS", "java_test_suite") -load("//java:version.bzl", "TOOLS_JAVA_VERSION") - -java_test_suite( - name = "SmallTests", - size = "small", - srcs = glob(["*Test.java"]), - javacopts = [ - "--release", - TOOLS_JAVA_VERSION, - ], - deps = [ - "//java/src/org/openqa/selenium/events", - "//java/src/org/openqa/selenium/events/local", - "//java/src/org/openqa/selenium/grid/data", - "//java/src/org/openqa/selenium/grid/security", - "//java/src/org/openqa/selenium/grid/sessionqueue", - "//java/src/org/openqa/selenium/grid/sessionqueue/local", - "//java/src/org/openqa/selenium/grid/sessionqueue/remote", - "//java/src/org/openqa/selenium/json", - "//java/src/org/openqa/selenium/remote", - "//java/src/org/openqa/selenium/support", - "//java/test/org/openqa/selenium/grid/testing", - "//java/test/org/openqa/selenium/remote/tracing:tracing-support", - artifact("org.junit.jupiter:junit-jupiter-api"), - artifact("io.opentelemetry:opentelemetry-api"), - artifact("org.assertj:assertj-core"), - artifact("com.google.guava:guava"), - ] + JUNIT5_DEPS, -) diff --git a/java/test/org/openqa/selenium/remote/codec/jwp/BUILD.bazel b/java/test/org/openqa/selenium/remote/codec/jwp/BUILD.bazel deleted file mode 100644 index 27e16cabe5639..0000000000000 --- a/java/test/org/openqa/selenium/remote/codec/jwp/BUILD.bazel +++ /dev/null @@ -1,17 +0,0 @@ -load("@rules_jvm_external//:defs.bzl", "artifact") -load("//java:defs.bzl", "JUNIT5_DEPS", "java_test_suite") - -java_test_suite( - name = "SmallTests", - size = "small", - srcs = glob(["*.java"]), - deps = [ - "//java/src/org/openqa/selenium/json", - "//java/src/org/openqa/selenium/remote", - "//java/src/org/openqa/selenium/remote/http", - "//java/test/org/openqa/selenium/testing:annotations", - artifact("com.google.guava:guava"), - artifact("org.junit.jupiter:junit-jupiter-api"), - artifact("org.assertj:assertj-core"), - ] + JUNIT5_DEPS, -) diff --git a/javascript/grid-ui/BUILD.bazel b/javascript/grid-ui/BUILD.bazel index 19a1095d13d1e..057d9e8c0bbb9 100644 --- a/javascript/grid-ui/BUILD.bazel +++ b/javascript/grid-ui/BUILD.bazel @@ -27,7 +27,6 @@ js_library( SRCS = glob( [ - "public/**/*", "src/**/*", ], exclude = [ diff --git a/javascript/node/selenium-webdriver/BUILD.bazel b/javascript/node/selenium-webdriver/BUILD.bazel index 9b0a70ff974a4..b53f221f9b9d1 100644 --- a/javascript/node/selenium-webdriver/BUILD.bazel +++ b/javascript/node/selenium-webdriver/BUILD.bazel @@ -32,7 +32,6 @@ js_library( "http/*.js", "io/*.js", "lib/*.js", - "lib/atoms/bidi-mutation-listener.js", "lib/fedcm/*.js", "net/*.js", "remote/*.js", diff --git a/rb/BUILD.bazel b/rb/BUILD.bazel index 4bf70b0e77bf9..3c38d16159a8c 100644 --- a/rb/BUILD.bazel +++ b/rb/BUILD.bazel @@ -179,7 +179,6 @@ rb_binary( rb_test( name = "lint", - srcs = glob(["**/*.rb"]), args = [ "--autocorrect", "--config=rb/.rubocop.yml", From ee8e8d3e01941e4a6e72174f74d7cc569703d387 Mon Sep 17 00:00:00 2001 From: Simon Mavi Stewart Date: Mon, 3 Feb 2025 10:43:53 +0000 Subject: [PATCH 2/2] [bazel] Use the new workspace naming convention --- .bazelrc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.bazelrc b/.bazelrc index 9e75d42ea46ef..a9bb83374335e 100644 --- a/.bazelrc +++ b/.bazelrc @@ -10,8 +10,9 @@ try-import %workspace%/.bazelrc.windows.local common --lockfile_mode=off -# Prepare for Bazel 8. This becomes the default in 8.0.0 +# Prepare for Bazel 8. These become the default in 8.0.0 common --incompatible_disallow_empty_glob +common --incompatible_use_plus_in_repo_names # Ensure Windows support is accurate.