fix(ci): remove dart-tool-build cache mount from setup()

Shared mutable cache mounts prevent BuildKit from persistently caching
the exec result across sessions. Without the mount, build_runner output
is stored in the content-addressed snapshot and survives GC cycles,
allowing downstream analyze/test steps to also be stably cached.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas SharedInbox
2026-05-19 22:46:39 +02:00
co-authored by Claude Sonnet 4.6
parent b2a15aee09
commit 39204fabcd
-4
View File
@@ -211,13 +211,9 @@ func (m *Ci) pubGetLayer() *dagger.Container {
}
// setup overlays source files onto the cached pub-get layer and runs
// build_runner with its incremental build graph in a dedicated cache volume.
// Each caller passes only the files it actually needs so unrelated changes
// don't bust the build cache.
func (m *Ci) setup(src *dagger.Directory) *dagger.Container {
return m.pubGetLayer().
WithDirectory("/src", src).
WithMountedCache("/src/.dart_tool/build", dag.CacheVolume("flutter-dart-tool-build")).
WithExec([]string{"flutter", "pub", "run", "build_runner", "build", "--delete-conflicting-outputs"})
}