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
Deprecate consuming the output of a task that wasn't executed #11100
Comments
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
We still want to do this. |
This issue has been automatically marked as stale because it has not had recent activity. Given the limited bandwidth of the team, it will be automatically closed if no further activity occurs. If you're interested in how we try to keep the backlog in a healthy state, please read our blog post on how we refine our backlog. If you feel this is something you could contribute, please have a look at our Contributor Guide. Thank you for your contribution. |
We have a build with many expensive and long-running tasks. For historical reasons, some of them are not incremental, so people often exclude tasks from running to save build time. But even if a task is not up-to-date, it may be okay for our use case to exclude the task and use the outdated task output. So, while there may be issues due to such exclusions, it more often is not a problem to use existing (and possibly even stale!) outputs from excluded tasks. In our use case, it is more critical to get a build product on time than having a reproducible build product. Removing the possibility to use existing outputs of excluded tasks would hence be very unfortunate for us. So, is this change still planned? If so, then related issues like #21179 and #16789 would essentially never be fixed, I suppose. On a more general note, I believe it should be clear to everyone who manually excludes tasks from running that stale outputs may be used then, and that this might lead to issues – depending on the build. If not, then maybe adding a warning to the docs (like here) could mitigate this. |
This also applies to artifact transforms and artifacts that come through dependency management. IOW, this isn't as simple as two tasks that have their input/output wired directly together. See #27042 |
There are certain ways that tasks can be excluded from execution:
Task.onlyIf()
Task.enabled
-exclude-task
on the command-lineIn each case the task will stay part of the task graph, but Gradle won't execute it. If there are tasks further down that consume the output of the excluded task, they see whatever stale output was left in place after the previous execution (or empty outputs in case of a clean build). This can lead to all kinds of problems.
We should fail if any such output is consumed by another task. It should probably be okay to depend on a skipped task via
Task.dependsOn()
but not to consume its output (either viaTask.outputs.files
or via any of its output properties).One use case for
-x
is to use it with--rerun-tasks
, excluding some expensive tasks. This could probably be better addressed via #9166 by only rerunning requested tasks.cc: @gradle/build-cache
The text was updated successfully, but these errors were encountered: