You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently the following tasks used with protobuf-gradle-plugin operation modify the bufbuild build directory, but do not declare any outputs (Referenced via BufPlugin constants):
COPY_BUF_CONFIG_TASK_NAME
WRITE_WORKSPACE_YAML_TASK_NAME
CREATE_SYM_LINKS_TO_MODULES_TASK_NAME
Most of the time this is fine, but in some situations Gradle's stale output detection will delete the entire bufbuild directory when processing the copyBufConfig task prior to executing the bufBuild task. Example build output with --info
Resolve mutations for :<project>:copyBufConfig (Thread[Execution worker,5,main]) started.
:<project>:copyBufConfig (Thread[Execution worker,5,main]) started.
> Task :<project>:copyBufConfig
Deleting stale output file: <project dir>/build/bufbuild
Caching disabled for task ':<project>:copyBufConfig' because:
Not worth caching
Task ':<project>:copyBufConfig' is not up-to-date because:
No history is available.
Resolve mutations for :<project>:bufBuild (Thread[Execution worker,5,main]) started.
:<project>:bufBuild (Thread[Execution worker,5,main]) started.
> Task :<project>:bufBuild FAILED
Caching disabled for task ':<project>:bufBuild' because:
Caching has not been enabled for the task
Task ':<project>:bufBuild' is not up-to-date because:
Task has not declared any outputs despite executing actions.
Running buf from <project dir>/build/bufbuild: `buf build --output <project dir>/build/bufbuild/image.json`
When this occurs, the bufBuild task fails with the following error:
I haven't been able to reproduce it locally, as I'm sure the CI configuration is doing something nutty, but this regularly occurs in the CI build. I've been able to fix this by manually setting the outputs for the above tasks to layout.buildDirectory.dir(BUF_BUILD_DIR):
Ideally the tasks would properly specify their specific outputs, and perhaps additionally the dependent tasks would simply depend on the task outputs directly instead of dependsOn relationships to tasks. That would follow Gradle recommended practices more closely, and also give Gradle a bit more insight into the dependency graph.
The text was updated successfully, but these errors were encountered:
Currently the following tasks used with
protobuf-gradle-plugin
operation modify thebufbuild
build directory, but do not declare any outputs (Referenced via BufPlugin constants):Most of the time this is fine, but in some situations Gradle's stale output detection will delete the entire
bufbuild
directory when processing thecopyBufConfig
task prior to executing thebufBuild
task. Example build output with--info
When this occurs, the
bufBuild
task fails with the following error:I haven't been able to reproduce it locally, as I'm sure the CI configuration is doing something nutty, but this regularly occurs in the CI build. I've been able to fix this by manually setting the outputs for the above tasks to
layout.buildDirectory.dir(BUF_BUILD_DIR)
:Ideally the tasks would properly specify their specific outputs, and perhaps additionally the dependent tasks would simply depend on the task outputs directly instead of
dependsOn
relationships to tasks. That would follow Gradle recommended practices more closely, and also give Gradle a bit more insight into the dependency graph.The text was updated successfully, but these errors were encountered: