Bazel build failed for Gerrit master

206 views
Skip to first unread message

lucamilanesio

unread,
Oct 17, 2016, 10:23:57 AM10/17/16
to Repo and Gerrit Discussion
Hi Gerrit Contributors,
we do have now the Bazel build for Gerrit master on our CI ... but unfortunately fails, see last failover on [1].

It seems that it fails to verify the SHA1 of crisper-2.0.2 whilst downloading from Internet:

00:04:52.766 ____Loading package: @bazel_tools//tools/test
00:04:53.843 ERROR: /home/jenkins/workspace/Gerrit-master-bazel/polygerrit-ui/app/BUILD:32:1: every rule of type _vulcanize_rule implicitly depends upon the target '@crisper//:cri...@2.0.2.npm_binary.tgz', but this target could not be found because of: no such package '@crisper//': failed [/usr/bin/python, /home/jenkins/workspace/Gerrit-master-bazel/tools/download_file.py, "-o", /home/jenkins/.cache/bazel/_bazel_jenkins/d6587ecb0efd8ed00f5e4c3a1f8fde87/external/crisper/cri...@2.0.2.npm_binary.tgz, "-u", "http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz", "-v", "7183c58cea33632fb036c91cefd1b43e390d22a2"]: Download http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz
00:04:53.850 http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz:
00:04:53.870 expected 7183c58cea33632fb036c91cefd1b43e390d22a2
00:04:53.906 received 188a7da3d00dcf0c64eff7f253d23dacffba7197

Is there a way to "bake" the package download in the slave?
Where to put the right SHA1 to download / check?

Luca.


lucamilanesio

unread,
Oct 19, 2016, 6:53:01 PM10/19/16
to Repo and Gerrit Discussion
I fixed this morning the crisper + vulcanizer parts of the Bazel build and we made a small step forward :-)

Now the build fails for a completely different reason:
00:05:04.097 gerrit-reviewdb/src/test/java/com/google/gerrit/reviewdb/client/PatchSetTest.java:68: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
00:05:04.103     assertThat(splitGroups("")).containsExactly("");
00:05:04.109                                                ^
00:05:04.113      Please report this at https://github.com/google/error-prone/issues/new and include the following:
00:05:04.117   
00:05:04.117      error-prone version: 2.0.9-SNAPSHOT
00:05:04.121      Stack Trace:
00:05:04.128      com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found

Have you forgotten to include any dependency anywhere?
Is there any Bazel build expert around? :-)

Luca.

On Monday, October 17, 2016 at 3:23:57 PM UTC+1, lucamilanesio wrote:
Hi Gerrit Contributors,
we do have now the Bazel build for Gerrit master on our CI ... but unfortunately fails, see last failover on [1].

It seems that it fails to verify the SHA1 of crisper-2.0.2 whilst downloading from Internet:

00:04:52.766 ____Loading package: @bazel_tools//tools/test
00:04:53.843 ERROR: /home/jenkins/workspace/Gerrit-master-bazel/polygerrit-ui/app/BUILD:32:1: every rule of type _vulcanize_rule implicitly depends upon the target '@crisper//:cri...@2.0.2.npm_binary.tgz', but this target could not be found because of: no such package '@crisper//': failed [/usr/bin/python, /home/jenkins/workspace/Gerrit-master-bazel/tools/download_file.py, "-o", /home/jenkins/.cache/bazel/_bazel_jenkins/d6587ecb0efd8ed00f5e4c3a1f8fde87/external/crisper/crisper@2.0.2.npm_binary.tgz, "-u", "http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz", "-v", "7183c58cea33632fb036c91cefd1b43e390d22a2"]: Download http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz
00:04:53.850 http://registry.npmjs.org/crisper/-/crisper-2.0.2.tgz:
00:04:53.870 expected 7183c58cea33632fb036c91cefd1b43e390d22a2
00:04:53.906 received 188a7da3d00dcf0c64eff7f253d23dacffba7197

David Ostrovsky

unread,
Oct 20, 2016, 2:11:23 AM10/20/16
to Repo and Gerrit Discussion

On Thursday, October 20, 2016 at 12:53:01 AM UTC+2, lucamilanesio wrote:
I fixed this morning the crisper + vulcanizer parts of the Bazel build and we made a small step forward :-)

