Building reviewers plugin

100 views
Skip to first unread message

Markus Mayer

unread,
Nov 19, 2024, 2:06:48 AM11/19/24
to Repo and Gerrit Discussion
Hi all,

I am attempting to build the reviewers plugin. Both Gerrit and reviewers are at the latest commit from the official repos.

When I try to build the plugin, it fails with many, many SHA mismatches of the various components it is downloading during the build. How is this possible? What am I doing wrong?

There are countless "expected <SHA>; received <SHA>" lines. Even if I start updating the SHAs, there's always the next component whose SHA is also wrong. IOW, the build continues to fail. Clearly, this is not how this is supposed to work.

$ git remote -v
origin https://gerrit.googlesource.com/gerrit/ (fetch)
origin https://gerrit.googlesource.com/gerrit/ (push)
$ git log | head
commit 1f6b9050388d72f4a2634ef1ddc64984d580baae
Merge: d5839a612576 c54ec3e5821b
Author: Ben Rohlfs <bro...@google.com>
Date:   Mon Nov 18 12:36:26 2024 +0000

    Merge "Rename safevalues/dom functions"

$ git --git-dir=plugins/reviewers/.git remote -v
origin https://gerrit.googlesource.com/plugins/reviewers (fetch)
origin https://gerrit.googlesource.com/plugins/reviewers (push)
$ git --git-dir=plugins/reviewers/.git log | head
commit 2304fa19869a40e77ade24e2e0ed543d19dc3bfa
Author: David Åkerman <dav...@axis.com>
Date:   Fri Aug 30 10:31:26 2024 +0200

    Fix problem where users with similiar usernames are suggested

    If you disable an account, accounts with similiar
    usernames will be invited to review instead. This happens
    because account resolver will use fuzzy prefix matching to
    get an account if it can not find one with an exact match.

$ ~/node_modules/.bin/bazelisk
bazel 7.2.1

$ ~/node_modules/.bin/bazelisk build plugins/reviewers:reviewers
INFO: Invocation ID: b1953e22-8a74-4bdf-b49a-602b93c918c7
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=0 --terminal_columns=80
INFO: Reading rc options for 'build' from /storage/builds/gerrit/.bazelrc:
  Inherited 'common' options: --noenable_bzlmod --incompatible_enable_proto_toolchain_resolution
INFO: Reading rc options for 'build' from /storage/builds/gerrit/.bazelrc:
  'build' options: --workspace_status_command=python3 ./tools/workspace_status.py --repository_cache=~/.gerritcodereview/bazel-cache/repository --action_env=PATH --disk_cache=~/.gerritcodereview/bazel-cache/cas --java_language_version=17 --java_runtime_version=remotejdk_17 --tool_java_language_version=17 --tool_java_runtime_version=remotejdk_17 --incompatible_strict_action_env --announce_rc
Computing main repo mapping:
Loading:
Loading: 0 packages loaded
Analyzing: target //plugins/reviewers:reviewers (0 packages loaded, 0 targets configured)
Analyzing: target //plugins/reviewers:reviewers (0 packages loaded, 0 targets configured)
[0 / 1] [Prepa] BazelWorkspaceStatusAction stable-status.txt
INFO: Repository prolog-compiler instantiated at:
  /storage/builds/gerrit/WORKSPACE:87:18: in <toplevel>
  /storage/builds/gerrit/tools/deps.bzl:321:14: in java_dependencies
Repository rule maven_jar defined at:
  /storage/builds/gerrit/tools/bzl/maven_jar.bzl:175:28: in <toplevel>
ERROR: An error occurred during the fetch of repository 'prolog-compiler':
   Traceback (most recent call last):
File "/storage/builds/gerrit/tools/bzl/maven_jar.bzl", line 156, column 13, in _maven_jar_impl
fail("failed %s: %s" % (args, out.stderr))
Error in fail: failed [/usr/bin/python3, /storage/builds/gerrit/tools/download_file.py, "-o", /home/mmayer/.cache/bazel/_bazel_mmayer/01c663b8d574cca4351767c0f41d247f/external/prolog-compiler/jar/prolog-compiler-1.4.4.jar, "-u", "GERRIT:/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar", "-v", "570295026f6aa7b905e423d107cb2e081eecdc04"]: https://gerrit-maven.storage.googleapis.com/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar:
expected 570295026f6aa7b905e423d107cb2e081eecdc04
received e6bc2165b5a65f19cb0aa20131fa25449d288631

