Bazel: Bump to 8.6.0
Update Bazel version from 7.6.1 to 8.6.0.
This requires a few follow-up adjustments:
* Re-enable WORKSPACE support
Bazel 8 disables WORKSPACE by default. Gerrit still relies on
WORKSPACE.bzlmod for parts of the frontend (PolyGerrit) build
toolchain (e.g. rules_nodejs / npm setup), so
--enable_workspace is added back until the migration to pure
bzlmod is complete.
* Update MODULE.bazel.lock
The Bazel version bump requires regenerating MODULE.bazel.lock
to keep dependency resolution consistent with Bazel 8.
* Exclude duplicate protobuf runtime jars from WAR packaging
With Bazel 8, java_proto_library() exposes protobuf runtime jars
from @protobuf//java/core as transitive runtime dependencies.
This causes libcore.jar and liblite_runtime_only.jar to be
included in WEB-INF/lib.
Gerrit already packages the protobuf-java Maven artifact, and
these jars duplicate the same classes (confirmed via class-level
comparison). Exclude them during WAR packaging to avoid
duplication and keep the runtime classpath stable.
* Fix PolyGerrit web_test_runner under Bazel runfiles
Bazel 8 changes the runfiles layout for external repositories.
npm dependencies are no longer available under
_main/external/<repo>, but instead as siblings of _main in the
runfiles tree.
The Web Test Runner configuration was still resolving node_modules
relative to process.cwd() (which points to _main), resulting in
invalid paths such as:
_main/external/ui_dev_npm/node_modules
This caused module resolution failures in tests, e.g.
"@open-wc/testing" could not be imported.
Fix this by resolving modulePaths relative to the runfiles root
(parent of _main), so that external repositories like
ui_dev_npm, ui_npm and plugins_npm are correctly located.
* Forward test arguments in web_test_runner.sh
The wrapper script previously ignored additional arguments passed
via --test_arg, which prevented passing flags such as
--test-files or --ts-config to the Web Test Runner.
Forward all additional arguments to restore expected behavior, e.g.:
bazel test //polygerrit-ui:web_test_runner --test_output=streamed \
--test_arg=--test-files=polygerrit-ui/app/services/label-suggestions-provider_test.ts
* Fix Prolog tests under Bazel runfiles
Bazel 8 changes the runfiles layout for external repositories, so Java
toolchain paths such as external/<repo> no longer resolve under
_main/external.
Normalize these paths in run.sh relative to TEST_SRCDIR and resolve
Java home paths to the Java binary.
No functional Java changes are introduced; this is a build system
upgrade with minor packaging adjustments.
Bug: Issue 365461928
Release-Notes: Update Bazel version to 8.6.0
Change-Id: Id8ab3fe68a60e9a4e5951021230ca3d43205891b
Gerrit is a code review and project management tool for Git based projects.
Gerrit makes reviews easier by showing changes in a side-by-side display, and allowing inline comments to be added by any reviewer.
Gerrit simplifies Git based project maintainership by permitting any authorized user to submit changes to the master Git repository, rather than requiring all approved changes to be merged in by hand by the project maintainer.
For information about how to install and use Gerrit, refer to the documentation.
Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.
Please report bugs on the issue tracker.
Gerrit is the work of hundreds of contributors. We appreciate your help!
Please read the contribution guidelines.
Note that we do not accept Pull Requests via the Github mirror.
The Developer Mailing list is repo-discuss on Google Groups.
Gerrit is provided under the Apache License 2.0.
Install Bazel and run the following:
git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
cd gerrit && bazel build release
The instruction how to configure GerritForge/BinTray repositories is here
On Debian/Ubuntu run:
apt-get update && apt-get install gerrit=<version>-<release>
NOTE: release is a counter that starts with 1 and indicates the number of packages that have been released with the same version of the software.
On CentOS/RedHat run:
yum clean all && yum install gerrit-<version>[-<release>]
On Fedora run:
dnf clean all && dnf install gerrit-<version>[-<release>]
Docker images of Gerrit are available on DockerHub
To run a CentOS 8 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-centos8
To run a Ubuntu 20.04 based Gerrit image:
docker run -p 8080:8080 gerritcodereview/gerrit[:version]-ubuntu20
NOTE: release is optional. Last released package of the version is installed if the release number is omitted.