diff --git a/proto_package.go b/proto_package.go index 763a567..c693231 100644 --- a/proto_package.go +++ b/proto_package.go @@ -239,9 +239,9 @@ func (p *ProtoPackage) build(ctx context.Context) (time.Duration, error) { return time.Since(start), ctx.Err() } - if p.DbPackage.Lto != dbpackage.LtoAutoDisabled && p.DbPackage.Lto != dbpackage.LtoDisabled && reLdError.Match(out.Bytes()) { + if p.DbPackage.Lto != dbpackage.LtoAutoDisabled && p.DbPackage.Lto != dbpackage.LtoDisabled && (reLdError.MatchString(out.String()) || reRustLTOError.MatchString(out.String())) { p.DbPackage.Update().SetStatus(dbpackage.StatusQueued).SetSkipReason("non-LTO rebuild").SetLto(dbpackage.LtoAutoDisabled).ExecX(ctx) - return time.Since(start), fmt.Errorf("ld error detected, LTO disabled") + return time.Since(start), fmt.Errorf("ld/lto-incomp error detected, LTO disabled") } if reDownloadError.MatchString(out.String()) || rePortError.MatchString(out.String()) || reSigError.MatchString(out.String()) { diff --git a/utils.go b/utils.go index 1b90ab5..0d30ccb 100644 --- a/utils.go +++ b/utils.go @@ -54,6 +54,7 @@ var ( reDownloadError = regexp.MustCompile(`(?m)^error: could not rename .+$`) rePortError = regexp.MustCompile(`(?m)^OSError: \[Errno 98] Address already in use$`) reSigError = regexp.MustCompile(`(?m)^error: .*: signature from .* is invalid$`) + reRustLTOError = regexp.MustCompile(`(?m)^error: options \x60-C (.+)\x60 and \x60-C lto\x60 are incompatible$`) ) type BuildManager struct { @@ -696,8 +697,9 @@ func logHK() error { if err != nil { return err } + sLogContent := string(logContent) - if rePortError.Match(logContent) || reSigError.Match(logContent) || reDownloadError.Match(logContent) { + if rePortError.MatchString(sLogContent) || reSigError.MatchString(sLogContent) || reDownloadError.MatchString(sLogContent) { rows, err := db.DbPackage.Update().Where(dbpackage.And(dbpackage.Pkgbase(pkg.Pkgbase), dbpackage.March(pkg.March), dbpackage.StatusEQ(dbpackage.StatusFailed))).ClearHash().SetStatus(dbpackage.StatusQueued).Save(context.Background()) if err != nil { @@ -707,7 +709,7 @@ func logHK() error { if rows > 0 { log.Infof("[HK/%s/%s] fixable build-error detected, requeueing package (%d)", pkg.March, pkg.Pkgbase, rows) } - } else if reLdError.Match(logContent) { + } else if reLdError.MatchString(sLogContent) || reRustLTOError.MatchString(sLogContent) { rows, err := db.DbPackage.Update().Where( dbpackage.And( dbpackage.Pkgbase(pkg.Pkgbase),