MobileNativeFoundation / XCLogParser

Tool to parse Xcode and xcodebuild logs stored in the xcactivitylog format
Apache License 2.0
1.73k stars 121 forks source link

xcactivitylog is not generated #16

Closed aronpammer closed 4 years ago

aronpammer commented 5 years ago

This is not exactly an issue with the xclogparser, but with xcodebuild. Whenever I build within Xcode I get the xcactivitylog file, however if I delete derived data folder, then build with xcodebuild the log is just not there. (We use a fresh VM for every new CI build) If I rerun xcodebuild (so I rebuild) the xcactivitylog is generated.

Did you encounter this issue before?

ecamacho commented 5 years ago

I haven't seen it. Is there a LogStoreManifest.plist file generated in the Logs/Build folder? You can run xclogparser manifest --project MyProjectto check it. Do you run xcodebuild with the -derivedDataPath option?

aronpammer commented 5 years ago

Yes the manifest is there, but it does not have any entries. I do set the derivedDataPath.

I had some success by adding -resultBundlePath '/Users/jenkins/derived_data/resultbundle' and this way I get an xcactivitylog file, but that file parsed with xclogparser produces a totally different json output. (there are no module targets with substeps, there are no steps with cCompilation detailStepTypes, etc.)

ecamacho commented 5 years ago

@aronpammer I got the same issue when running xcodebuild for archive (-exportArchive). For some reason the logs are not generated in that way. Are you by any chance using the same option?

aleksandergrzyb commented 4 years ago

I hit similar problem. 😞 Building directly with Xcode generates .xcactivitylog file with details such us how many seconds was taken to compile some specific module, but using xcodebuild directly (xcodebuild test -workspace <workspace> -scheme <scheme> -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.1' OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies") produces different result which is more noisy (for example you can't see how long it took to build some module).

Could you share which options of xcodebuild command do you use in order to get as detailed .xcactivitylog as building directly in Xcode?

ecamacho commented 4 years ago

@aleksandergrzyb we don't do anything special to generate the logs with xcodebuild. What do you mean you don't get how long it took to build some module? Is the module missing from the log, or the time is not available?

ecamacho commented 4 years ago

@aleksandergrzyb, @polac24 was able to reproduce your issue with Xcode 11.1. I found a fix to generate a complete log with xcodebuild by providing the option -resultBundlePath

Something like this should work in your case:xcodebuild test -workspace <workspace> -scheme <scheme> -destination 'platform=iOS Simulator,name=iPhone 8,OS=13.1' -resultBundlePath results_bundle OTHER_SWIFT_FLAGS="-Xfrontend -debug-time-function-bodies"

Mind that this will create a folder called results_bundle so probably you will need to put it in a path that can be cleaned once you CI job finishes

aleksandergrzyb commented 4 years ago

Thanks!