Now the build fails for a completely different reason:
00:05:04.097 gerrit-reviewdb/src/test/java/com/google/gerrit/reviewdb/client/PatchSetTest.java:68: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
00:05:04.103     assertThat(splitGroups("")).containsExactly("");
00:05:04.109                                                ^
00:05:04.113      Please report this at https://github.com/google/error-prone/issues/new and include the following:
00:05:04.117   
00:05:04.117      error-prone version: 2.0.9-SNAPSHOT
00:05:04.121      Stack Trace:
00:05:04.128      com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found

I also see this porblem on Bazel 0.3.1. This is a known issue in error
prone library that was fixed upstream: [1]. Updating bazel version to
0.3.2 fixed that: [2].

$ bazel version
Build label: 0.3.2

$ bazel build //gerrit-reviewdb:client_tests --verbose_failures 
INFO: Found 1 target...
Target //gerrit-reviewdb:client_tests up-to-date:
  bazel-bin/gerrit-reviewdb/client_tests.jar
  bazel-bin/gerrit-reviewdb/client_tests
INFO: Elapsed time: 5.052s, Critical Path: 1.83s

Note that after the upgrade I'm seeing these warnings: [3], that we shoudl fix:

WARNING: /home/davido/projects/gerrit/tools/bzl/asciidoc.bzl:126:13: Argument `cfg = "host"` or `cfg = "data"` is required if `executable = True` is provided for a label.
[...]

David Ostrovsky

unread,
Oct 20, 2016, 3:00:44 AM10/20/16
to Repo and Gerrit Discussion

On Thursday, October 20, 2016 at 8:11:23 AM UTC+2, David Ostrovsky wrote:

On Thursday, October 20, 2016 at 12:53:01 AM UTC+2, lucamilanesio wrote:
I fixed this morning the crisper + vulcanizer parts of the Bazel build and we made a small step forward :-)

Now the build fails for a completely different reason:
00:05:04.097 gerrit-reviewdb/src/test/java/com/google/gerrit/reviewdb/client/PatchSetTest.java:68: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
00:05:04.103     assertThat(splitGroups("")).containsExactly("");
00:05:04.109                                                ^
00:05:04.113      Please report this at https://github.com/google/error-prone/issues/new and include the following:
00:05:04.117   
00:05:04.117      error-prone version: 2.0.9-SNAPSHOT
00:05:04.121      Stack Trace:
00:05:04.128      com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found

I also see this porblem on Bazel 0.3.1. This is a known issue in error
prone library that was fixed upstream: [1]. Updating bazel version to
0.3.2 fixed that: [2].

$ bazel version
Build label: 0.3.2

$ bazel build //gerrit-reviewdb:client_tests --verbose_failures 
INFO: Found 1 target...
Target //gerrit-reviewdb:client_tests up-to-date:
  bazel-bin/gerrit-reviewdb/client_tests.jar
  bazel-bin/gerrit-reviewdb/client_tests
INFO: Elapsed time: 5.052s, Critical Path: 1.83s

It turns out there are some path issues after bazel upgrade to 0.3.2,
at least on Linux OS. I've created this issue upstream: [1].

 

Luca Milanesio

