-
Notifications
You must be signed in to change notification settings - Fork 135
Fix XCLogParser function/typechecking recognition for modern Xcode versions #228
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Hesham Salman <iron-ham@github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you been able to run the tests locally successfully after your changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think lifting the support to Xcode 16 and onwards is sensible. I'd make sure this is reflected in the docs/README and also that we fail early if we detect an Xcode < 16 activity result is being processed with these changes. Otherwise it'll be difficult for the developer to diagnose issues.
switch signature { | ||
case Prefix("CompileC "): | ||
return .cCompilation | ||
case Prefix("CompileSwift "): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since which Xcode version was this introduced?
@Iron-Ham any updates on this PR? 🙏 |
@AvdLee apologies, I haven't had the time to dive back into this, and the context is a bit fuzzy at this point. Happy to take a look once some of the iOS26 dust settles on my end – likely tomorrow or this weekend! Appreciate your patience |
@Iron-Ham thanks for the heads up, that timing works! 🚀 |
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: