Distcc – distribute builds across multiple machines simultaneously (2006)
distcc.github.io
distcc.github.io
- local caching (like ccache)
- remote caching e.g. to S3, or a LAN redis instance (unique afaik)
- distributed compilation of C/C++ code (like distcc, icecream)
- distributed compilation of Rust (unique afaik)
- distributed compilation on Windows by cross compiling on Linux machines (unique afaik)
Note that I think bazel also does a bunch of these, but you need to use bazel as your build system.
[0] https://github.com/mozilla/sccache
[1] quickstart - https://github.com/mozilla/sccache/blob/master/docs/Distribu...
[2] reference docs - https://github.com/mozilla/sccache/blob/master/docs/Distribu...
I think that if you’re reading a suggestion to “just use X” on Hacker News, the sensible thing to do is to evaluate the suggestion for your own. You don’t need to put a long list of caveats in front of every software recommendation. If your problem is, “My builds are slow, I want distributed builds,” then you should probably at least consider the two most popular solutions to that problem, which are Bazel and Distcc. Both with their drawbacks.
In that case you can run the build on the target CPU, but instead of calling gcc locally it calls distcc pointing to a cross compiler installed on a fast machine. This can be useful if you are compiling a bunch of packages from a distribution.
Also interesting to read: https://github.com/StanfordSNR/gg
In principle, it was a good use-case with a highly modular structure and a clearly defined but chunky build graph.
In practice, it did work, but throwing more hardware at the problem on a single host turned out to be faster than the existing distcc setup and had much reduced operational complexity.
We could probably have tuned it further with distcc plus the new hardware, but we achieved the performance target we were looking for.
One thing people always overlook though with distcc is that while you compile remote, you always link local. That was the bulk of our build time and wasn't the fault of distcc. Object files would come at lightning speed (compared to pure local build) but linking was still non-trivial.
These days I'd bet a modern AMD would beat distcc in our situation due to latency times.
I had two machines, one running Gentoo, one running Windows, and I would use distcc to enable me to use the Windows machine to help boost the compilation speed of Gentoo. I can't remember where the documentation was, but http://wikigentoo.ksiezyc.pl/HOWTO_Distcc_server_on_Windows.... seems to do a good job of capturing the general concept.