You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/03/23 15:45:37 UTC

[GitHub] [kafka] vvcephei opened a new pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

vvcephei opened a new pull request #10386:
URL: https://github.com/apache/kafka/pull/10386


   It seems like gradle is inconsistently failing to build the project with the
   message that "compileJava" isn't defined on the root project. Applying the Java
   plugin to the root project (as opposed to only the subprojects) seems to fix it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805463999


   Oh, sorry, I should have been specific.
   
   It's super weird. The symptom looks like list this user's report: https://lists.apache.org/thread.html/rdbf942295aa41f3a4852b46ad0d16144c5a3516a1fe9400921af7137%40%3Cdev.kafka.apache.org%3E
   
   The task works just fine on my local fork of Kafka, 2.8 branch, but while verifying the 2.8.0RC0 I'm trying to publish, I see:
   
   (candidate artifact: https://home.apache.org/~vvcephei/kafka-2.8.0-rc0/kafka-2.8.0-src.tgz)
   
   ```
   [john@arcturus kafka-2.8.0-src]$ ./gradlew clean install
   > Configure project :
   Building project 'core' with Scala version 2.13.5
   Building project 'streams-scala' with Scala version 2.13.5
   FAILURE: Build failed with an exception.
   * Where:
   Build file '/tmp/2.8/kafka-2.8.0-src/build.gradle' line: 2282
   * What went wrong:
   A problem occurred evaluating root project 'kafka-2.8.0-src'.
   > Could not get unknown property 'compileJava' for root project 'kafka-2.8.0-src' of type org.gradle.api.Project.
   * Try:
   Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
   * Get more help at https://help.gradle.org
   Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
   Use '--warning-mode all' to show the individual deprecation warnings.
   See https://docs.gradle.org/6.8.1/userguide/command_line_interface.html#sec:command_line_warnings
   BUILD FAILED in 523ms
   ```
   
   The line (2282) is in the aggregatedJavadoc task.
   
   I really can't understand how I'm getting a different result on this extracted tarball than I get on my primary clone of Kafka.
   
   I checked the build.gradle file, and it's identical:
   ```
   [john@arcturus kafka-2.8.0-src]$ diff build.gradle /home/repos/kafka/build.gradle 
   [john@arcturus kafka-2.8.0-src]$ sha1sum build.gradle 
   3d6dbaeb00a25dc4b52a39a7912b463bd3cf5203  build.gradle
   [john@arcturus kafka-2.8.0-src]$ sha1sum /home/repos/kafka/build.gradle 
   3d6dbaeb00a25dc4b52a39a7912b463bd3cf5203  /home/repos/kafka/build.gradle
   ```
   
   As well as gradlew:
   ```
   [john@arcturus kafka-2.8.0-src]$ diff gradlew /home/repos/kafka/gradlew
   [john@arcturus kafka-2.8.0-src]$ sha1sum gradlew
   3d1f1466c838a14e44053e78c259196da7dae45f  gradlew
   [john@arcturus kafka-2.8.0-src]$ sha1sum /home/repos/kafka/gradlew
   3d1f1466c838a14e44053e78c259196da7dae45f  /home/repos/kafka/gradlew
   ```
   
   And I also verified that the actual version of Gradle is the same:
   ```
   [john@arcturus kafka-2.8.0-src]$ ./gradlew -v
   ------------------------------------------------------------
   Gradle 6.8.1
   ------------------------------------------------------------
   Build time:   2021-01-22 13:20:08 UTC
   Revision:     31f14a87d93945024ab7a78de84102a3400fa5b2
   Kotlin:       1.4.20
   Groovy:       2.5.12
   Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
   JVM:          1.8.0_282 (Oracle Corporation 25.282-b08)
   OS:           Linux 5.11.6-arch1-1 amd64
   [john@arcturus kafka-2.8.0-src]$ cd /home/repos/kafka
   [john@arcturus kafka]$ ./gradlew -v
   ------------------------------------------------------------
   Gradle 6.8.1
   ------------------------------------------------------------
   Build time:   2021-01-22 13:20:08 UTC
   Revision:     31f14a87d93945024ab7a78de84102a3400fa5b2
   Kotlin:       1.4.20
   Groovy:       2.5.12
   Ant:          Apache Ant(TM) version 1.10.9 compiled on September 27 2020
   JVM:          1.8.0_282 (Oracle Corporation 25.282-b08)
   OS:           Linux 5.11.6-arch1-1 amd64
   [john@arcturus kafka]$ 
   ```
   
   In some sense, what is actually confusing is why it passes for anyone, not so much why it fails... It is true that the `java` plugin is only applied to the subprojects, not the root, so it does seem to make sense that we couldn't create a task in the root project that depends on `compileJava` (which comes from that `java` plugin).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805076137


   I run `./gradlew aggregatedJavadocg` with JDK 11 and this patch and it still produces following error message.
   ```
   > Task :aggregatedJavadoc FAILED
   /home/chia7712/kafka/streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:44: error: cannot find symbol
   import org.apache.kafka.streams.internals.KeyValueStoreFacade;
                                            ^
     symbol:   class KeyValueStoreFacade
     location: package org.apache.kafka.streams.internals
   /home/chia7712/kafka/streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:45: error: cannot find symbol
   import org.apache.kafka.streams.internals.WindowStoreFacade;
                                            ^
     symbol:   class WindowStoreFacade
     location: package org.apache.kafka.streams.internals
   /home/chia7712/kafka/streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:69: error: cannot find symbol
   import org.apache.kafka.streams.processor.internals.TestDriverProducer;
                                                      ^
     symbol:   class TestDriverProducer
     location: package org.apache.kafka.streams.processor.internals
   /home/chia7712/kafka/streams/test-utils/src/main/java/org/apache/kafka/streams/TopologyTestDriver.java:226: error: cannot find symbol
       private final TestDriverProducer testDriverProducer;
                     ^
     symbol:   class TestDriverProducer
     location: class TopologyTestDriver
   4 errors
   
   ```
   
   BTW, there is a issue related to this error (https://issues.apache.org/jira/browse/KAFKA-12435)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-806001054


   Thanks for the reviews and advice, all!
   
   I have removed the comment and consolidated the plugin application into `allprojects` I confirmed that the aggregatedJavadoc task still functions both with and without the `.git` directory. (although it still has the warnings/errors fixed in https://github.com/apache/kafka/pull/10392)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805289415


   Thanks, @chia7712 ! Ah, I thought that was just a warning; now I see it's an error.
   
   What I was facing before was a complete failure to load the gradle project, so this is an improvement. Still, I'll check out those errors.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei merged pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei merged pull request #10386:
URL: https://github.com/apache/kafka/pull/10386


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805974428


   Goodness gracious. Thanks for figuring that out, @chia7712 ! I was totally stumped (as you can tell from that comment).
   
   Yes, I'll remove the comment now, since the plugin clearly _is_ needed, and we never should have been relying on the transitive application from `rat`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805532637


   The error can be reproduced on either 2.8 or trunk branch by deleting the `.git` folder. 
   
   We apply `rat.gradle` if `.git` folder exists (see https://github.com/apache/kafka/blob/trunk/build.gradle#L135) and `rat.gradle` applies java plugin (https://github.com/apache/kafka/blob/trunk/gradle/rat.gradle#L101). Hence, `build.gradle` does not need to apply java plugin explicitly when there is a `.git` folder.
   
   In short, +1 to apply java plugin explicitly. BTW, could you revise the comments about why we have to apply java plugin?
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#discussion_r600471543



##########
File path: build.gradle
##########
@@ -167,6 +167,10 @@ if (file('.git').exists()) {
   }
 }
 
+// Apply 'java' to the root project so that the root-level task 'aggregatedJavadoc' can depend on compileJava
+// Weirdly, this seems to be required for some people, but not others. It doesn't seem to be harmful to add it
+// here, in any case.
+apply plugin: 'java'

Review comment:
       Things have changed a bit in master, so I submitted a separate PR for that https://github.com/apache/kafka/pull/10394/files




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805470895


   Absolutely, I'd appreciate it!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805457892


   > What I was facing before was a complete failure to load the gradle project
   
   just curious. How to reproduce that error?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#discussion_r600409509



##########
File path: build.gradle
##########
@@ -167,6 +167,10 @@ if (file('.git').exists()) {
   }
 }
 
+// Apply 'java' to the root project so that the root-level task 'aggregatedJavadoc' can depend on compileJava
+// Weirdly, this seems to be required for some people, but not others. It doesn't seem to be harmful to add it
+// here, in any case.
+apply plugin: 'java'

Review comment:
       I think you can move this to `allprojects` and remove `apply plugin: 'java'` from `subprojects`. I think we can also remove the comment since we now know that the `rat` plugin was doing this all along anyway.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] vvcephei commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
vvcephei commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805456926


   Thanks, @chia7712 . That does seem like an orthogonal issue, so I think I'll go ahead merge this fix.
   
   I just submitted a fix for those errors at https://github.com/apache/kafka/pull/10392


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] ijuma commented on a change in pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
ijuma commented on a change in pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#discussion_r600409509



##########
File path: build.gradle
##########
@@ -167,6 +167,10 @@ if (file('.git').exists()) {
   }
 }
 
+// Apply 'java' to the root project so that the root-level task 'aggregatedJavadoc' can depend on compileJava
+// Weirdly, this seems to be required for some people, but not others. It doesn't seem to be harmful to add it
+// here, in any case.
+apply plugin: 'java'

Review comment:
       I think you can move this to `allprojects` (so it can be near other similar `apply` calls) and remove `apply plugin: 'java'` from `subprojects` (not 100% sure about the latter since it depends on the evaluation order). I think we can also remove the comment since we now know that the `rat` plugin was doing this all along anyway.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [kafka] chia7712 commented on pull request #10386: MINOR: fix aggregatedJavadoc dep on compileJava

Posted by GitBox <gi...@apache.org>.
chia7712 commented on pull request #10386:
URL: https://github.com/apache/kafka/pull/10386#issuecomment-805466192


   @vvcephei Thanks for your sharing. Could you give me one second to verify this patch on my local?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org