Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle 2.14 compatibility? #18935

Closed
spalger opened this issue Jun 17, 2016 · 17 comments
Closed

Gradle 2.14 compatibility? #18935

spalger opened this issue Jun 17, 2016 · 17 comments
Labels
>bug :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team

Comments

@spalger
Copy link
Contributor

spalger commented Jun 17, 2016

Elasticsearch version: master

JVM version:

java version "1.8.0_77"
Java(TM) SE Runtime Environment (build 1.8.0_77-b03)
Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode)

OS version: OS X 10.11.5

Description of the problem including expected versus actual behavior:
Trying to run gradle build but getting an error instead of build output, console output below. It looks like the org.gradle.logging.progress package was added in 2.14 and moved the org.gradle.logging.ProgressLogger class in the process.

Steps to reproduce:

  1. Install gradle 2.14
  2. Checkout master
  3. Run gradle build

Provide logs (if relevant):

elasticsearch [master] $ gradle build
:buildSrc:clean
:buildSrc:compileJava
:buildSrc:compileGroovy
startup failed:
/Users/spalger/dev/es/elasticsearch/buildSrc/src/main/groovy/com/carrotsearch/gradle/junit4/TestProgressLogger.groovy: 28: unable to resolve class org.gradle.logging.ProgressLogger
 @ line 28, column 1.
   import org.gradle.logging.ProgressLogger
   ^

/Users/spalger/dev/es/elasticsearch/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/TapLoggerOutputStream.groovy: 25: unable to resolve class org.gradle.logging.ProgressLogger
 @ line 25, column 1.
   import org.gradle.logging.ProgressLogger
   ^

/Users/spalger/dev/es/elasticsearch/buildSrc/src/main/groovy/org/elasticsearch/gradle/vagrant/VagrantLoggerOutputStream.groovy: 23: unable to resolve class org.gradle.logging.ProgressLogger
 @ line 23, column 1.
   import org.gradle.logging.ProgressLogger
   ^

3 errors

:buildSrc:compileGroovy FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileGroovy'.
> Compilation failed; see the compiler error output for details.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.056 secs
@spalger
Copy link
Contributor Author

spalger commented Jun 17, 2016

Just confirmed this is not broken in gradle 2.13

@xuzhou2020
Copy link

I have the save question as you when building with gradle

@javanna
Copy link
Member

javanna commented Jun 17, 2016

@javanna javanna added :Delivery/Build Build or test infrastructure >bug v5.0.0-alpha4 labels Jun 17, 2016
@rjernst
Copy link
Member

rjernst commented Jun 18, 2016

This is actually worse than just the class being moved. Apparently they considered the package org.gradle.logging to be "internal", and in 2.14 internal classes are finally not available to plugins (and this class move makes it truly internal). So until they add back ProgressLogger as part of the plugin API, all our nice logging would disappear...

I'm going to add a check for now in BuildPlugin init that the gradle version is equal exactly to 2.13...

@rjernst
Copy link
Member

rjernst commented Jun 18, 2016

Ah and of course this is hard to check for 2.13 because the failure happens inside buildSrc before we even get to check the gradle version...

rjernst added a commit to rjernst/elasticsearch that referenced this issue Jun 18, 2016
@rjernst
Copy link
Member

rjernst commented Jun 18, 2016

I opened #18955 as a stopgap so at least the error message is clear when trying to use 2.14

@jprante
Copy link
Contributor

jprante commented Jun 24, 2016

Due to gradle core developer Adrian Kelly

https://discuss.gradle.org/t/bug-in-gradle-2-14-rc1-no-service-of-type-styledtextoutputfactory/17638/3

there is no big chance that ProgressLogger will be available (again). So my suggestion is to adapt to Gradle 2.14 (including upcoming Gradle 3) as soon as possible by aligning the Elasticsearch build scripts/plugins to the reduced capabilities in https://docs.gradle.org/current/userguide/logging.html

@mfussenegger
Copy link
Contributor

Any chance to reconsider #13744 due to this issue here?
I'm not sure if keeping a 50kb blob out of the repo is worth forcing potential contributors to either downgrade system gradle or start keeping around a bunch of gradle versions that happen to work with ES.

@rjernst
Copy link
Member

rjernst commented Jul 13, 2016

@jprante

there is no big chance that ProgressLogger will be available (again)

That is simply not true. I spoke with developers at gradle during Gradle Summit and they understand that progress logger is important. I expect it to come back, in some form, in the future:
https://discuss.gradle.org/t/can-gradle-team-add-progresslogger-and-progressloggerfactory-to-public-api/18176/6

@mfussenegger

Any chance to reconsider #13744 due to this issue here?

The size is not the issue there. It is that we do not want binary blobs in our repo. I would be ok with a custom equivalent of the gradle wrapper that depended on java 8 and jjs to download the gradle binary, but I have not investigated the real feasibility of such a solution. In the meantime, you don't need to manage "a bunch" of versions, just two, 2.13 and whatever other version you are on. You can add your own gradle wrapper file then that just runs gradle 2.13 wherever it is on your system. I would even be ok with adding this to the gitignore so that you can update the repo without it looking like some outlier file.

@mfussenegger
Copy link
Contributor

It is that we do not want binary blobs in our repo.

Aren't the zip files for bwc testing also binary files?

In the meantime, you don't need to manage "a bunch" of versions, just two, 2.13

I'm probably being a bit too pessimistic here and exaggerating.
Anyway, it's not much of a problem for me personally. Just wanted to bring it up because it definetly is a stepping stone.

@manterfield
Copy link

manterfield commented Oct 3, 2016

I think it would be helpful to add the requirement for Gradle 2.13 to the docs for contribution and to make it more explicit that it is required in the main readme. Currently the readme says:

You’ll need to have a modern version of Gradle installed – 2.13 should do.

Which makes it sound like 2.13 or upwards is fine.

There's no mention of version on the contribution doc.

It's only a small issue and the error message makes it very clear what has gone wrong, but it could save the time of people like me, as I just downloaded the latest version of Gradle purely for the sake of contributing to the project.

I'd be happy to make the change myself since I was after something simple first anyway. Is it precisely version 2.13 that works, or can slightly older Gradle versions work too?

@rjernst
Copy link
Member

rjernst commented Oct 3, 2016

@manterfield Please do make a PR! I agree we should update the readme/contrib doc wording given our current limitation.

@rjernst
Copy link
Member

rjernst commented Oct 3, 2016

And it must be 2.13 at this time.

@manterfield
Copy link

manterfield commented Oct 6, 2016

Thanks @rjernst, made a PR (#20776) with doc updates in.

@ywelsch
Copy link
Contributor

ywelsch commented Jan 19, 2017

Closed by #22669. The docs will be updated once we have moved our builds to use Gradle 3.x and feel comfortable removing support for 2.13.

@ywelsch ywelsch closed this as completed Jan 19, 2017
@ywelsch ywelsch removed the stalled label Jan 19, 2017
@jasontedor jasontedor reopened this Jan 20, 2017
@jasontedor
Copy link
Member

Sorry, this has to be reopened, IntelliJ is unhappy with the change.

@ywelsch
Copy link
Contributor

ywelsch commented Jan 24, 2017

Pushed a fix for IntelliJ.

@ywelsch ywelsch closed this as completed Jan 24, 2017
@mark-vieira mark-vieira added the Team:Delivery Meta label for Delivery team label Nov 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>bug :Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team
Projects
None yet
Development

No branches or pull requests