fix: use CacheSharingModeLocked instead of dagger.Locked

dagger.Locked is not exported in this SDK version; the correct
constant is dagger.CacheSharingModeLocked.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Thomas Güttler
2026-05-18 10:16:02 +02:00
co-authored by Claude Sonnet 4.6
parent 592efae934
commit 0ea06e8634
+3 -3
View File
@@ -46,9 +46,9 @@ func (m *Ci) Base() *dagger.Container {
WithExec([]string{"apt-get", "install", "-y", "clang", "cmake", "ninja-build", "pkg-config", "libgtk-3-dev", "liblzma-dev", "libsecret-1-dev", "libgcrypt20-dev", "libjsoncpp-dev", "sqlite3", "iproute2", "netcat-openbsd", "xvfb", "libosmesa6", "libegl1", "lld"}).
// Locked sharing so each pub-get/gradle run gets exclusive write access,
// producing a deterministic output snapshot that Dagger can cache.
WithMountedCache("/root/.pub-cache", dag.CacheVolume("flutter-pub-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.Locked}).
WithMountedCache("/root/.gradle", dag.CacheVolume("gradle-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.Locked}).
WithMountedCache("/opt/android-sdk-linux/ndk", dag.CacheVolume("android-ndk-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.Locked}).
WithMountedCache("/root/.pub-cache", dag.CacheVolume("flutter-pub-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.CacheSharingModeLocked}).
WithMountedCache("/root/.gradle", dag.CacheVolume("gradle-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.CacheSharingModeLocked}).
WithMountedCache("/opt/android-sdk-linux/ndk", dag.CacheVolume("android-ndk-cache"), dagger.ContainerWithMountedCacheOpts{Sharing: dagger.CacheSharingModeLocked}).
WithEnvVariable("PUB_CACHE", "/root/.pub-cache").
// Pre-install NDK to avoid slow downloads during the actual build
WithExec([]string{"/bin/sh", "-c", "if [ ! -d /opt/android-sdk-linux/ndk/28.2.13676358 ]; then yes | sdkmanager \"ndk;28.2.13676358\"; fi"}).