unread,
Oct 20, 2016, 3:03:10 AM10/20/16
to David Ostrovsky, Repo and Gerrit Discussion
Oh Yes, I saw that yesterday as I was trying to use the "latest and greatest" Bazel master :-(
Btw: does it work for you locally?

Luca.

--
--
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.
For more options, visit https://groups.google.com/d/optout.

David Ostrovsky

unread,
Oct 20, 2016, 3:14:38 AM10/20/16
to Repo and Gerrit Discussion, david.o...@gmail.com, Damien Martin-guillerez

On Thursday, October 20, 2016 at 9:03:10 AM UTC+2, lucamilanesio wrote:
Oh Yes, I saw that yesterday as I was trying to use the "latest and greatest" Bazel master :-(
Btw: does it work for you locally?

@CC Damien from Bazel team.

Nope, it doesn't. 0.3.1 has now error prone error, and 0.3.2 path issues.

Luca Milanesio

unread,
Oct 20, 2016, 3:17:57 AM10/20/16
to David Ostrovsky, Repo and Gerrit Discussion, Damien Martin-guillerez
I'm relieved then as I am not alone, I felt so helpless last night until midnight :-(

Hope Damien can give us some "light": I can definitely rebuild Bazel from scratch should a patch being provided.
The bazel-slave on our CI is actually just a Docker definition at on the gerrit-ci-scripts project.

Luca.

Luca Milanesio

unread,
Oct 20, 2016, 3:38:51 AM10/20/16
to Damien Martin-guillerez, David Ostrovsky, Repo and Gerrit Discussion
See:

Bazel: 0.3.1 on Ubuntu

Build script:
bazel build gerrit-plugin-api:plugin-api_deploy.jar gerrit-extension-api:extension-api_deploy.jar 
bazel build plugins:core
bazel build release
bazel test gerrit //...

Luca.

On 20 Oct 2016, at 08:29, Damien Martin-guillerez <dmar...@google.com> wrote:

What error did you saw? I actually had difficulty trying to build gerrit yesterday too. David, what was the version of bazel used for the development of gerrit?

We test various project against bazel HEAD too on ci.bazel.io, maybe we should add gerrit to that list (in which case a list of target to build/test would be needed)

Damien Martin-guillerez

unread,
Oct 20, 2016, 3:52:22 AM10/20/16
to Luca Milanesio, repo-d...@googlegroups.com, David Ostrovsky
+Repo and Gerrit Discussion back now I joined :)

On Thu, Oct 20, 2016 at 9:48 AM Damien Martin-guillerez <dmar...@google.com> wrote:
-repo that I cannot reach

Thanks, testing now, I forgot to checkout submodules last time.

David Ostrovsky

unread,
Oct 20, 2016, 4:18:11 AM10/20/16
to Repo and Gerrit Discussion, luca.mi...@gmail.com

Am Donnerstag, 20. Oktober 2016 09:52:22 UTC+2 schrieb Damien Martin-guillerez:
+Repo and Gerrit Discussion back now I joined :)

On Thu, Oct 20, 2016 at 9:48 AM Damien Martin-guillerez <dmar...@google.com> wrote:
-repo that I cannot reach

Thanks, testing now, I forgot to checkout submodules last time.

We used 0.3.1 for development Bazel build. This release seems to have error prone issue.
After upgrading to 0.3.2 we have path issues, probably due to sandboxing support on Linux: [1].


Damien Martin-guillerez

unread,
Oct 20, 2016, 7:41:58 AM10/20/16
to Luca Milanesio, repo-d...@googlegroups.com, David Ostrovsky
So the problem with 0.3.1 comes from error when calling javadoc, are you sure you have all the correct dependencies shiped to the javadoc target?

for 0.3.2, I get a problem because the workspace status info ends up in the stable status because of a2897bf. Fixing it (using the stable, the good fix might just be to use a glob to work for both 0.3.1 and 0.3.2) led me to the same javadoc errors.

Luca Milanesio

unread,
Oct 20, 2016, 7:46:20 AM10/20/16
to Damien Martin-guillerez, repo-d...@googlegroups.com, David Ostrovsky
On 20 Oct 2016, at 12:41, Damien Martin-guillerez <dmar...@google.com> wrote:

So the problem with 0.3.1 comes from error when calling javadoc, are you sure you have all the correct dependencies shiped to the javadoc target?

for 0.3.2, I get a problem because the workspace status info ends up in the stable status because of a2897bf. Fixing it (using the stable, the good fix might just be to use a glob to work for both 0.3.1 and 0.3.2) led me to the same javadoc errors.

What is the javadoc error you have?

Damien Martin-guillerez

unread,
Oct 20, 2016, 7:46:58 AM10/20/16
to Luca Milanesio, repo-d...@googlegroups.com, David Ostrovsky

     ^

bazel-out/local-fastbuild/bin/gerrit-extension-api/extension-api-javadoc.zip.source/com/google/gerrit/extensions/common/MergeInput.java:28: error: reference not found

   * @see org.eclipse.jgit.merge.MergeStrategy

          ^

bazel-out/local-fastbuild/bin/gerrit-extension-api/extension-api-javadoc.zip.source/com/google/gerrit/extensions/events/GarbageCollectorListener.java:30: error: reference not found

     * @see org.eclipse.jgit.api.GarbageCollectCommand#call()

            ^

