Skip to content

Ensure a newline is printed after Planning build #8050

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
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
10 changes: 9 additions & 1 deletion Sources/Build/BuildOperation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -770,7 +770,15 @@ public final class BuildOperation: PackageStructureDelegate, SPMBuildCore.BuildS
self.current = (buildSystem, tracker)

// Build the package structure target which will re-generate the llbuild manifest, if necessary.
return buildSystem.build(target: "PackageStructure")
let buildSuccess = buildSystem.build(target: "PackageStructure")

// If progress has been printed this will add a newline to separate it from what could be
// the output of the command. For instance `swift test --skip-build` may print progress for
// the Planning Build stage, followed immediately by a list of tests. Without this finialize()
// call the first entry in the list appear on the same line as the Planning Build progress.
tracker.finalize(success: true)

return buildSuccess
}

/// Create the build system using the given build description.
Expand Down
6 changes: 6 additions & 0 deletions Sources/Build/LLBuildProgressTracker.swift
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,12 @@ final class LLBuildProgressTracker: LLBuildBuildSystemDelegate, SwiftCompilerOut
}
}

public func finalize(success: Bool) {
self.queue.async {
self.progressAnimation.complete(success: success)
}
}

// MARK: llbuildSwift.BuildSystemDelegate

var fs: SPMLLBuild.FileSystem? {
Expand Down