diff --git a/go-runtime/compile/build.go b/go-runtime/compile/build.go index 88681209b7..116b58fbfc 100644 --- a/go-runtime/compile/build.go +++ b/go-runtime/compile/build.go @@ -260,7 +260,7 @@ func buildDir(moduleDir string) string { // Build the given module. func Build(ctx context.Context, projectRootDir, moduleDir string, config moduleconfig.AbsModuleConfig, sch *schema.Schema, filesTransaction ModifyFilesTransaction, buildEnv []string, devMode bool) (moduleSch *schema.Module, buildErrors []builderrors.Error, err error) { if err := filesTransaction.Begin(); err != nil { - return nil, nil, err + return nil, nil, fmt.Errorf("could not start a file transaction: %w", err) } defer func() { if terr := filesTransaction.End(); terr != nil { @@ -319,7 +319,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec logger.Debugf("Extracting schema") result, err := extract.Extract(config.Dir) if err != nil { - return nil, nil, err + return nil, nil, fmt.Errorf("could not extract schema: %w", err) } if builderrors.ContainsTerminalError(result.Errors) { @@ -336,7 +336,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec } if err := internal.ScaffoldZip(buildTemplateFiles(), moduleDir, mctx, scaffolder.Exclude("^go.mod$"), scaffolder.Functions(funcs)); err != nil { - return nil, nil, err + return nil, nil, fmt.Errorf("failed to scaffold build template: %w", err) } logger.Debugf("Tidying go.mod files") @@ -364,7 +364,7 @@ func Build(ctx context.Context, projectRootDir, moduleDir string, config modulec return filesTransaction.ModifiedFiles(filepath.Join(mainDir, "go.mod"), filepath.Join(moduleDir, "go.sum")) }) if err := wg.Wait(); err != nil { - return nil, nil, err + return nil, nil, err // nolint:wrapcheck } logger.Debugf("Compiling") diff --git a/internal/buildengine/engine.go b/internal/buildengine/engine.go index 04142e0730..9461f74b7a 100644 --- a/internal/buildengine/engine.go +++ b/internal/buildengine/engine.go @@ -817,7 +817,7 @@ func (e *Engine) build(ctx context.Context, moduleName string, builtModules map[ return err } // update files to deploy - e.moduleMetas.Compute(moduleName, func(meta moduleMeta, exists bool) (new moduleMeta, delete bool) { + e.moduleMetas.Compute(moduleName, func(meta moduleMeta, exists bool) (out moduleMeta, shouldDelete bool) { if !exists { return moduleMeta{}, true }