Skip to content
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

Enable bzlmod in Bazel 7 #13726

Merged
merged 47 commits into from
Apr 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
01e5c1a
[bazel] Enable bzlmod
p0deje Mar 22, 2024
fb4f227
[bazel] Move rules_ruby to MODULE
p0deje Mar 22, 2024
593ff20
[bazel] Move rules_dotnet to MODULE
p0deje Mar 22, 2024
4414277
[bazel] Move rules_rust to MODULE
p0deje Mar 22, 2024
9c24a5c
[bazel] Move rules_python to MODULE
p0deje Mar 22, 2024
8654a75
[bazel] Move rules_jvm_external to MODULE
p0deje Mar 22, 2024
5b0051d
[bazel] Move apple_rules_lint to MODULE
p0deje Mar 22, 2024
bbd2728
[bazel] Move rules_proto to MODULE
p0deje Mar 22, 2024
c7a2d5c
[bazel] Move rules_js to MODULE
p0deje Mar 23, 2024
c033602
[bazel] Move rules_oci to MODULE
p0deje Mar 23, 2024
2f76bdf
[bazel] Move rules_pkg to MODULE
p0deje Mar 23, 2024
96be775
[bazel] Move prebuilt selenium-manager to MODULE
p0deje Mar 23, 2024
a4ef9e8
[bazel] Move buildifier to MODULE
p0deje Mar 23, 2024
fb8df02
[bazel] Move pinned browsers to MODULE
p0deje Mar 23, 2024
38fd88e
[bazel] Extract remote configuration into separate file
p0deje Mar 25, 2024
d93b3cb
[bazel] Fix runfiles loading in Bzlmod
p0deje Mar 25, 2024
e0b1e81
[bazel] Add missing dependencies
p0deje Mar 25, 2024
cf4bc90
[bazel] Update lockfile
p0deje Mar 25, 2024
52d967e
[bazel] Fix .NET compiler errors
p0deje Mar 25, 2024
8679e7c
[bazel] Fix runfiles loading in JavaScript tests
p0deje Mar 26, 2024
a4b71c2
[bazel] Update gem checksums
p0deje Mar 27, 2024
d9d75b7
[bazel] Keep rules_rust in WORKSPACE
p0deje Mar 27, 2024
f306262
[bazel] Repin Cargo.Bazel.lock
Mar 27, 2024
c05bc38
[bazel] Regenerate maven_install.json
p0deje Mar 27, 2024
f8150bf
[dotnet] Ignore flaky tests on RBE
p0deje Mar 27, 2024
50ee4e1
[bazel] Update gem checksums
p0deje Mar 27, 2024
e9aae77
[bazel] Disable lockfile
p0deje Mar 28, 2024
a1d8df9
[rb] Disable failing Edge test
p0deje Mar 28, 2024
40b0964
[bazel] Update CI caching manifest for bzlmod
p0deje Mar 28, 2024
f3affe3
[bazel] Update rules_rust to 0.41
p0deje Mar 28, 2024
ce29b17
Revert "[rb] Disable failing Edge test"
p0deje Mar 28, 2024
1d68305
[ci] Don't use non-bzlmod caches
p0deje Mar 28, 2024
3f8262c
[bazel] Fix node toolchain loading
p0deje Mar 28, 2024
ca16449
[ci] Use JDK 17
p0deje Mar 28, 2024
7e25eb1
[bazel] Restore javadoc targets
p0deje Mar 28, 2024
b0ee858
[bazel] Fix maven_bom targets
p0deje Mar 29, 2024
cc5015d
[bazel] Remove WORKSPACE mode in favor of bzlmod
p0deje Mar 29, 2024
2c0f671
[rb][dotnet][java][py] Update Edge to 123
p0deje Mar 29, 2024
3ba04fb
[rb] Fix runfiles location in docs
p0deje Mar 29, 2024
57a5a11
[dotnet] Revert System namespace prefix
p0deje Mar 30, 2024
297f4fe
[bazel] Move rules_rust to MODULE.bazel
p0deje Apr 4, 2024
b7a76a8
[bazel] Update bazel_features
p0deje Apr 15, 2024
8c97194
[bazel] Update rules_rust
p0deje Apr 16, 2024
c48065a
[bazel] Revert Cargo changes
p0deje Apr 17, 2024
9bcb14d
[bazel] Use default Rust toolchain
p0deje Apr 17, 2024
2d1b802
[bazel] Update rules_js
p0deje Apr 17, 2024
ede7ec4
[bazel] Move rules_rust back to WORKSPACE to fix zstd compilation
p0deje Apr 17, 2024
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
88 changes: 10 additions & 78 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import .bazelrc.remote
try-import .bazelrc.local
try-import .bazelrc.windows.local

