-
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
Draft
dejan2609
wants to merge
5
commits into
apache:trunk
Choose a base branch
from
dejan2609:KAFKA-19174-POC-for-distribution-submodule
base: trunk
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
KAFKA-19174 POC for a new :distribution
submodule
#20566
dejan2609
wants to merge
5
commits into
apache:trunk
from
dejan2609:KAFKA-19174-POC-for-distribution-submodule
+56
−42
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…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
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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