David Ostrovsky

unread,
Oct 20, 2016, 7:50:54 AM10/20/16
to Repo and Gerrit Discussion, luca.mi...@gmail.com, david.o...@gmail.com

Am Donnerstag, 20. Oktober 2016 13:41:58 UTC+2 schrieb Damien Martin-guillerez:
So the problem with 0.3.1 comes from error when calling javadoc, are you sure you have all the correct dependencies shiped to the javadoc target?

Actually 0.3.1  was failing for me while compiling this rule:

$ bazel build //gerrit-reviewdb:client_tests


Can you see previous messages in this thread?


00:05:04.097 gerrit-reviewdb/src/test/java/com/google/gerrit/reviewdb/client/PatchSetTest.java:68: error: An unhandled exception was thrown by the Error Prone static analysis plugin.
00:05:04.103     assertThat(splitGroups("")).containsExactly("");
00:05:04.109                                                ^
00:05:04.113      Please report this at https://github.com/google/error-prone/issues/new and include the following:
00:05:04.117   
00:05:04.117      error-prone version: 2.0.9-SNAPSHOT
00:05:04.121      Stack Trace:
00:05:04.128      com.sun.tools.javac.code.Symbol$CompletionFailure: class file for com.google.errorprone.annotations.CanIgnoreReturnValue not found

 Which I think is related to: [1].

* [1] https://github.com/google/error-prone/issues/461

Luca Milanesio

unread,
Oct 20, 2016, 7:51:31 AM10/20/16
to Damien Martin-guillerez, repo-d...@googlegroups.com, David Ostrovsky
Oh yes, they are outside the Gerrit project as they belong to JGit.
Why is this a severe error for failing the Bazel build? Is there an option to just not treating as an error?

Luca.

David Pursehouse

unread,
Oct 20, 2016, 8:23:37 AM10/20/16
to Damien Martin-guillerez, Luca Milanesio, repo-d...@googlegroups.com, David Ostrovsky
external javadoc references for jgit were fixed for the buck build in [1] and [2].  Do we need to do something similar for Bazel?

Damien Martin-guillerez

unread,
Oct 20, 2016, 8:42:50 AM10/20/16
to David Pursehouse, Luca Milanesio, repo-d...@googlegroups.com, David Ostrovsky
The build fails because the javadoc command returns an error code so bazel assume that the command failed.

I would say to update the bzl extension for javadoc the same way the buck one were modified should fix the problem.

David Ostrovsky

unread,
Oct 20, 2016, 8:56:28 AM10/20/16
to Repo and Gerrit Discussion, david.pu...@gmail.com, luca.mi...@gmail.com

Am Donnerstag, 20. Oktober 2016 14:42:50 UTC+2 schrieb Damien Martin-guillerez:
The build fails because the javadoc command returns an error code so bazel assume that the command failed.

I would say to update the bzl extension for javadoc the same way the buck one were modified should fix the problem.

Yes, you are right. But let's forget java_doc issue for a moment. Can you confirm,
that error prone is broken in 0.3.1, and that Bazel has some path issues in 0.3.2,
(where error prone issue was fixed): [1]?


David Ostrovsky

unread,
Oct 20, 2016, 3:39:57 PM10/20/16
to Repo and Gerrit Discussion, david.pu...@gmail.com, luca.mi...@gmail.com, Damien Martin-guillerez
So I extracted the offending target from Gerrit build tool chain
and created a small reproducer repository with only two rules: [2].

So basically one very simple thing is failing now: creating symbolic
link to a previous built target. This regression seems to be related
to extended sandboxing support:

  genrule(
      name = "guava_ln",
      srcs = [":guava"],
      cmd = "ROOT=$$PWD && ln -s $$ROOT/$< $@",
      outs = ["guava.zip"],
  )

 

David Ostrovsky

unread,
Oct 26, 2016, 2:17:03 AM10/26/16
to Repo and Gerrit Discussion, Damien Martin-guillerez, Han-Wen Nienhuys, David Pursehouse

On Monday, October 17, 2016 at 4:23:57 PM UTC+2, lucamilanesio wrote:
Hi Gerrit Contributors,
we do have now the Bazel build for Gerrit master on our CI ... but unfortunately fails, see last failover on [1].

