Xcode 8 recompiles every file every build

Whenever I make a change to a file, like add a new property or create a new class, Xcode recompiles every single file on a build, and it takes quite some time. I've got this happening on the GM on two different computers (one running 10.12 one running 10.11).


I've tried:

  • copying every file to a new Xcode project created in Xcode 8 GM
  • removing every "Other swift flag" flag
  • removing all third party libraries
  • comparing my project's build settings to a new project's build settings
  • remove all test targets leaving just the one target I need
  • removing all ObjC code
  • removing all ObjC related flags


Really the kicker is that moving all my code to a new project shows that it's something in my code.

Any ideas? My productivity is way down having to wait ~ 1.5 minutes for every build / auto complete / syntax highlighting to work. And yes, I've cleared derived data 🙂



UPDATE:

One more peice of information, I found this information https://lists.swift.org/pipermail/swift-dev/Week-of-Mon-20160411/001693.html


which tells us about a "-driver-show-incremental" flag, which will cause queued dependancies to be listed in the build log. Sure enough I see what I think is every single swift file I have listed in the output. Trying to figure out if there's a way to make sense of what the dependancies are...


Output is something like:


...

Queuing Form.swift because of dependencies discovered later

Queuing SignInViewController.swift because of dependencies discovered later

Queuing EditProfileViewController.swift because of dependencies discovered later

Queuing ChangePasswordViewController.swift because of dependencies discovered later

Queuing JoinViewController.swift because of dependencies discovered later

...

Did you resolve it somehow? xcode 7.3 constantly crashes with this option on 😟

Sorry for the frustration. Would it be possible for you to provide us with your project attached to a bug report and instructions about a specific change in a file that reproduces the issue for you? If you post the bug report number here, I will escalate.

Thanks! I'm working on an example project that I can share that shows the issue. Will follow up.

Stil not resolved but I found this document https://github.com/apple/swift/blob/master/docs/DependencyAnalysis.rst that explains a little about how the dependencys work. It seems like there may be some scenarios you can work yourself into where things start getting more complicated and it's difficult for the compiler to determine what really depends on what. Working on making an example project that can easily reproduce the problem.

Hello


It seems this is an issue for our project as well, and from our testing, same project with Swift 2.3 seems that doesn't have this issue, testing with the same atomic changes.


What I noticed, is that full rebuild appears randomly, sometimes even without any changes at all! What is weird that using Swift compiler flag "-driver-show-incremental" shows queued .swift sources only in cases when actual dependency check happened, which is performed correctly (only changed file (and correct dependencies) is scheduled for building. In case where there is no debug output (despite using the flag) - entire project is rebuilt.

I can provide a build log if necessary (although due to relatively sensitive data, I would prefer to share it privately)

Any update to this? Our team is having the same issue and a 2-3 minute build time per change is nuking productivity 😟

Likewise with out company too

Bump


This is incredibly frustrating, spending a few hours more a day waiting for the compiler

Update:


Looks like cleaning the build folder and rebuilding solves the issue for a few builds but then the issue returns.

Same Question!!! it drives me crazy...

if you find solution..please let me know!

This is happening to me also. It is killing productivity.

Hove someone tested Xcode beta 8.1?

Good shout. I'm about to find out.

Have been running Xcode 8.1 beta for a couple builds now, it seemed to fix the issue. Will update if the problem keeps happening.


Edit: Nope. Still happening. After 10 builds or so it started recompile the whole app every time I pressed Build. Very frustrating.

Same problem.

Bump.

Xcode 8 recompiles every file every build
 
 
Q