Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions pkg/leeway/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -791,15 +791,15 @@ func printBuildSummary(ctx *buildContext, targetPkg *Package, allpkg []*Package,
}

for _, p := range allpkg {
total++

// Check actual state in local cache
_, inCache := ctx.LocalCache.Location(p)

if !inCache {
// Package not in cache (shouldn't happen if build succeeded)
continue
}

total++

// Determine what happened to this package
if newlyBuiltMap[p.FullName()] {
Expand All @@ -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 {
Expand Down