hey folks. i am noticing that the following step unpredictably needs to be rebuilt (quite often), even if nothing about my source or dagger code has changed:
● Container.directory(path: "/src"): Directory! 9.2s
✔ cache request: copy / /dagger 0.0s
✔ cache request: [internal] creating dagger metadata 0.0s
✔ cache request: oci-layout://dagger/import@sha256:6313b8ab78fd9cc0e46e4311e52f20f41bdf52685a610bd8ee4a30cb14ad2ff8 0.0s
✔ load cache: copy / /dagger 0.0s
✔ merge 0.0s
✔ rm /dagger/dagger.gen.go 0.0s
✔ load cache: creating dagger metadata 0.0s
✔ load cache: mkfile /schema.json 0.0s
● exec /usr/local/bin/codegen --output /src --module-context-path /src/dagger --module-name dtest --introspection-json-path /schema.json 9.1
my source is a dead simple hello world with a test file, and my dagger fns look like this
func (m *Dtest) Build(dir *Directory) *Container {
return dag.Container().From("golang:latest").
WithMountedDirectory("/mnt", dir).
WithWorkdir("/mnt")
}
func (m *Dtest) Test(ctx context.Context, dir *Directory) (string, error) {
return m.Build(dir).WithExec([]string{"go","test"}).Stdout(ctx)
}
i'm running this with dagger call test --dir=. -vvv.
how can i predict when the cache will be invalidated? this causes runtimes to vary by an order of magnitude. thanks