# Disable bzlmod until we're ready to use it
common --noenable_bzlmod
# Enable bzlmod but without lockfile for a moment.
# Lockfile is a problem to check in at the moment
# because of constant Git conflicts and platform-specific
# pieces.
# https://github.com/bazelbuild/bazel/issues/20369
# https://github.com/bazelbuild/bazel/issues/21491

common --enable_bzlmod --lockfile_mode=off

# Ensure Windows support is accurate.

Expand Down Expand Up @@ -70,6 +77,7 @@ test --test_env=MOZ_HEADLESS
test --test_env=SELENIUM_BROWSER
test --test_env=TRAVIS
test --test_env=PYTHON_VERSION
test --test_env=SE_AVOID_STATS=true

# Remove once rules_ruby support proper $LOAD_PATH expansion.

Expand All @@ -81,11 +89,6 @@ test --test_env=RUBYOPT="-Irb/lib -w"
build --action_env=JRUBY_OPTS="--dev"
test --test_env=JRUBY_OPTS="--dev"

# JRuby/TruffleRuby: https://github.com/jruby/jruby/issues/5661

#build --action_env=HOME
#test --test_env=HOME

# Expose necessary variables for Selenium-Manager.

test:windows --test_env=LOCALAPPDATA
Expand All @@ -97,77 +100,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"

# The RBE to use
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation
build:remote --bes_backend=grpcs://gypsum.cluster.engflow.com
build:remote --remote_executor=grpcs://gypsum.cluster.engflow.com
build:remote --remote_cache=grpcs://gypsum.cluster.engflow.com

# The number of cores available
build:remote -j 50

# Build Without The Bytes
build:remote --remote_download_minimal

build:remote --define=EXECUTOR=remote
build:remote --experimental_inmemory_dotd_files
build:remote --experimental_inmemory_jdeps_files
build:remote --remote_timeout=3600
build:remote --spawn_strategy=remote,local
#build:remote --nolegacy_important_outputs
build:remote --incompatible_strict_action_env=true

build:remote --crosstool_top=//common/remote-build/cc:toolchain
build:remote --extra_execution_platforms=//common/remote-build:platform
build:remote --extra_toolchains=//common/remote-build:cc-toolchain
build:remote --host_platform=//common/remote-build:platform
build:remote --platforms=//common/remote-build:platform

# The Docker images are running Linux
build:remote --cpu=k8
build:remote --host_cpu=k8

build:remote --disk_cache=

build:remote --incompatible_enable_cc_toolchain_resolution
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
test:remote --test_env=DISPLAY=:99.0
test:remote --test_tag_filters=-skip-remote,-remote

# Env vars we can hard code
build:remote --action_env=HOME=/home/dev
build:remote --action_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=HOME=/home/dev
test --test_env=SE_AVOID_STATS=true

# Make sure we sniff credentials properly
build:remote --credential_helper=%workspace%/scripts/credential-helper.sh

# Use pinned browsers when running remotely
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_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

# Wait for up to 5 minutes for a test to pass
test:remote --test_timeout=600

# Extend the remote config for CI
build:remote-ci --config=remote
build:remote-ci --curses=no --color=yes --show_timestamps --show_progress_rate_limit=5
build:remote-ci --bes_upload_mode=wait_for_upload_complete

# Configuration changes suggested by EngFlow
build:remote --grpc_keepalive_time=30s
build:remote --nolegacy_important_outputs

build:release --config=remote
build:release --stamp
build:release --remote_download_outputs=toplevel
70 changes: 70 additions & 0 deletions .bazelrc.remote
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# The RBE to use
build:remote --bes_results_url=https://gypsum.cluster.engflow.com/invocation
build:remote --bes_backend=grpcs://gypsum.cluster.engflow.com
build:remote --remote_executor=grpcs://gypsum.cluster.engflow.com
build:remote --remote_cache=grpcs://gypsum.cluster.engflow.com

# The number of cores available
build:remote -j 50

# Build Without The Bytes
build:remote --remote_download_minimal

build:remote --define=EXECUTOR=remote
build:remote --experimental_inmemory_dotd_files
build:remote --experimental_inmemory_jdeps_files
build:remote --remote_timeout=3600
build:remote --spawn_strategy=remote,local
#build:remote --nolegacy_important_outputs
build:remote --incompatible_strict_action_env=true

build:remote --crosstool_top=//common/remote-build/cc:toolchain
build:remote --extra_execution_platforms=//common/remote-build:platform
build:remote --extra_toolchains=//common/remote-build:cc-toolchain
build:remote --host_platform=//common/remote-build:platform
build:remote --platforms=//common/remote-build:platform
build:remote --cxxopt=-std=c++14

