#anyone (maybe @Erik Sipsma ) know why I

1 messages · Page 1 of 1 (latest)

worldly comet
#

I was gonna say we have tests for that but turns out that coverage is of an interface in your own module used as a field in one of your types (https://github.com/sipsma/dagger/blob/1f27a62822cceae343c2c880664a49e73cde3625/core/integration/testdata/modules/go/ifaces/test/main.go#L16-L16)

Actually on a conceptual level I think what you're describing might only work right now if you mark the field as //+private since otherwise you are creating a field in the API that has types from a dependency module in your module, which isn't allowed.

But no matter what it shouldn't panic of course, so that's a bug

silent ridge
#

got it, I can try to track down the panic if I get a second. The ideal use case here was to have it as a public field so that I could chain on the interface functions. I could have the field be the original type, but then the interface isn't enforced

#

here's the stack for posterity

panic: unknown type: PlatformBuilderPlatformComponent

goroutine 41897 [running]:
github.com/dagger/dagger/dagql/introspection.WrapTypeFromType(...)
        /app/dagql/introspection/types.go:557
github.com/dagger/dagger/dagql/introspection.(*Type).OfType(0x40002d8948)
        /app/dagql/introspection/types.go:724 +0x260
github.com/dagger/dagger/core/schema.dagqlToCodegenTypeRef(0x40002d8948)
        /app/core/schema/query.go:321 +0xe8
github.com/dagger/dagger/core/schema.dagqlToCodegenField(0x40043acd80)
        /app/core/schema/query.go:246 +0x80
github.com/dagger/dagger/core/schema.dagqlToCodegenType(0x40053e69c0)
        /app/core/schema/query.go:174 +0x188
github.com/dagger/dagger/core/schema.(*querySchema).schemaJSONFile(0x40039e1778, {0x3542850, 0x40050cbdb0}, {{0x0, 0x4002584288, 0x0}, {0x0, 0x0, 0x4004e7d320, 0x4000e3db70, ...}}, ...)
        /app/core/schema/query.go:109 +0x124
github.com/dagger/dagger/dagql.NodeFuncWithCacheKey[...].func1({{0x0, 0x4002584288, 0x0}, {0x0, 0x0, 0x4004e7d320, 0x4000e3db70, 0x4004e77e70}}, 0x40053307b0, {0x0, ...})
        /app/dagql/objects.go:870 +0xfc
github.com/dagger/dagger/dagql.Class[...].Call(0x35b8fc0, {0x3542850, 0x40050cbdb0}, 0x40007d2f08?, {{0x0, 0x4002584288, 0x0}, {0x0, 0x0, 0x4004e7d320, ...}}, ...)
        /app/dagql/objects.go:303 +0xd4
github.com/dagger/dagger/dagql.ObjectResult[...].call.func2()
        /app/dagql/objects.go:683 +0x8c
github.com/dagger/dagger/engine/cache.(*cache[...]).GetOrInitializeWithCallbacks.func1()
        /app/engine/cache/cache.go:232 +0x58
created by github.com/dagger/dagger/engine/cache.(*cache[...]).GetOrInitializeWithCallbacks in goroutine 41875
        /app/engine/cache/cache.go:230 +0x5c4