33

Since I'm using Xcode 10.0, the amount of tasks which Xcode is building increases every time when I build the project. To reset the amount of tasks I have to clear the project. Can anyone else retrace this issue? The main problem is, that the build time increases with the amount of tasks.

Build 2

Build 1

EDIT

Same behavior in Xcode Version 10.1 (10B61)

PascalS
  • 975
  • 1
  • 16
  • 40
  • 1
    I would assume cyclical dependencies with many generics. Did you try to switch compilation mode from "Incremental" to "Whole module"? – Sulthan Nov 10 '18 at 21:19
  • Not yet! How can I do it? – PascalS Nov 10 '18 at 21:34
  • Go to Build Settings and insert in search field 'SWIFT_COMPILATION_MODE'. – Oleg Dec 09 '18 at 21:25
  • 1
    That does change my amount of tasks from 3500-ish to 24. So seems good. But I would still like to understand the issue, you have some ideas? – Gertjan.com Feb 13 '19 at 10:24
  • For me, there is no effect after changing to "Whole module". Understanding the issue can help. – Bhavin_m Apr 25 '19 at 12:36
  • This still happens in Xcode 11.7 and it is unlikely because of cyclical dependencies. It happens on the default "command line" project with either Swift or C++. Just add a newline to the main source file, hit build and the number goes up. – Tomas Andrle Sep 10 '20 at 21:16

2 Answers2

6

enter image description hereXcode 10 introduced a new build system, and it's not without bugs. I was able to reproduce the ever-increasing task count the same way you did. That's a lousy bug! release_notes To fix it search "User Header search paths" in build setting, and set it as NO

Rishi Indolia
  • 176
  • 2
  • 6
  • I have edited my answer, now you can find a picture for this setting – Rishi Indolia May 22 '19 at 06:10
  • 1
    I tried this solution in Xcode 11.1(11A1027) and the long total build time didn't change and the number of tasks still increased from time to time. – inexcii Oct 18 '19 at 01:35
  • It is not a Bool to set. According to Documentation, This is a list of paths to folders to be searched by the compiler for included or imported user header files (those headers listed in quotes) when compiling C, Objective-C, C++, or Objective-C++. Paths are delimited by whitespace, so any paths with spaces in them need to be properly quoted. See `ALWAYS_SEARCH_USER_PATHS` for more details on how this setting is used. If the compiler doesn't support the concept of user headers, then the search paths are prepended to the any existing header search paths defined in `HEADER_SEARCH_PATHS`. – Ram Gandhi Nov 04 '20 at 15:25
1

Rishi Indolia's answer in conjunction with disabling the automatic reloading of views in the storyboard is what did it for me.

disabling the automatic reloading of views in the storyboard

aclima
  • 630
  • 1
  • 11
  • 20