BuildTimeAnalyzer-for-Xcode icon indicating copy to clipboard operation
BuildTimeAnalyzer-for-Xcode copied to clipboard

No Valid Logs Found

Open bryan1anderson opened this issue 9 years ago • 27 comments

screen shot 2016-05-23 at 11 40 33 am

Everything seems to be working. I hit build, Build Time Analyzer updates and shows that a build is in progress, but it ends with Status: "No valid logs found"

I have verified that the two Swift flags have been added to the correct target, but still nada

screen shot 2016-05-23 at 12 05 13 pm

bryan1anderson avatar May 23 '16 18:05 bryan1anderson

Do you have more than one target in your project? If so, was the flags added to the one you are building?

RobertGummesson avatar May 23 '16 18:05 RobertGummesson

@RobertGummesson no, no other targets. Single target app and they were for sure added to the build settings of the correct target

bryan1anderson avatar May 23 '16 19:05 bryan1anderson

Just to rule out some possible scenarios, could you try this on another project and see if you have the same issue there?

RobertGummesson avatar May 23 '16 21:05 RobertGummesson

@bryan1anderson I just managed to experience a similar issue. In my case, I have been playing around with timezones and Xcode got confused when I had log files made in the future and refused to output the build time bodies.

I deleted all folders in the derivedData folder. After that it worked again.

RobertGummesson avatar May 27 '16 15:05 RobertGummesson

@RobertGummesson I have the same problem. When Im building, I see this

building

After the build completes, I see this

no logs

I followed your advice of deleting derived data. I tried running it on another simpler "New Project" and it worked. But it doesn't work on a larger project that I spend most of my time on. Do you have a troubleshooting list ?

Thanks for this plugin, It will be hugely useful to reduce my build times.

gprasant avatar May 31 '16 17:05 gprasant

In my case, there is a XCode 'project' and there are multiple XCode 'targets' under that project. I have the settings on the 'target' for my app. But it had the above behavior.

gprasant avatar May 31 '16 17:05 gprasant

@gprasant I'm afraid deleting derived data hasn't worked for me either

On Tue, May 31, 2016 at 11:31 AM gprasant [email protected] wrote:

In my case, there is a XCode 'project' and there are multiple XCode 'targets' under that project. I have the settings on the 'target' for my app. But it had the above behavior.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode/issues/30#issuecomment-222760957, or mute the thread https://github.com/notifications/unsubscribe/AHm2SeWOQghTVqaPj0pFsrnHksBGaDqNks5qHHBsgaJpZM4IkunT .

bryan1anderson avatar May 31 '16 18:05 bryan1anderson

🏆 . I went through my build settings more thoroughly and changed things and got the profiling to work.

gprasant avatar May 31 '16 18:05 gprasant

@gprasant - Great. What was missing?

@bryan1anderson

It would be useful to narrow down the scope of possible causes. Since I can't reproduce this myself, I will unfortunately need to rely on someone else to give me a hand debugging this.

If I had to guess, the problem is that the productName is not matching workspace name (line 46, CMXcodeWorkspace.swift). If not there, it would be interesting to know where it goes wrong.

To debug this, first build the project you have an issue with to ensure that the build log is created. Then do the following steps:

  • Download the plug-in source code
  • Configure the plug-in to run with Xcode. Edit Scheme. Then select the Run tab. Then under the Info tab, select Xcode as the Debug Executable.
  • Run the project. (This launches a second instance of Xcode)
  • Open up the project you have an issue with.
  • Do Ctrl-Shift B top open up the Build Time Analyzer.

Something is most likely going wrong in the function logTextForProduct() in CMLogProcessor.swift.

RobertGummesson avatar May 31 '16 18:05 RobertGummesson

@Gprasant any details that could be helpful to me? On Tue, May 31, 2016 at 12:32 PM gprasant [email protected] wrote:

🏆 . I went through my build settings more thoroughly and changed things and got the profiling to work.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode/issues/30#issuecomment-222778791, or mute the thread https://github.com/notifications/unsubscribe/AHm2SV4EawQ0pABXj1wfCivBiq1jrAuNks5qHH6zgaJpZM4IkunT .

bryan1anderson avatar May 31 '16 18:05 bryan1anderson

I'll get on that as soon as I can today and let you know what I find On Tue, May 31, 2016 at 12:33 PM Robert Gummesson [email protected] wrote:

@gprasant https://github.com/gprasant - Great. What was missing?

@bryan1anderson https://github.com/bryan1anderson

It would be useful to narrow down the scope of possible causes. Since I can't reproduce this myself, I will unfortunately need to rely on someone else to give me a hand debugging this.

If I had to guess, the problem is that the productName is not matching workspace name (line 46, CMXcodeWorkspace.swift). If not there, it would be interesting to know where it goes wrong.

To debug this, first build the project you have an issue with to ensure that the build log is created. Then do the following steps:

  • Download the plug-in source code
  • Configure the plug-in to run with Xcode. Edit Scheme. Then select the Run tab. Then under the Info tab, select Xcode as the Debug Executable.
  • Run the project. (This launches a second instance of Xcode)
  • Open up the project you have an issue with.
  • Do Ctrl-Shift B top open up the Build Time Analyzer.