ERROR: no such package '@@prolog-compiler//jar': failed [/usr/bin/python3, /storage/builds/gerrit/tools/download_file.py, "-o", /home/mmayer/.cache/bazel/_bazel_mmayer/01c663b8d574cca4351767c0f41d247f/external/prolog-compiler/jar/prolog-compiler-1.4.4.jar, "-u", "GERRIT:/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar", "-v", "570295026f6aa7b905e423d107cb2e081eecdc04"]: https://gerrit-maven.storage.googleapis.com/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar:
expected 570295026f6aa7b905e423d107cb2e081eecdc04
received e6bc2165b5a65f19cb0aa20131fa25449d288631

ERROR: /storage/builds/gerrit/lib/prolog/BUILD:17:13: //lib/prolog:compiler depends on @@prolog-compiler//jar:jar in repository @@prolog-compiler which failed to fetch. no such package '@@prolog-compiler//jar': failed [/usr/bin/python3, /storage/builds/gerrit/tools/download_file.py, "-o", /home/mmayer/.cache/bazel/_bazel_mmayer/01c663b8d574cca4351767c0f41d247f/external/prolog-compiler/jar/prolog-compiler-1.4.4.jar, "-u", "GERRIT:/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar", "-v", "570295026f6aa7b905e423d107cb2e081eecdc04"]: https://gerrit-maven.storage.googleapis.com/com/googlecode/prolog-cafe/prolog-compiler/1.4.4/prolog-compiler-1.4.4.jar:
expected 570295026f6aa7b905e423d107cb2e081eecdc04
received e6bc2165b5a65f19cb0aa20131fa25449d288631

ERROR: Analysis of target '//plugins/reviewers:reviewers' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.605s, Critical Path: 0.38s
INFO: 1 process: 1 internal.
ERROR: Build did NOT complete successfully
FAILED:

Thanks,
-Markus

Daniele Sassoli

unread,
Nov 19, 2024, 5:18:41 PM11/19/24
to Repo and Gerrit Discussion
Hi

Probably not what you're after but wanted to inform you that I've tried to build this myself and seems to work. I seem to have the same version of bazel too.
Can't spot anything that you're doing that looks wrong though.

Thanks,
-Markus

Matthias Sohn

unread,
Nov 20, 2024, 4:10:09 AM11/20/24
to Markus Mayer, Repo and Gerrit Discussion
This works for me:
  • clone the gerrit core repo including its submodules 
    $ git clone --recurse-submodules "https://gerrit.googlesource.com/gerrit"
  • clone the plugin
    $ git clone "https://gerrit.googlesource.com/plugins/reviewers"
  • symlink the plugin into the plugins folder of the gerrit core source tree
    $ cd gerrit/plugins/
    $ ln -s ../../reviewers/
  • edit tools/bzl/plugins.bzl and add the reviewers plugin as a custom plugin
    CUSTOM_PLUGINS = [
    # Add custom core plugins here
    "reviewers",
    ]
  • from the root of the Gerrit core repo build the war file with reviewers plugin included:
    $ cd ..
    $ bazelisk build release
    or just the plugin
    $ bazelisk build plugins/reviewers
    test the plugin
    $ bazelisk test plugins/reviewers/...

-Matthias
 

--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/3b2a3182-4aae-4156-b49f-d88b142d767an%40googlegroups.com.

Sven Selberg

unread,
Nov 22, 2024, 2:36:52 AM11/22/24
to Repo and Gerrit Discussion
These errors are not from building the reviewers plugin (the reviewers plugin has no dependency to prolog).
These errors are from building Gerrit (Gerrit's api is a dependency of the reviewers plugin)
You should get the same errors when building Gerrit.

It could possibly be a transient environment error where maven.storage.googleapis.com actually respond with the erroneous artifact?
Reply all
Reply to author
Forward
0 new messages