Skip to content

Commit 3cd11c5

Browse files
authored
Fixed reporting of build errors (CP: #13889) (#13897)
1 parent 3d04526 commit 3cd11c5

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

toolkit/tools/scheduler/scheduler.go

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
package main
55

66
import (
7+
"errors"
78
"fmt"
89
"os"
910
"os/signal"
@@ -557,20 +558,29 @@ func buildAllNodes(stopOnFailure, canUseCache bool, packagesToRebuild, testsToRe
557558
schedulerutils.PrintBuildSummary(builtGraph, graphMutex, buildState, allowToolchainRebuilds, licenseChecker)
558559
schedulerutils.RecordBuildSummary(builtGraph, graphMutex, buildState, *outputCSVFile)
559560

561+
printErr := schedulerutils.PrintHiddenBuildBlockers(builtGraph, graphMutex, buildState, goalNode)
562+
if printErr != nil {
563+
logger.Log.Warnf("Failed to print hidden build blockers:\n%s", printErr)
564+
}
565+
566+
err = errors.Join(err, performPostBuildChecks(allowToolchainRebuilds, buildState))
567+
568+
return
569+
}
570+
571+
// performPostBuildChecks checks for any fatal post-build errors
572+
// and turns them into as a single error.
573+
func performPostBuildChecks(allowToolchainRebuilds bool, buildState *schedulerutils.GraphBuildState) (err error) {
560574
if !allowToolchainRebuilds && (len(buildState.ConflictingRPMs()) > 0 || len(buildState.ConflictingSRPMs()) > 0) {
561-
err = fmt.Errorf("toolchain packages rebuilt. See build summary for details. Use 'ALLOW_TOOLCHAIN_REBUILDS=y' to suppress this error if rebuilds were expected")
562-
return
575+
toolchainErr := fmt.Errorf("toolchain packages rebuilt. See build summary for details. Use 'ALLOW_TOOLCHAIN_REBUILDS=y' to suppress this error if rebuilds were expected")
576+
err = errors.Join(err, toolchainErr)
563577
}
564578

565579
if len(buildState.LicenseFailureSRPMs()) > 0 {
566-
err = fmt.Errorf("license check failed for some packages. See build summary for details")
567-
return
580+
licenseErr := fmt.Errorf("license check failed for some packages. See build summary for details")
581+
err = errors.Join(err, licenseErr)
568582
}
569583

570-
err = schedulerutils.PrintHiddenBuildBlockers(builtGraph, graphMutex, buildState, goalNode)
571-
if err != nil {
572-
err = fmt.Errorf("failed to print hidden build blockers:\n%w", err)
573-
}
574584
return
575585
}
576586

0 commit comments

Comments
 (0)