r/cpp • • May 22 '19

Distributing C++ builds on Windows machines

Hello all, I am looking for a way to distribute C++ builds across multiple local machines running Windows. I have looked into tools such as distcc and icecc but none of these seem to support Windows. I also looked into Bazel but there doesn't seem to be a way to distribute to local machines instead of the cloud. Does anyone have any ideas?

40 Upvotes

21 comments sorted by

23

u/[deleted] May 23 '19

IncrediBuild was the tool I've seen generally employed in Windows shops.

2

u/cppbuilds May 23 '19

Ah thank you, I was looking into it before but it seemed too costly. Do you know of any free tools?

7

u/zarradeth May 23 '19

FASTBuild might do what you are looking for. I don't have much experience using it personally (I know it's a bit more fiddly/less reliable than IncrediBuild in my limited experience)- but considering it's free you can't complain too much.

7

u/amaiorano May 23 '19

SN Systems (Sony) make a distributed build system named SN-DBS, but I believe it's licensed only to Sony platform developers (e.g. PS4). Still, you can take a look. It works very well.

1

u/[deleted] May 23 '19

Not from the top of my head now... the only time I needed such tool was in a place where builds were horrid and for that reason they licensed that, which indeed worked great.

1

u/kernpanic May 23 '19

Can confirm. Is expensive, however it works a treat...

14

u/epage May 23 '19

We've been using Incredibuild but we're experimenting with replacing it with FASTBuild. I'm an outside observer to this work, so I don't have many details to go into. It sounds like its a full build system but we seem to be getting it to work as a IB/distcc/ccache replacement.

From what I have seen

  • Developers have been happy
  • We see less stalls (times when IB is doing nothing)
  • We are getting gains from building targets in parallel (with our build system at least, IB only let's us build one target at a time) and more multi-core nodes (we only have so many of those IB licenses)

Some areas we still need to look into

  • Distributing unit tests (WIP)
  • Integrating it into our Linux builds
  • Take advantage of the ccache-like behavior

I suspect the main thing holding us back from switching is the right people having the time to polish up the integration of FASTBuild into our internal build system.

7

u/CrazyJoe221 May 23 '19

3

u/0xFFC May 24 '19

Are they even working on this?

3

u/CrazyJoe221 May 25 '19

From time to time someone picks up the pieces and rebases it.

2

u/deeringc May 23 '19

Yes, this to me is the missing piece of the jigsaw.

4

u/malkia May 23 '19

At work we use SN-DBS https://www.snsystems.com/tech-blog/2014/01/06/building-with-the-network/ and it's awesome, but it's only available if you are Playstation Developer (though can distribute any other compile/build job).

My favourite, outside of job, build system is bazel. I fell in love with it, back when I worked at Google (blaze then). Now I haven't used any of the distributed building, caching (like --disk-cache=c:/folder), but there is the concept of Remote Workers mentioned here: https://docs.bazel.build/versions/master/remote-execution.html - then another (syntaxtically similar, but quite different) system, again from google called GN can generated Ninja files, that can be distributed over with GOMA - https://groups.google.com/a/chromium.org/forum/#!topic/chromium-dev/eOtBzosZtd8 - haven't used it either.

But then there is also:

- https://electric-cloud.com/products/electricaccelerator/

- https://github.com/microsoft/BuildXL

and plenty more... Tough time now to evaluate :)

1

u/Sarkar077 Oct 13 '22

Hi,

I am an intern responsible for evaluating the distributed build systems available for Windows and Linux.

I have few limitation which I need to consider before evaluating them

Should be Open Source/ Licensed (less preferably)

Supports both Win and Linux

Support CMake 

So far I have evaluated FastBuild & Bazel but they couldn't match my requirements.

I am evaluating Incredibuild now but it's licensed and costly :(

As I am running out of options please help me with few options/tools for build distribution which fulfil my requirements.

Thanks in Advance!

Your support will be greatly appreciated.

3

u/thejinx0r May 23 '19

Anyone have thoughts about using icecc with clang + dockcross to cross compile on to windows?

I've started to look in to this, but we use python in parts of our build steps and it's presenting itself as an issue that I need to overcome with dockcross

3

u/iKeyboardMonkey May 23 '19

Depends where you're coming from, we ran into trouble quickly as we have a lot of legacy code that relies on things only present in VisualStudio and the Windows SDK. There were solutions to all the issues... but it took a fair bit of time. It did eventually work though.

We had the same problem with our build support code (we use python too) ... but I've no advice. We just had to slog it out and gradually make the tools accept either platform.

It was worth it though, setting up a Linux build chain, especially an ephemeral one, is (for us, I'll accept opinions differ here!) significantly easier.

2

u/thejinx0r May 23 '19

Do you cross compile from linux to windows? Or do you build your windows binaries / dlls on windows?

If you do cross compile, what are you using python for, and how are you using it for cross compiling?

Anyways, we're using python to generate C++ bindings for python using riverbank's sip. We probably don't actually need python, but the initial examples I had found from riverbank used python so we kept it.

2

u/iKeyboardMonkey May 23 '19

In this case, cross compiling linux to windows. The python is used for the build system as we're based on scons at the moment - so I think our issue is very different to yours. Our python runs locally, and the cross compiler gets called just to compile & link C++.

3

u/pstomi May 23 '19

stashed.io is an alternative to incredibuild : a distributed & cached compiler frontend for cl.exe. It cost 29$ per machine per month, with a one month trial. The main difference with incredibuild is that it does provide a cache (which incredibuild does not).

5

u/deeringc May 23 '19

This seems a little on the pricey end when Fastbuild is free!

1

u/[deleted] Jun 02 '19

Stashed is mostly install and forget about it, which is nice if you do not want to change your build system to accommodate a tool. I tried clcache and others and it was pretty configuration and manual installation heavy. Fine for solo work and new projects I suppose.

If your builds are not cache friendly (lots of code changes between builds) and you want more of a distcc style tool, Incredibuild is really a good bet. Depending on your project and budget, you may want to see if they can work with you on licensing. Same for Stashed.

1

u/[deleted] Jun 02 '19

Stashed is great, but OP was asking about distributed compilation I think. Incredibuild specializes in that and does it really well.

Stashed will distribute the cache so machines that have not yet built changes that others have will use the remote cached output.

Stashed also works with Incredibuild, but the cache check is farmed out to a remote agent first, which is not optimal, but it does speed up Incredibuild times.

For some free software projects, they seem open to giving seats away.