Does anyone have any idea why I get an "Overlappin...
# caching
v
Does anyone have any idea why I get an "Overlapping outputs" problem for a task that should not have it, but only on GitHub Actions? This is the run on GHA: https://ge.spockframework.org/s/vnf6tebn2ygd4/timeline?details=3yt6nuz2vwgza This is the local run: https://ge.spockframework.org/s/y6x7rzl55yags/timeline?details=3yt6nuz2vwgza Both on the same commit, both with the same task started. Locally the task can be cached perfectly fine, on GHA it complains about overlapping outputs. I even added this debug code:
Copy code
allprojects { tasks.all {} }
tasks.register('foo') {
  doLast {
    allprojects*.tasks*.all { task ->
      outputs.files.files.findAll { it.absolutePath.contains('.github') }.each {
        println("FOO: ${task.name} | ${it.absolutePath}")
      }
    }
  }
}
And the result even for the GHA run is exactly as expected: https://ge.spockframework.org/s/vnf6tebn2ygd4/console-log?page=1#L100 No overlap with any output of any other task in the whole build.
n
That is strange. For my understanding, whats the task that creates
.github/workflows/release.yaml
?
Oh i see is it the
org.spockframework.gradle.PreprocessGithubWorkflow
that declares
.github/workflows/release.yaml
as an output? Ok, let's imagine this scenario, Github does a clean checkout of the repository. The first Gradle build after the checkout doesn't know how
.github/workflows/release.yaml
was created since it is already there but Gradle did not create it. The following builds work fine now that Gradle created that file. Are you able to reproduce locally on a fresh checkout of git?
v
Argh, you are right. 😞
Any way to mitigate that besides writing to a different file and the moving into place?
Besides that the "overlapping" hint is very misleading
n
Agreed, that overlapping hint is very misleading. I don't know any quick fixes for this 😞
v
The quick-fix is to have a separate task that deletes the output file on which the generation task depends. This finally makes it cacheable. As long as nothing between the deletion and the successful generation of the file fails, this should be fine 😄
👍 1
Thanks for your help 🙂
n
Thanks for filing those bugs!
👌 1