Fix side-effect file syncing when using symlink optimization

- Ensure output files are synced even when reading from symlink
- Call findActionResult to get ActionResult for side-effect files
- Maintains performance benefit while ensuring correctness
- Addresses @eed3si9n's concern about tasks generating files on the side
This commit is contained in:
john0030710 2026-01-10 00:25:59 +01:00
parent 08fe019dc0
commit 3abddf461a
1 changed files with 7 additions and 1 deletions

View File

@ -114,7 +114,13 @@ object ActionCache:
then
Exception.nonFatalCatch
.opt(IO.read(resolvedValuePath.toFile(), StandardCharsets.UTF_8))
.map(valueFromStr(_, Some("symlink")))
.map: str =>
// We still need to sync output files for side effects
findActionResult(key, codeContentHash, extraHash, config) match
case Right(result) =>
store.syncBlobs(result.outputFiles, config.outputDirectory)
case Left(_) => // Ignore if we can't find ActionResult
valueFromStr(str, Some("symlink"))
else None
readFromSymlink() match