From 150b8b95f8a23ed2603c48e47a091f3862f8a4be Mon Sep 17 00:00:00 2001 From: Leo Di Donato <120051+leodido@users.noreply.github.com> Date: Thu, 13 Nov 2025 19:26:00 +0000 Subject: [PATCH 1/2] fix(build): correct total count in build summary Move total++ after cache check to ensure count matches categorized packages. Previously, total would include packages not in cache that were skipped, causing total != (builtLocally + downloaded + alreadyCached). Co-authored-by: Ona --- pkg/leeway/build.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/leeway/build.go b/pkg/leeway/build.go index 911ba66..67723a7 100644 --- a/pkg/leeway/build.go +++ b/pkg/leeway/build.go @@ -791,8 +791,6 @@ func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package, } for _, p := range allpkg { - total++ - // Check actual state in local cache _, inCache := ctx.LocalCache.Location(p) @@ -800,6 +798,8 @@ func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package, // Package not in cache (shouldn't happen if build succeeded) continue } + + total++ // Determine what happened to this package if newlyBuiltMap[p.FullName()] { From f288549160ec498de10f427630f92c42ebda3751 Mon Sep 17 00:00:00 2001 From: Leo Di Donato <120051+leodido@users.noreply.github.com> Date: Thu, 13 Nov 2025 19:28:29 +0000 Subject: [PATCH 2/2] refactor(build): rename initialStatus to statusAfterDownload The parameter name 'initialStatus' was misleading as it represents the package status after downloads complete but before local builds start, not the initial status before any operations. Renamed to 'statusAfterDownload' for clarity. Co-authored-by: Ona --- pkg/leeway/build.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/leeway/build.go b/pkg/leeway/build.go index 67723a7..848f0c9 100644 --- a/pkg/leeway/build.go +++ b/pkg/leeway/build.go @@ -768,7 +768,7 @@ func Build(pkg *Package, opts ...BuildOption) (err error) { } // printBuildSummary prints a summary of the build showing what was cached, downloaded, and built -func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package, initialStatus map[*Package]PackageBuildStatus, pkgsToDownload []*Package) { +func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package, statusAfterDownload map[*Package]PackageBuildStatus, pkgsToDownload []*Package) { var ( builtLocally int downloaded int @@ -808,13 +808,13 @@ func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package, // Check if this was supposed to be downloaded but wasn't // This indicates verification or download failure - if pkgsToDownloadMap[p.FullName()] && initialStatus[p] != PackageDownloaded { + if pkgsToDownloadMap[p.FullName()] && statusAfterDownload[p] != PackageDownloaded { failedDownloads = append(failedDownloads, p) } - } else if initialStatus[p] == PackageDownloaded { + } else if statusAfterDownload[p] == PackageDownloaded { // Package was downloaded downloaded++ - } else if initialStatus[p] == PackageBuilt { + } else if statusAfterDownload[p] == PackageBuilt { // Package was already cached alreadyCached++ } else {