Since last week I can't build Gerrit from sources, I've tired building
2.14, 2.15 and current master and always got the same issue:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
javax/annotation/Generated (full bazel out attached).
Am Dienstag, 19. Juni 2018 12:20:29 UTC+2 schrieb Dariusz Łuksza:Since last week I can't build Gerrit from sources, I've tired building
2.14, 2.15 and current master and always got the same issue:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
javax/annotation/Generated (full bazel out attached).
This seems to be Java 9 related. Particularly, see this Dagger
issue: [1] and my comment: [2] with the link to exactly the same
stack trace that you are seeing: [3].
My impression was, that the last released rules_closure already includes
the right Dagger version, though. We have switched from the forked
version: [4] to the vanilla upstream rules_closure version recently: [5].
Since last week I can't build Gerrit from sources, I've tired building
2.14, 2.15 and current master and always got the same issue:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
javax/annotation/Generated (full bazel out attached).
I've did tried running `bazel clean --expunge` and removing
~/.gerritcodereview/bazel-cache/, none of it helped.
The same issue occurs for `bazel build gerrit` and `bazel build release`.
openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
On Tuesday, June 19, 2018 at 4:20:29 AM UTC-6, Dariusz Łuksza wrote:Since last week I can't build Gerrit from sources, I've tired building
2.14, 2.15 and current master and always got the same issue:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
javax/annotation/Generated (full bazel out attached).
I've did tried running `bazel clean --expunge` and removing
~/.gerritcodereview/bazel-cache/, none of it helped.
The same issue occurs for `bazel build gerrit` and `bazel build release`.
I am currently facing this same problem with java 8.Here is my java setup:
java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
echo $PATH
/usr2/mfick/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/electriccloud/electriccommander/bin
Any thoughts? Does it maybe only work with earlier versions of java 8?
Thanks,
-Martinopenjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)java -version openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)openjdk version "1.8.0_181" OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13) OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
--
--
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.
From: Nasser Grainawi <nas...@codeaurora.org>
Sent: Wednesday, September 12, 2018 3:13 PM
To: Martin Fick <mf...@codeaurora.org>
Cc: Repo and Gerrit Discussion <repo-d...@googlegroups.com>
Subject: Re: Can't build Gerrit from sources: NoClassDefFoundError javax/annotation/Generated
On Sep 12, 2018, at 2:47 PM, MartinFick <mf...@codeaurora.org> wrote:
On Tuesday, June 19, 2018 at 4:20:29 AM UTC-6, Dariusz Łuksza wrote:
Since last week I can't build Gerrit from sources, I've tired building
2.14, 2.15 and current master and always got the same issue:
java.lang.RuntimeException: java.lang.NoClassDefFoundError:
javax/annotation/Generated (full bazel out attached).
I've did tried running `bazel clean --expunge` and removing
~/.gerritcodereview/bazel-cache/, none of it helped.
The same issue occurs for `bazel build gerrit` and `bazel build release`.
I am currently facing this same problem with java 8.
Here is my java setup:
java -version
openjdk version "1.8.0_181"
OpenJDK Runtime Environment (build 1.8.0_181-8u181-b13-0ubuntu0.16.04.1-b13)
OpenJDK 64-Bit Server VM (build 25.181-b13, mixed mode)
echo $JAVA_HOME
/usr/lib/jvm/java-8-openjdk-amd64
echo $ATH
/usr2/mfick/bin:/usr/lib/jvm/java-8-openjdk-amd64/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/opt/electriccloud/electriccommander/bin
Any thoughts? Does it maybe only work with earlier versions of java 8?
Is your bazel version the latest?
bazel version
Build label: 0.16.1
Build target: bazel-out/k8-opt/bin/src/main/java/com/google/devtools/build/lib/bazel/BazelServer_deploy.jar
Build time: Mon Aug 13 13:43:36 2018 (1534167816)
Build timestamp: 1534167816
Build timestamp as int: 1534167816
Thanks,
-Martin
From: repo-d...@googlegroups.com <repo-d...@googlegroups.com> On Behalf Of David Ostrovsky
Sent: Thursday, September 13, 2018 1:02 AM
To: Repo and Gerrit Discussion <repo-d...@googlegroups.com>
Sorry, I am trying to build v2.15,
-Martin
-Martin
With buck this was easy because part of the installation process was to clone the buck source code, and when using it to build gerrit it would rebuild itself at the correct revision if necessary.As far as I know there is no similar easy way to switch between bazel versions.
pipeline {
agent {
docker {
image 'registry.domain.tld/bazel:0.16.1'
// snip, lots of options
}
}
stages {
// snip
}
}
On 14 Sep 2018, at 11:18, Gert van Dijk <gert...@gmail.com> wrote:On Friday, 14 September 2018 11:33:25 UTC+2, David Pursehouse wrote:With buck this was easy because part of the installation process was to clone the buck source code, and when using it to build gerrit it would rebuild itself at the correct revision if necessary.As far as I know there is no similar easy way to switch between bazel versions.Conceptually speaking, versioning your build tooling together with the sources, is also what I like to do.Bazel seems not really ready for use in long-term stable branches or support for building older tags, so especially for this tooling I think it's even more important. Changes in Bazel are done frequently and only sometimes with warnings, including complete utter nonsense behavior - one of them has been here on the mailing list - with very opinionated (point) release policy. Okay I'll stop my rant here.Specifically for Jenkins, what I do for projects I run (privately/company), is making it part of the (declarative) Jenkinsfile in each repository. The Docker image is versioned to indicate what was used in CI at the time this commit was passed. This can be considered purely informative for people building locally.
pipeline {
agent {
docker {
image 'registry.domain.tld/bazel:0.16.1'
// snip, lots of options
}
}
stages {
// snip
}
}
(Or, alternatively, build the Docker image used, from a Dockerfile.jenkins in the repository with other agent syntax, so you can manage other tooling as well like code style checkers, separately.)
It would not really address the bisect issue, as you would have to manually switch build tooling.
I guess that's the price to pay for a build tool that's not really mature yet (no offence, I think I like Bazel conceptually).Alternatives I can think of are on a path you don't want to go, e.g. wrapper script running a specific bazel version.Do, however, realize that this could also turn into an anti-feature. If, for some reason, in the future, a certain <buildtool> <version> doesn't run on <OS> anymore and you could safely upgrade to a new release for building those sources, you will be unnecessarily blocked by that logic.(FWIW, I *just* see a 0.17.1 tag being pushed a minute ago.)
(Or, alternatively, build the Docker image used, from a Dockerfile.jenkins in the repository with other agent syntax, so you can manage other tooling as well like code style checkers, separately.)We could also NOT install Bazel in the build of the Docker image and, instead, install the right version of Bazel just before starting the build.
[...]
agent {
dockerfile {
filename 'Dockerfile.jenkins'
additionalBuildArgs '--pull'
}
}
[...]
FROM registry.domain.tld/ci-image-with-almost-everything:version
RUN ... # install <tool> version a.b.c.
RUN ... # install Bazel version x.y.z.
It would not really address the bisect issue, as you would have to manually switch build tooling.If we take the approach of getting the version from Gerrit source, we could will install the "right version" for each run of the bisec operation.
"Meh." But yeah, you could do that...