Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:SeleniumHQ Selenium Bazel Build Verification

From Leeroopedia
Knowledge Sources
Domains Build_Systems, Continuous_Integration, Quality_Assurance
Last Updated 2026-02-11 00:00 GMT

Overview

Process of compiling Selenium source code using Bazel to verify that changes build successfully before testing.

Description

Bazel build verification ensures that code changes compile correctly and produce valid artifacts. The Selenium monorepo uses Bazel labels organized by language binding (//java/..., //py/..., //rb/..., //dotnet/..., //javascript/...). Each buildable module is defined in a BUILD.bazel file, referenced by //relative/path:target_name. The ./go wrapper (a Rake-based task runner defined in rake_tasks/bazel.rb) provides convenience commands that delegate to Bazel. bazel query is used to explore the build graph and locate correct labels before building. The Grid server has a shortcut alias: bazel build grid builds //java/src/org/openqa/selenium/grid:executable-grid.

Usage

Run after making code changes and before running tests. Use bazel query to find the correct build target for changed files. Start with targeted builds for changed packages (e.g., //java/src/org/openqa/selenium/chrome/...) rather than building everything (//java/...). Output artifacts are placed in bazel-bin/.

Theoretical Basis

# Build Verification Process
1. Identify changed files -> determine affected Bazel packages
2. bazel query 'kind(rule, //path/...)' -> explore build graph
3. bazel build //path/to/package/... -> compile
4. Check for compilation errors, missing dependencies
5. Verify artifact produced in bazel-bin/

# Bazel Label Format
//relative/path/to/BUILD.bazel:target_name

# Language Build Targets
java       -> bazel build //java/...
python     -> bazel build //py/...
ruby       -> bazel build //rb/...
dotnet     -> bazel build //dotnet/...
javascript -> bazel build //javascript/selenium-webdriver/...
grid       -> bazel build grid (alias for //java/.../grid:executable-grid)
rust       -> bazel build //rust/...

# ./go Wrapper (Rake tasks)
./go java:build     -> bazel build //java/...
./go py:build       -> bazel build //py/...
./go rb:build       -> bazel build //rb/...
./go <lang>:install -> build + install locally

Related Pages

Implemented By

Uses Heuristic

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment