Skip to content

Commit

Permalink
fix: panic in build engine when module building fails (#1985)
Browse files Browse the repository at this point in the history
Fixes #1984
  • Loading branch information
wesbillman authored Jul 5, 2024
1 parent c38eb92 commit a183b6f
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions buildengine/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ func buildModule(ctx context.Context, projectRootDir string, sch *schema.Schema,
}

logger.Infof("Building module")

startTime := time.Now()

switch module.Config.Language {
case "go":
err = buildGoModule(ctx, projectRootDir, sch, module, filesTransaction)
Expand Down Expand Up @@ -70,6 +73,8 @@ func buildModule(ctx context.Context, projectRootDir string, sch *schema.Schema,
return errors.Join(errs...)
}

logger.Infof("Module built (%.2fs)", time.Since(startTime).Seconds())

return nil
}

Expand Down
5 changes: 4 additions & 1 deletion buildengine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -729,7 +729,10 @@ func (e *Engine) gatherSchemas(
latestModule = moduleMeta{module: module}
}
for _, dep := range latestModule.module.Dependencies {
out[dep] = moduleSchemas[dep]
if moduleSchemas[dep] != nil {
out[dep] = moduleSchemas[dep]
}

if dep != "builtin" {
depModule, ok := e.moduleMetas.Load(dep)
// TODO: should we be gathering schemas from dependencies without a module?
Expand Down

0 comments on commit a183b6f

Please sign in to comment.