added regex to match "options -C embed-bitcode=no and -C lto are incompatible"

This commit is contained in:
2022-11-03 15:06:56 +01:00
parent 2af46109eb
commit 930ac1f50d
2 changed files with 6 additions and 4 deletions

View File

@@ -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()) {

View File

@@ -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),