-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
Regression in primary task ordering #20062
Comments
For example, given these task requests:
We see this at execution time:
|
This smells like a missing task dependency. Why does In general, the task ordering on the command line is (and has always been) super weak and Gradle has always run things in the fastest order possible (regardless of command line order). And, it would run tasks in command line order if (and only if) other stronger relationships don't exist. In other words, if you specify "a b c" on the command line and b is delayed by task dependencies, but c is ready, we would always go ahead and run c before b. We've essentially added a new kind of relationship that says producers/destroyers on the command line must execute in the order that they appear. I suspect this is somehow delaying build/generate but not |
On the surface, I don't think so, but I don't feel like I understand the problem well enough to say so with confidence. I suspect this is something where @DanielThomas Can you tell us more about the relationships between tasks here? For instance, does |
@DanielThomas do you mind retrying with v7.4.2? @ghale implemented a fix for a similar issue. |
I think we can call this a missing task dependency. The primary task requests were the thing providing the undeclared order before, but if I follow correctly, that particular change in behaviour was intentional? |
Hi Danny. Yes, it sounds like the documentation you cited was not 100% accurate to being with, and the fix for #2488 corrected the behavior you were implicitly relying upon. From what I can see, it seems our improvements to the CLI ordering behavior teased out a missing or undeclared task input for I've created #20486 to clarify this change in the documentation. |
Closing per slack thread. |
Hey @DPUkyle, this is a private slack channel, right? |
Indeed - apologies, as I linked for my own record-keeping purposes. The resolution is that we've made subtle changes to task ordering and scheduling related to our work on the configuration cache feature and improved parallelism. In this case, the existing documentation was incorrect in that tasks explicitly enumerated on the CLI imply an exact order of execution. This was technically never true but the docs suggested it was. As for consumers who were affected by this change in behavior (the |
We have projects that call a number of tasks on the command line, with the previous and documented contract being that those tasks would be executed in the order specified:
https://docs.gradle.org/current/userguide/command_line_interface.html#executing_multiple_tasks
However in 7.4 the task order is no longer ensured, it appears we're seeing the later specified tasks execute first.
Expected Behavior
Task order should reflect the command line task request order (allowing for individual task dependencies of course).
Current Behavior
The order appears to be ignored, or at least, that order has changed. We assume this is due to the fixes for
clean
task ordering:#18904
Context
Projects that previously implicitly on this task ordering (no declared dependencies or output/inputs tracked) are seeing failures due to missing inputs. This can also cause an artifact to be released without tests being successful.
Steps to Reproduce
I can't come up with a reduced scenario for this so far, as this contract does seem to hold for simple task graphs. Believe it occurs when
clean
appears in the task requests.Your Environment
Gradle 7.4
The text was updated successfully, but these errors were encountered: