Fix XCLogParser function/typechecking recognition for modern Xcode versions #228
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #190
Since
xclogparser
was last updated, there have been various changes in the way that Xcode builds are handled:SwiftCompile
, notCompileSwift
. This changes build step recognition inBuildStep.swift
, but also changes the various regular expressions used for identifying these steps.swiftAggregatedCompilation
step that is already defined. You can read more about that here: https://github.com/swiftlang/swift/blob/main/docs/CompilerPerformance.md#compilation-modesSet
.In short: this allows the type checking and function time data to appear in the outputs without causing memory explosions or runtime explosions.
Things to note:
Slowest Swift Files
to appear in the HTML reporter, this isn't really even a valid metric anymore since it's the measurement of n file compilations.XYZ.swift
didn't take 20 seconds to compile – rather, it and its batch of files took that time. We should probably fully remove this section from the HTML output, unless the compilation mode is setup for single files. For now, I'm leaving it as is.🤖 Copilot Generated PR Description and Outline
This pull request includes several changes to improve the parsing and reporting of Swift compilation steps in the
XCLogParser
project. The changes focus on updating patterns for Swift compilation, enhancing data structures for performance, and refining the reporting logic.Changes to update
CompileSwift
prefix:Sources/XCLogParser/parser/BuildStep.swift
: Updated the prefix fromCompileSwift
toSwiftCompile
in theDetailStepType
enum.Sources/XCLogParser/parser/IDEActivityLogSection+Parsing.swift
: Updated the regular expression pattern to matchSwiftCompile
instead ofCompileSwift
.Sources/XCLogParser/parser/ParserBuildSteps.swift
: Changed the pattern inswiftcArchRegexp
to matchSwiftCompile
instead ofCompileSwift
.Changes to improve handling of Swift function and type check times:
Sources/XCLogParser/reporter/HtmlReporter.swift
: Replaced arrays with sets forswiftFunctionTimes
andswiftTypeCheckTimes
to avoid duplicates and ensure unique entries. [1] [2]Conformance to
Hashable
protocol:Sources/XCLogParser/parser/SwiftFunctionTime.swift
: MadeSwiftFunctionTime
conform to theHashable
protocol.Sources/XCLogParser/parser/SwiftTypeCheck.swift
: MadeSwiftTypeCheck
conform to theHashable
protocol.Screenshots and Outputs
HTML Screenshot
FlatJSON Output (Redacting app name)
Excerpt 1:
Excerpt 2: