XCLogParser
XCLogParser copied to clipboard
Question: Can the event "Create directory..." be removed from the start of targets?
I tried this out a couple of months ago and it was correctly showing the start and stop times of each target.

I just tried again today and for some reason it's reporting all targets starting at the same time.

Each target is now starting with a Create directory Target.framework
and Create directory Headers
step that happens when the build starts. Then there's a long period of inactivity before the target actually starts building.

As far was I can tell, both builds were done with Xcode 12.5.1 and no build settings have changed that should affect that. But XCLogParser hasn't had an update so it's unlikely to be a cause of the change in behaviour.
Any recommendations for build settings I can look at that could be causing this?
I'm seeing this issue as well. The timelines overlap.
I don't think Create directory
is the only step that is causing the problem. The legacy build system seemed to take a single target and carry out all of its build steps, building a maximum of CPU core counts targets concurrently. However, the new build system seems to bundle all the different build steps across all targets in a task queue. These build steps are then executed in random order regardless of which target the step comes from, respecting the target dependencies.
We ended up filtering out the following subSteps
from each target
CopyPlistFile
CopyStringsFile
CpHeader
CpResource
Ditto
MkDir
PBXCp
ProcessProductPackaging
RegisterExecutionPolicyException
Touch
WriteAuxiliaryFile
and recomputing the target build timestamps from the remaining subSteps
but the target trace is still all over the place.
@biboran Could you share how you went about filtering those substeps? I don't see any option in XCLogParser
to apply a filter.
@CraigSiemens I'll take a look at it. Just to clarify, are you using the new build system or the legacy one? Does your project only contains Swift code or do you have Objective-C as well?
@ecamacho I am seeing this issue as well.
- We use the new build system
- We have Objective-C but most of the code (90%) is swift
- We use CocoaPods and have more than 100 pods
For some reason when doing a clean build I am getting almost 15K different targets in the report, which makes the timeline unreadable. This is not happening for incremental builds--in that case I can see higher level targets (one for each pod).
Looking into the targets.js
file I've seen that for every Pod we get all these steps as different targets:
- CreateBuildDirectory PodName
- CreateDirectory PodName.framework
- Write PodName.hmap
- Write PodName-project-headers.hmap
- Write PodName-own-target-headers.hmap
- Write PodName-all-target-headers.hmap
- Write PodName-generated-files.hmap
- Write PodName-all-non-framework-target-headers.hmap
- Process PodName-Info.plist
- Copy PodName-umbrella.h
- Write PodName.SwiftFileList (x86_64)
- Write PodName.LinkFileList (x86_64)
- Write PodName-OutputFileMap.json (x86_64)
- Write PodName_vers.c
- Copy PodName.swiftsourceinfo (x86_64)
- Copy PodName.swiftsourceinfo (x86_64)
- Copy PodName.swiftmodule (x86_64)
- Copy PodName.swiftmodule (x86_64)
- Copy PodName.swiftdoc (x86_64)
- Copy PodName-Swift.h (x86_64)
- Compile PodName_vers.c (x86_64)
- Compile PodName-dummy.m (x86_64)
- Create static library PodName (x86_64)
- Sign PodName.framework
- Touch PodName.framework
Am I doing something wrong when generating the report? Do you know if there is a way I can aggregate all those targets into one higher level target?
- New build system
- It's all swift
I tried looking at the dump output (I don't really know wha I'm looking for) but it seems like it's these two subsections that are added for every target at the very start of the build.
{
"sectionType" : 2,
"unknown" : 0,
"timeStartedRecording" : 666294631.747679,
"subtitle" : "",
"timeStoppedRecording" : 666294631.748016,
"messages" : [
],
"wasFetchedFromCache" : false,
"title" : "Create directory Headers",
"domainType" : "com.apple.dt.IDE.BuildLogSection",
"signature" : "MkDir \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework\/Headers (in target 'NeoCore' from project 'Neo')",
"isQuiet" : false,
"text" : "",
"subSections" : [
],
"location" : {
"documentURLString" : "",
"timestamp" : 0
},
"commandDetailDesc" : "MkDir \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework\/Headers (in target 'NeoCore' from project 'Neo')\r cd \/Users\/neo\/Developer\/neo\/neo-ios\r \/bin\/mkdir -p \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework\/Headers\r",
"uniqueIdentifier" : "77041C0A-AAC2-42BA-A34D-95B34A15CFC4",
"wasCancelled" : false,
"localizedResultString" : "",
"xcbuildSignature" : "3835653266323330343763323965316534363365646133363130306639653238"
},
{
"sectionType" : 2,
"unknown" : 0,
"timeStartedRecording" : 666294631.74784195,
"subtitle" : "",
"timeStoppedRecording" : 666294631.74799395,
"messages" : [
],
"wasFetchedFromCache" : false,
"title" : "Create directory NeoCore.framework",
"domainType" : "com.apple.dt.IDE.BuildLogSection",
"signature" : "MkDir \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework (in target 'NeoCore' from project 'Neo')",
"isQuiet" : false,
"text" : "",
"subSections" : [
],
"location" : {
"documentURLString" : "",
"timestamp" : 0
},
"commandDetailDesc" : "MkDir \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework (in target 'NeoCore' from project 'Neo')\r cd \/Users\/neo\/Developer\/neo\/neo-ios\r \/bin\/mkdir -p \/Users\/neo\/Library\/Developer\/Xcode\/DerivedData\/Neo-hiuevzrflvndutcilgcszphwztqy\/Build\/Products\/Local-iphonesimulator\/NeoCore.framework\r",
"uniqueIdentifier" : "83AE19FF-8766-4ED0-9A98-C7F692321462",
"wasCancelled" : false,
"localizedResultString" : "",
"xcbuildSignature" : "3432353337613638613139663638303161343032646437393136623862346138"
},