-
Notifications
You must be signed in to change notification settings - Fork 14.7k
KAFKA-19174 POC for a new :distribution
submodule
#20566
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
KAFKA-19174 POC for a new :distribution
submodule
#20566
Conversation
…rsion (i.e. file `unixStartScript.txt`) was being referenced
Gradle build `./gradlew clean rTG -i` fails with this error: ``` > Task :core:releaseTarGz FAILED [Incubating] Problems report is available at: file:///home/dejan/kafka/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':core:releaseTarGz'. > Resolution of the configuration ':tools:tools-api:runtimeClasspath' was attempted without an exclusive lock. This is unsafe and not allowed. * Try: > For more information, please refer to https://docs.gradle.org/9.1.0/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation. ```
…odules note: build `./gradlew releaseTarGz` works fine with this hack (and that means we now know where is the root cause) ``` > Task :core:releaseTarGz Caching disabled for task ':core:releaseTarGz' because: Build cache is disabled Not worth caching Task ':core:releaseTarGz' is not up-to-date because: No history is available. [Incubating] Problems report is available at: file:///home/dejan/kafka/build/reports/problems/problems-report.html Deprecated Gradle features were used in this build, making it incompatible with Gradle 10. You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins. For more on this, please refer to https://docs.gradle.org/9.1.0/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation. BUILD SUCCESSFUL in 4m 54s 227 actionable tasks: 227 executed Consider enabling configuration cache to speed up this build: https://docs.gradle.org/9.1.0/userguide/configuration_cache_enabling.html dejan@dejan-HP-ProBook-450-G7:~/kafka$ git log -1 --oneline ea2efb4b6a (HEAD -> KAFKA-19174-POC-for-distribution-submodule) KAFKA-19174 commenting out all `runtimeClasspath` references for submodules dejan@dejan-HP-ProBook-450-G7:~/kafka$ ```
…for submodules" This reverts commit 09c8d9f.
…`resolvedRuntimeClasspath` in attempt to trick Gradle alas, build fails again: ``` > Task :core:releaseTarGz FAILED [Incubating] Problems report is available at: file:///home/dejan/kafka/build/reports/problems/problems-report.html FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':core:releaseTarGz'. > Resolution of the configuration ':trogdor:resolvedRuntimeClasspath' was attempted without an exclusive lock. This is unsafe and not allowed. * Try: > For more information, please refer to https://docs.gradle.org/9.1.0/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors in the Gradle documentation. ```
FYI @chia7712 |
@dejan2609 Is this patch available? I encounter the following error
|
@chia7712 Yes, a complete solution is available in
|
A label of 'needs-attention' was automatically added to this PR in order to raise the |
Main takeaway: from my POV it is mandatory to add a new Gradle I managed to keep paths for the generated distribution kafka-*.tgz files (they will still be added to the old @chia7712 I assume this is an acceptable solution for you, so I'll will close this POC (but please let me know if you have other thoughts). |
Prologue: #19513
This POC tries to explain why a new
:distribution
submodule is required for Gradle 8 -->> 9 upgradeThe thing is that Gradle 9 is very strict when it comes to a submodule boundaries: https://docs.gradle.org/9.1.0/userguide/viewing_debugging_dependencies.html#sub:resolving-unsafe-configuration-resolution-errors
Root cause (see this commit: 09c8d9f):
:core
modulereleaseTarGz
task is not able to directly access other submodulesruntimeClasspath
configuration:And that is why I tried to bypass that with:
but the build still fails ❌
Why build works in #19513 ? Because in addition to the changes above
configuration fora new submodule:distribution
is extended::distribution
expands Gradle setup like this:Pro et contra
:distribution
:./gradlew releaseTarGz
✔️:distribution
Gradle submodule has no folder in Git ✔️ (🪧 folder gets created on./gradlew releaseTarGz
but Git ignores it):core
path) ✔️Pro et contra
:core
:Disclaimer: certainly, there is a way to do things differently.
Gradle provides some recommendations (not sure about effort/feasibility):
https://docs.gradle.org/9.1.0/userguide/how_to_share_outputs_between_projects.html