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
8 files changed
tree: 2272707b3f296185e83ec74012574b15cee4af82
  1. .github/
  2. .settings/
  3. .ts-out/
  4. antlr3/
  5. contrib/
  6. Documentation/
  7. e2e-tests/
  8. java/
  9. javatests/
  10. lib/
  11. modules/
  12. plugins/
  13. polygerrit-ui/
  14. prolog/
  15. prologtests/
  16. proto/
  17. resources/
  18. tools/
  19. webapp/
  20. .bazelignore
  21. .bazelproject
  22. .bazelrc
  23. .bazelversion
  24. .editorconfig
  25. .git-blame-ignore-revs
  26. .gitignore
  27. .gitmodules
  28. .gitreview
  29. .mailmap
  30. .pydevproject
  31. .zuul.yaml
  32. BUILD
  33. COPYING
  34. external_deps.lock.json
  35. GEMINI.md
  36. INSTALL
  37. Jenkinsfile
  38. MODULE.bazel
  39. MODULE.bazel.lock
  40. package.json
  41. README.md
  42. SUBMITTING_PATCHES
  43. web-dev-server.config.mjs
  44. WORKSPACE.bzlmod
  45. yarn.lock
README.md

Gerrit Code Review

Gerrit is a code review and project management tool for Git based projects.

Build Status Maven Central

Objective

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.

Documentation

For information about how to install and use Gerrit, refer to the documentation.

Source

Our canonical Git repository is located on googlesource.com. There is a mirror of the repository on Github.

Reporting bugs

Please report bugs on the issue tracker.

Contribute

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.

Getting in contact

The Developer Mailing list is repo-discuss on Google Groups.

License

Gerrit is provided under the Apache License 2.0.

Build

Install Bazel and run the following:

    git clone --recurse-submodules https://gerrit.googlesource.com/gerrit
    cd gerrit && bazel build release

Install binary packages (Deb/Rpm)

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>]

Use pre-built Gerrit images on Docker

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.