@Luca, With this pending change: [1], all Bazel build issues
are fixed on Bazel 0.3.2. Can you update the CI to use this Bazel
version and activate Bazel build for gerrit-review?

Thanks!

luca.mi...@gmail.com

unread,
Oct 26, 2016, 3:00:07 AM10/26/16
to David Ostrovsky, Repo and Gerrit Discussion, Damien Martin-guillerez, Han-Wen Nienhuys, David Pursehouse
I'll be posting a patch on the gerrit-ci-scripts  project: Bazel slave build is there.

Luca

Sent from my iPhone
--

David Ostrovsky

unread,
Oct 31, 2016, 12:14:10 PM10/31/16
to Repo and Gerrit Discussion, dmar...@google.com, han...@google.com, david.pu...@gmail.com

So, the most recent Bazel build is failing in unit tests, because sandbox site path
is too long on the CI: [1]. Actual 269, max is 255 ;-)

14:18:18 Time: 66.649
14:18:18 There was 1 failure:
14:18:18 1) testUpdate(com.google.gerrit.server.schema.SchemaUpdaterTest)
14:18:18 com.google.gwtorm.server.OrmException: update failure on system_config
14:18:18 	at com.google.gwtorm.schema.sql.SqlDialect.convertError(SqlDialect.java:161)
14:18:18 	at com.google.gwtorm.schema.sql.DialectH2.convertError(DialectH2.java:45)
14:18:19 	at com.google.gwtorm.jdbc.JdbcAccess.convertError(JdbcAccess.java:466)
14:18:19 	at com.google.gwtorm.jdbc.JdbcAccess.update(JdbcAccess.java:230)
14:18:19 	at com.google.gerrit.server.schema.SchemaUpdater.updateSystemConfig(SchemaUpdater.java:143)
14:18:19 	at com.google.gerrit.server.schema.SchemaUpdater.update(SchemaUpdater.java:115)
14:18:19 	at com.google.gerrit.server.schema.SchemaUpdaterTest.testUpdate(SchemaUpdaterTest.java:130)
14:18:19 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
14:18:19 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
14:18:19 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
14:18:19 	at java.lang.reflect.Method.invoke(Method.java:497)
14:18:19 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
14:18:19 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
14:18:19 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
14:18:19 	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
14:18:19 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
14:18:19 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)
14:18:19 	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
14:18:19 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
14:18:19 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
14:18:19 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
14:18:19 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
14:18:19 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
14:18:19 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
14:18:19 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
14:18:19 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
14:18:19 	at org.junit.runners.Suite.runChild(Suite.java:127)
14:18:19 	at org.junit.runners.Suite.runChild(Suite.java:26)
14:18:19 	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
14:18:19 	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
14:18:19 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
14:18:19 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
14:18:19 	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
14:18:19 	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
14:18:19 	at com.google.testing.junit.runner.junit4.CancellableRequestFactory$CancellableRunner.run(CancellableRequestFactory.java:90)
14:18:19 	at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
14:18:19 	at org.junit.runner.JUnitCore.run(JUnitCore.java:138)
14:18:19 	at com.google.testing.junit.runner.junit4.JUnit4Runner.run(JUnit4Runner.java:112)
14:18:19 	at com.google.testing.junit.runner.BazelTestRunner.runTestsInSuite(BazelTestRunner.java:140)
14:18:19 	at com.google.testing.junit.runner.BazelTestRunner.main(BazelTestRunner.java:79)
14:18:19 Caused by: org.h2.jdbc.JdbcBatchUpdateException: Value too long for column "SITE_PATH VARCHAR(255)": "'/home/jenkins/.cache/bazel/_bazel_jenkins/d6587ecb0efd8ed00f5e4c3a1f8fde87/bazel-sandbox/18d3166a-a3f4-4d1f-a91b-3ddab1ad0c62-1... (269)"; SQL statement:
14:18:19 UPDATE system_config SET register_email_private_key=?,site_path=?,admin_group_id=?,anonymous_group_id=?,registered_group_id=?,wild_project_name=?,batch_users_group_id=?,owner_group_id=?,admin_group_uuid=?,batch_users_group_uuid=? WHERE singleton=? [22001-176]

Reply all
Reply to author
Forward
0 new messages