Build Gerrit with Bazel - get error

676 views
Skip to first unread message

Guy Levkowitz

unread,
May 21, 2024, 7:27:31 AM5/21/24
to Repo and Gerrit Discussion
Hey

I try to build Gerrit with bazel - steps are 
cd gerrit
git checkout --recurse-submodules v3.9.5 
[gerrit@localhost gerrit]$ cat .bazelversion
6.3.2
[gerrit@localhost gerrit]$ bazel --version
bazel 6.3.2
[gerrit@localhost gerrit]$ cat /etc/redhat-release
CentOS Linux release 8.5.2111

[gerrit@localhost gerrit]$ bazel build release
Starting local Bazel server and connecting to it...
INFO: Invocation ID: edc6d381-072f-434f-a533-df86e599de48
INFO: Options provided by the client:
  Inherited 'common' options: --isatty=1 --terminal_columns=90
INFO: Reading rc options for 'build' from /home/gerrit/gerrit395/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
INFO: Repository build_bazel_rules_nodejs instantiated at:
  /home/gerrit/gerrit395/gerrit/WORKSPACE:66:13: in <toplevel>
Repository rule http_archive defined at:
  /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/bazel_tools/tools/build_defs/repo/http.bzl:372:31: in <toplevel>
WARNING: Download from https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz failed: class javax.net.ssl.SSLHandshakeException PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: An error occurred during the fetch of repository 'build_bazel_rules_nodejs':
   Traceback (most recent call last):
File "/home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz] to /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/build_bazel_rules_nodejs/temp3107530155053452099/rules_nodejs-5.8.2.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: /home/gerrit/gerrit395/gerrit/WORKSPACE:66:13: fetching http_archive rule //external:build_bazel_rules_nodejs: Traceback (most recent call last):
File "/home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/bazel_tools/tools/build_defs/repo/http.bzl", line 132, column 45, in _http_archive_impl
download_info = ctx.download_and_extract(
Error in download_and_extract: java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz] to /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/build_bazel_rules_nodejs/temp3107530155053452099/rules_nodejs-5.8.2.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
ERROR: Error computing the main repository mapping: no such package '@build_bazel_rules_nodejs//': java.io.IOException: Error downloading [https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz] to /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/build_bazel_rules_nodejs/temp3107530155053452099/rules_nodejs-5.8.2.tar.gz: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
Loading: 

why ? 

Thanks

Guy 

Luca Milanesio

unread,
May 21, 2024, 9:06:35 AM5/21/24
to Repo and Gerrit Discussion, Luca Milanesio, Guy Levkowitz
Hi Guy,
That looks a PKIX certificate issue.
See [1] a similar thread and how to workaround it.

P.S. My 2c: GitHub may have updated their X.509 certificate on https://github.com/bazelbuild/rules_nodejs/releases/download/5.8.2/rules_nodejs-5.8.2.tar.gz and the new anchor is not present in your system. But that’s just a guess, it may be other things related to X.509 validation.

Luca.


Loading: 

why ? 

Thanks

Guy 

--
--
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 on the web visit https://groups.google.com/d/msgid/repo-discuss/bdcc4722-4241-4071-94ea-b8ea42e59d65n%40googlegroups.com.

Guy Levkowitz

unread,
May 22, 2024, 11:16:44 AM5/22/24
to Repo and Gerrit Discussion
After i fix the Certificate issue - I get this error : 
[gerrit@localhost gerrit]$ java --version
openjdk 17.0.1 2021-10-19 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing

the error from 
bazel build release :


ERROR: /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/commons-compress/jar/BUILD:5:12: Extracting interface @commons-compress//jar:jar failed: (Segmentation fault): ijar failed: error executing command (from target @commons-compress//jar:jar) external/remote_java_tools_linux/java_tools/ijar/ijar external/commons-compress/jar/commons-compress-1.25.0.jar ... (remaining 3 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Target //:release failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/gerrit/gerrit395/gerrit/java/com/google/gerrit/httpd/init/BUILD:3:13 Building java/com/google/gerrit/httpd/init/libinit.jar (4 source files) failed: (Segmentation fault): ijar failed: error executing command (from target @commons-compress//jar:jar) external/remote_java_tools_linux/java_tools/ijar/ijar external/commons-compress/jar/commons-compress-1.25.0.jar ... (remaining 3 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
INFO: Elapsed time: 528.213s, Critical Path: 56.05s
INFO: 596 processes: 13 disk cache hit, 221 internal, 357 linux-sandbox, 5 worker.
FAILED: Build did NOT complete successfully

ב-יום שלישי, 21 במאי 2024 בשעה 16:06:35 UTC+3, Luca Milanesio כתב/ה:

Luca Milanesio

unread,
May 22, 2024, 12:04:02 PM5/22/24
to Repo and Gerrit Discussion, Luca Milanesio, Guy Levkowitz

On 22 May 2024, at 16:16, Guy Levkowitz <sil...@gmail.com> wrote:

After i fix the Certificate issue - I get this error : 
[gerrit@localhost gerrit]$ java --version
openjdk 17.0.1 2021-10-19 LTS
OpenJDK Runtime Environment 21.9 (build 17.0.1+12-LTS)
OpenJDK 64-Bit Server VM 21.9 (build 17.0.1+12-LTS, mixed mode, sharing

the error from 
bazel build release :


ERROR: /home/gerrit/.cache/bazel/_bazel_gerrit/926ed06cbfc0672f7f972d85cccdad37/external/commons-compress/jar/BUILD:5:12: Extracting interface @commons-compress//jar:jar failed: (Segmentation fault): ijar failed: error executing command (from target @commons-compress//jar:jar) external/remote_java_tools_linux/java_tools/ijar/ijar external/commons-compress/jar/commons-compress-1.25.0.jar ... (remaining 3 arguments skipped)

Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
Target //:release failed to build
Use --verbose_failures to see the command lines of failed build steps.
ERROR: /home/gerrit/gerrit395/gerrit/java/com/google/gerrit/httpd/init/BUILD:3:13 Building java/com/google/gerrit/httpd/init/libinit.jar (4 source files) failed: (Segmentation fault): ijar failed: error executing command (from target @commons-compress//jar:jar) external/remote_java_tools_linux/java_tools/ijar/ijar external/commons-compress/jar/commons-compress-1.25.0.jar ... (remaining 3 arguments skipped)

Just Googling around, I found this:

Maybe you should investigate on the Bazel mailing list, where you can find more Bazel-related know-how and info.

HTH

Luca.

David Ostrovsky

unread,
May 22, 2024, 4:31:58 PM5/22/24
to Repo and Gerrit Discussion
Guy Levkowitz schrieb am Dienstag, 21. Mai 2024 um 13:27:31 UTC+2:
Hey

I try to build Gerrit with bazel - steps are 
cd gerrit
git checkout --recurse-submodules v3.9.5 
[gerrit@localhost gerrit]$ cat .bazelversion
6.3.2

You could try to build with Bazel 6.5.0, but also see my other comment.
 
[gerrit@localhost gerrit]$ bazel --version
bazel 6.3.2
[gerrit@localhost gerrit]$ cat /etc/redhat-release
CentOS Linux release 8.5.2111

CentOS 8 was eol on 31.12.2021 and is not supported by Bazel any more.
Consider to upgrade to supported Bazel platform.

Guy Levkowitz

unread,
May 23, 2024, 9:19:14 AM5/23/24
to Repo and Gerrit Discussion
thanks 
it works


ב-יום רביעי, 22 במאי 2024 בשעה 23:31:58 UTC+3, David Ostrovsky כתב/ה:
Reply all
Reply to author
Forward
0 new messages