MobileNativeFoundation / MobileNativeFoundation/XCLogParser

How to Get Information about Compilation Time for Each Target/Module in the Workspace

Open
#221 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Swift
Stars
1.9k
Forks
138
PR merge metrics
No merged PRs in 30d

Description

We're trying to use the XCLogParser library to get information about compilation time for each target/module in our workspace.

Previously, we used the title and compilation duration properties like this:

let buildSteps = XcodeActivityLogAnalyzer().buildSteps(for: "App")

let names = buildSteps.map {
    // The title says "Build target XYZ" where XYZ is the name of the target, for instance:
    // Build target FrameworkA
    $0.title.split(separator: " ").last ?? $0.title
}
let compilationDurations = buildSteps.map { $0.compilationDuration }

let targets = Dictionary(
    zip(names, compilationDurations),
    uniquingKeysWith: { max($0, $1) }
)

However, this stopped working after we switched to Xcode 16 and integrated a Swift macro module. Now, all targets are showing a compilation duration of 0.

We can provide a POC if needed.

Using the solution from XCLogParser HtmlReporter doesn't work for us because it shows incorrect targets in the HTML report and uses duration instead of compilationDuration for charts.

Can you recommend a proper way to get accurate compilation times for each target/module in the workspace?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with XcodeActivityLogAnalyzer().buildSteps(for:) and the buildSteps, title, compilationDuration, and duration values used in the issue. Compare the parsed activity-log data for an Xcode 16 workspace containing a Swift macro module with the targets shown by HtmlReporter.swift and its generated resources. Done means identifying a supported way to obtain accurate per-target or per-module compilation times.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
build-system, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.