From e9968e4c906535003e489534f78569ef9edf82f9 Mon Sep 17 00:00:00 2001 From: dubo-dubon-duponey Date: Wed, 12 May 2021 15:47:20 -0700 Subject: [PATCH 1/2] Fix crasher Signed-off-by: dubo-dubon-duponey --- dagger/compiler/build.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dagger/compiler/build.go b/dagger/compiler/build.go index f20da154..d4d17240 100644 --- a/dagger/compiler/build.go +++ b/dagger/compiler/build.go @@ -57,6 +57,11 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) { if len(instances) != 1 { return nil, errors.New("only one package is supported at a time") } + for _, value := range instances { + if value.Err != nil { + return nil, value.Err + } + } v, err := c.Context.BuildInstances(instances) if err != nil { return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{})) From 91c4f9c8e6018bbd7fabda13505bcf02ec2a1bb8 Mon Sep 17 00:00:00 2001 From: dubo-dubon-duponey Date: Wed, 12 May 2021 16:11:19 -0700 Subject: [PATCH 2/2] Adding additional error verification Signed-off-by: dubo-dubon-duponey --- dagger/compiler/build.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dagger/compiler/build.go b/dagger/compiler/build.go index d4d17240..33056e06 100644 --- a/dagger/compiler/build.go +++ b/dagger/compiler/build.go @@ -66,6 +66,11 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) { if err != nil { return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{})) } + for _, value := range v { + if value.Err() != nil { + return nil, value.Err() + } + } if len(v) != 1 { return nil, errors.New("internal: wrong number of values") }