Skip to content

Commit 9340f8e

Browse files
committed
wip
1 parent 085fbd9 commit 9340f8e

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

.dagger/main.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,15 @@ import (
77

88
type HttpNu struct{}
99

10-
func (m *HttpNu) withCaches(container *dagger.Container) *dagger.Container {
11-
registryCache := dag.CacheVolume("cargo-registry-shared")
12-
gitCache := dag.CacheVolume("cargo-git-shared")
13-
targetCache := dag.CacheVolume("cargo-target-shared")
10+
func (m *HttpNu) withCaches(container *dagger.Container, targetSuffix string) *dagger.Container {
11+
// Shared across all targets (registry + git combined)
12+
sharedCache := dag.CacheVolume("dagger-cargo-shared")
13+
14+
// Separate per target (avoid build blocking)
15+
targetCache := dag.CacheVolume("dagger-cargo-target-" + targetSuffix)
1416

1517
return container.
16-
WithMountedCache("/root/.cargo/registry", registryCache).
17-
WithMountedCache("/root/.cargo/git", gitCache).
18+
WithMountedCache("/root/.cargo", sharedCache).
1819
WithMountedCache("/app/target", targetCache)
1920
}
2021

@@ -37,6 +38,7 @@ func (m *HttpNu) DarwinEnv(
3738
From("joseluisq/rust-linux-darwin-builder:latest").
3839
WithMountedDirectory("/app", src).
3940
WithWorkdir("/app"),
41+
"darwin-arm64",
4042
)
4143
}
4244

@@ -59,6 +61,7 @@ func (m *HttpNu) WindowsEnv(
5961
WithEnvVariable("AWS_LC_SYS_PREBUILT_NASM", "0").
6062
WithMountedDirectory("/app", src).
6163
WithWorkdir("/app"),
64+
"windows-amd64",
6265
)
6366
}
6467

@@ -85,6 +88,7 @@ func (m *HttpNu) LinuxArm64Env(
8588
WithMountedDirectory("/app", src).
8689
WithWorkdir("/app").
8790
WithExec([]string{"rustup", "target", "add", "aarch64-unknown-linux-musl"}),
91+
"linux-arm64",
8892
)
8993
}
9094

@@ -104,6 +108,7 @@ func (m *HttpNu) LinuxAmd64Env(
104108
WithMountedDirectory("/app", src).
105109
WithWorkdir("/app").
106110
WithExec([]string{"rustup", "target", "add", "x86_64-unknown-linux-musl"}),
111+
"linux-amd64",
107112
)
108113
}
109114

0 commit comments

Comments
 (0)