You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add a canonical implementation of reconstructing a build backtrace to the SwiftBuild module for use by clients
- Adopt it in the unit test infrastructure
- Improve backtrace reconstruction for dynamic tasks
rdar://152194560
Copy file name to clipboardExpand all lines: Sources/SWBTestSupport/BuildOperationTester.swift
+4-101Lines changed: 4 additions & 101 deletions
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ package final class BuildOperationTester {
155
155
case subtaskDidReportProgress(SubtaskProgressEvent, count:Int)
156
156
157
157
/// The build emitted a backtrace frame.
158
-
case emittedBuildBacktraceFrame(identifier:SWBProtocol.BuildOperationBacktraceFrameEmitted.Identifier, previousFrameIdentifier:SWBProtocol.BuildOperationBacktraceFrameEmitted.Identifier?, category:SWBProtocol.BuildOperationBacktraceFrameEmitted.Category, description:String)
158
+
case emittedBuildBacktraceFrame(BuildOperationBacktraceFrameEmitted)
159
159
160
160
packagevardescription:String{
161
161
switchself{
@@ -189,8 +189,8 @@ package final class BuildOperationTester {
/// Check whether the results contains a dependency cycle error. If so, then consume the error and create a `CycleChecking` object and pass it to the block. Otherwise fail.
guard case .emittedBuildBacktraceFrame(identifier:let identifier, previousFrameIdentifier: _, category: _, description: _)= event, case .task(let signature)= identifier,BuildOperationTaskSignature.taskIdentifier(ByteString(encodingAsUTF8: task.identifier.rawValue))== signature else{
1051
-
returnnil
1052
-
}
1053
-
return identifier
1054
-
// Iff the task is a dynamic task, there may be more than one corresponding frame if it was requested multiple times, in which case we choose the first. Non-dynamic tasks always have a 1-1 relationship with frames.
1055
-
}).sorted().first else{
1056
-
Issue.record("Did not find a single build backtrace frame for task: \(task.identifier)", sourceLocation: sourceLocation)
// Iff the task is a dynamic task, there may be more than one corresponding frame if it was requested multiple times, in which case we choose the first. Non-dynamic tasks always have a 1-1 relationship with frames.
0 commit comments