jayatubi
jayatubi

Reputation: 2212

Is there any way to make Xcode 7.3 and above support distributed build among multi Mac devices?

I'm in an iOS development team with about 10 mates. All of us are using the Mac devices in a 1Gbps lan so I'm wondering is there anyway we can distributed build the project:

  1. When someone starts to build the project, it could auto connect to other Mac devices and distribute the compile unit. Just like distcc.
  2. The parallel build job counts could beyond the host's cpu cores. For example it could compile more than N, maybe N * 2, files simultaneously on different clients even the host only has N cpu cores.

I've googled a lot of about this but all the articles seem to be out of date. Any solution for the latest Xcode 7.3?

Upvotes: 5

Views: 4240

Answers (2)

Motti Shneor
Motti Shneor

Reputation: 2194

My answer is: You do not need this facility anymore, and it was removed for a reason.

Distributed builds are of benefit, and even necessity in certain build-tool-chains, and in certain projects, when the combination of the sheer size of code, coupled with slow compilers, linkers, and other tool-chain players, and when the toolchain's ability in identifying dependencies, and tracking changes forbids partial and differential builds. In other words... any reasonably large project on Visual-Studio for Windows... (joke - there are worse).

However, when you use Latest (currently v10.3) Xcode with its toolchain, employing the llvm + CLANG toolchain, for developing iOS programs --- the normal build time, on a mediocre Mac, will NOT exceed 2-3 minutes unless you're doing something really stupid in your project file.

In my last (highly complicated!!!) projects each with dozens of internal libraries and dependencies, I managed to have clean+build times far below one minute, and most regular iterative builds - well below 10 seconds.

In such cases- there is no real benefit for the VERY complicated system of distributed builds.

There IS of course a good cause and use for REMOTE builds - such that occurs completely on a single computer, but not yours. This is very useful for "official" "Build-machine" scenarios, and for long test-runs that occur on the hosting "build server". This is, of course, supported by today's Xcode.

But my real point here is - If build-times nag you --- go ahead, and review your project's structure.

Do you use arcane dependency-insertion mechanisms like home-brew, cocoa-pods etc? Maybe you're using a "meta" development system on top of the iOS ecology? (Unity? Mono? Cordova?) Do you employ external toolchains via shell-script build steps? Do you have lots of broken dependencies, that force you to build everything from scratch every time?

All these have cures, and can be done with some care, to the benefit of not only your build-times, but also the robustness and size of the built product, the ease of extension and maintainance and the portability of your code-base into the future.

Upvotes: -2

l'L'l
l'L'l

Reputation: 47274

Xcode previously had a "Distributed Build" feature before version 4.5, and was subsequently removed. The standard Apple way of doing such things nowadays is usually via "Continous Integration" (bots), which would normally be run from an Xcode Server environment. That's more than likely not what you're looking for, since it deviates quite a bit from the idea of simply having client computers on a network sharing a build task.

The good news is there is an active github project called DistCode - (Distributed Compilation For Xcode) that does use the former Apple component distcc, which does seem to work with the current version of Xcode (7.3.1 / Apple LLVM version 7.3.0 clang-703.0.31).

Upvotes: 5

Related Questions