added workaround fpr firefox build using teh same port

This commit is contained in:
2021-12-19 17:39:33 +01:00
parent 3a6e4be5cf
commit fdde0386ec
2 changed files with 12 additions and 0 deletions

11
main.go
View File

@@ -179,6 +179,17 @@ func (b *BuildManager) buildWorker(id int, march string) {
continue
}
if rePortError.Match(out.Bytes()) {
log.Infof("[%s/%s/%s] port already used (firefox?) error detected, rebuilding later", pkg.FullRepo, pkg.Pkgbase, pkg.Version)
pkg.DbPackage.Update().SetStatus(dbpackage.StatusQueued).ExecX(context.Background())
err = cleanBuildDir(buildDir)
if err != nil {
log.Warningf("[%s/%s/%s] Error removing builddir: %v", pkg.FullRepo, pkg.Pkgbase, pkg.Version, err)
}
b.buildWG.Done()
continue
}
log.Warningf("[%s/%s/%s] Build failed (%d)", pkg.FullRepo, pkg.Pkgbase, pkg.Version, cmd.ProcessState.ExitCode())
check(os.MkdirAll(filepath.Join(conf.Basedir.Repo, logDir, march), 0755))

View File

@@ -47,6 +47,7 @@ var (
rePkgFile = regexp.MustCompile(`^(.+)(?:-.+){2}-(?:x86_64|any)\.pkg\.tar\.zst(?:\.sig)*$`)
reLdError = regexp.MustCompile(`(?mi).*collect2: error: ld returned (\d+) exit status.*`)
reDepError = regexp.MustCompile(`(?m)^error: could not rename .+$`)
rePortError = regexp.MustCompile(`(?m)^OSError: \[Errno 98] Address already in use$`)
)
type BuildPackage struct {