# The Docker images are running Linux
build:remote --cpu=k8
build:remote --host_cpu=k8

build:remote --disk_cache=

build:remote --incompatible_enable_cc_toolchain_resolution
build:remote --action_env=BAZEL_DO_NOT_DETECT_CPP_TOOLCHAIN=1
test:remote --test_env=DISPLAY=:99.0
test:remote --test_tag_filters=-skip-remote,-remote

# Env vars we can hard code
build:remote --action_env=HOME=/home/dev
build:remote --action_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=PATH=/bin:/usr/bin:/usr/local/bin
test:remote --test_env=HOME=/home/dev

# Make sure we sniff credentials properly
build:remote --credential_helper=%workspace%/scripts/credential-helper.sh

# Use pinned browsers when running remotely
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_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

# Wait for up to 5 minutes for a test to pass
test:remote --test_timeout=600

# Extend the remote config for CI
build:remote-ci --config=remote
build:remote-ci --curses=no --color=yes --show_timestamps --show_progress_rate_limit=5
build:remote-ci --bes_upload_mode=wait_for_upload_complete

# Configuration changes suggested by EngFlow
build:remote --grpc_keepalive_time=30s
build:remote --nolegacy_important_outputs
5 changes: 2 additions & 3 deletions .github/workflows/bazel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,14 +109,13 @@ jobs:
with:
bazelisk-cache: true
bazelrc: common --color=yes
cache-version: 2
disk-cache: ${{ inputs.cache-key }}
external-cache: |
name: ${{ inputs.cache-key }}
manifest:
crates: rust/Cargo.Bazel.lock
npm: package-lock.json
pypi__pip: py/requirements_lock.txt
ruby: ${{ inputs.os == 'windows' && 'false' || 'rb/.ruby-version' }}
rules_ruby~~ruby~ruby: ${{ inputs.os == 'windows' && 'false' || 'rb/.ruby-version' }}
repository-cache: true
- name: Setup Bazel without caching
if: inputs.caching == false
Expand Down
11 changes: 10 additions & 1 deletion .github/workflows/ci-java.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ jobs:
os: ${{ matrix.os }}
browser: chrome
cache-key: java-${{ matrix.os }}-tests
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest `
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest `
Expand All @@ -39,10 +42,13 @@ jobs:
os: ${{ matrix.os }}
browser: chrome
cache-key: java-${{ matrix.os }}-tests
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote \
//java/test/org/openqa/selenium/federatedcredentialmanagement:FederatedCredentialManagementTest \
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest \
//java/test/org/openqa/selenium/firefox:FirefoxDriverBuilderTest \
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest \
//java/test/org/openqa/selenium/remote:RemoteWebDriverBuilderTest \
//java/test/org/openqa/selenium/grid/router:RemoteWebDriverDownloadTest
Expand All @@ -60,5 +66,8 @@ jobs:
os: ${{ matrix.os }}
browser: chrome
cache-key: java-${{ matrix.os }}-remote-tests
# rules_jvm_external is not fully hermetic
# https://github.com/bazelbuild/rules_jvm_external/issues/1046
java-version: 17
run: |
bazel test --flaky_test_attempts 3 //java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,12 @@ jobs:
uses: bazel-contrib/setup-bazel@0.8.1
with:
bazelisk-cache: true
cache-version: 2
external-cache: |
name: ci-check
manifest:
crates: rust/Cargo.Bazel.lock
npm: package-lock.json
pypi__pip: py/requirements_lock.txt
ruby: rb/.ruby-version
rules_ruby~~ruby~ruby: rb/.ruby-version
repository-cache: true
- name: Check Bazel targets
id: check-targets
Expand Down
2 changes: 2 additions & 0 deletions .skipped-tests
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-//dotnet/test/common:NetworkInterceptionTests-chrome
-//dotnet/test/common:NetworkInterceptionTests-edge
-//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest
-//java/test/org/openqa/selenium/chrome:ChromeDriverFunctionalTest-remote
-//java/test/org/openqa/selenium/edge:EdgeDriverFunctionalTest
Expand Down
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@aspect_rules_js//npm:defs.bzl", "npm_link_package")
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
load("@buildifier_prebuilt//:rules.bzl", "buildifier")
load("@npm//:defs.bzl", "npm_link_all_packages")
load("//common:browsers.bzl", "chrome_data", "firefox_data")
load("//java:browsers.bzl", "chrome_jvm_flags", "firefox_jvm_flags")
Expand Down
Loading
Loading