Something is most likely going wrong in the function logTextForProduct() in CMLogProcessor.swift.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode/issues/30#issuecomment-222779175, or mute the thread https://github.com/notifications/unsubscribe/AHm2SduoNbFqygx0PwwbwqsO6WD_Tj_Hks5qHH8DgaJpZM4IkunT .

bryan1anderson avatar May 31 '16 18:05 bryan1anderson

Actually, before debugging the code, it may be worth just checking that the build times are being created properly by Xcode. The steps for manually looking at these are detailed in this post.

RobertGummesson avatar May 31 '16 18:05 RobertGummesson

my theory is that the compiler flags were not applied correctly at the first try. My build settings look like this :

screen shot 2016-05-31 at 11 43 12 am

When I added the compiler flags ( -Xfrontend -debug-time-function-bodies ), it did not get added to the leaf nodes in that tree (The ones that say 'Any Architecture | Any SDK' ). In my second try, I had to make sure the flags were set on the leaf nodes as well. It worked after that. @RobertGummesson is there a chatroom for this repo ?

gprasant avatar May 31 '16 18:05 gprasant

Thanks for sharing. ...and no, there is no specific chatroom set up for this repo.

RobertGummesson avatar May 31 '16 19:05 RobertGummesson

Having the same issue on a big project here, it:

  • It's a mix of swift and objc.
  • Uses CocoaPods.
  • Workspace and Target are the same name.

Any clue about it? Or do you know how can I debug it?

Thank you! (and thank you for this plugin, it's great! :D)

Lascorbe avatar Jul 26 '16 16:07 Lascorbe

Hi @Lascorbe

I've used it on projects using CocoaPods and a mix of Swift and Obj-C so at least that can be ruled out as a possible cause. To summarize some of the points you can try:

  • Ensure that the compiler flags are added to the appropriate nodes (as per @gprasant's post).
  • Ensure that what you are building matches the target you added the flags to.
  • Check if the build times are being created properly by Xcode (see my last comment from May 31)
  • Clean the project and then rebuild while the window is open.

RobertGummesson avatar Jul 26 '16 16:07 RobertGummesson

Hey @RobertGummesson!

  • [x] Ensure that the compiler flags are added to the appropriate nodes (as per @gprasant's post).
  • [x] Ensure that what you are building matches the target you added the flags to.
  • [x] Check if the build times are being created properly by Xcode (see my last comment from May 31)
  • [x] Clean the project and then rebuild while the window is open.

Looks like everything is fine but... I'm seeing the same as gprasant here

I'm gonna try different flags configurations and see if I can get it working.

Thank you for your help :)

Lascorbe avatar Jul 28 '16 09:07 Lascorbe

I have the same behaviour. I tried deleting the DerivedData folder contents but of no use. I have multiple targets in my application, and I added the flags in Build Settings of my project (not targets). In targets I have ($inherited) so they all got the flags.

preraksola avatar Aug 02 '16 09:08 preraksola

I have the same problem, in my case Derived data option is Relative so that BTA is not working and then I've changed this option to default that BTA is working, but I need to set the derived data option is Relative. Any idea?

hsleedevelop avatar Aug 23 '16 10:08 hsleedevelop

i have the same problem

d1248966459 avatar Mar 10 '17 02:03 d1248966459

Actually I ran into this because I had globally set the derived data folder to a custom location… so check your derived data path in your XCode > Preferences > Locations

klausbussekw avatar Apr 26 '17 16:04 klausbussekw

In my case I had my Unit and UI Tests in the App's Target. By setting only the App as a target, it should work.

build-time

leovido avatar Aug 21 '17 10:08 leovido

this issue backed again in 1.0.7 version. in 1.0.6 all ok. Tested with Xcode 9 GM

AnisovAleksey avatar Sep 20 '17 06:09 AnisovAleksey

@threat70 - Thanks for reporting. I just fixed it in v1.0.8.

RobertGummesson avatar Sep 20 '17 15:09 RobertGummesson

@RobertGummesson wow, so fast. Thank you :)

AnisovAleksey avatar Sep 21 '17 01:09 AnisovAleksey

Late to this party. For me, the solution was to restart BuildTimeAnalyzer and the logs show up.

davidbjames avatar Apr 20 '19 06:04 davidbjames

I was having these issues and decided to start debugging to see if I could figure out what the issue is. I haven't pin pointed the exact cause, but it does seem to be a timing/threading issue.

I put breakpoints in a few places and as I was stepping through the log processing bit I noticed it was working where it didn't work before. If I turn off the breakpoints it doesn't work again.

Here are the breakpoints that I used:

Screen Shot 2019-11-25 at 8 59 56 AM

If I figure out which of the background threads are stomping on which, I'll report back.

kmcginnes avatar Nov 25 '19 15:11 kmcginnes