Nocc – A Distributed C++ Compiler
20 comments
·February 11, 2025malkia
null
bobmcnamara
We discovered that while incredibuild did trap the system calls needed to stream and cache files from the building computer, at the time they did not trap Beep()!
malkia
ha! we've used it really long time ago, and there was something a bit non-standard with their C++ pre-processor, back then it wasn't working with one of our macros, and by the way they were displaying messages, and later searched these message in their binary I think I've found pascal-like strings (e.g. byte or word with length, then characters), so I thought it might've been written in Borland/Delphi Pascal?
jcelerier
From the README this tool has been built because distcc was too slow
menaerus
distcc was really slow IME as well. It did not know how to optimally distribute the work across different build nodes. AFAIR distcc simply assumed that all build nodes are created equal and it also disregarded the load on the nodes resulting in over-saturation with build jobs.
However, this is something that icecream aimed to solve, and in my case it really did. I can't remember the actual numbers but it provided a major gain and it was super easy to set up.
So I guess it would be more nteresting to see how nocc compares to icecream instead of distcc.
gjvc
Yes. This makes sense.
gjvc
Just listing these without any form of comparison is useless.
nasretdinov
The funny thing about the name of the tool is that it's essentially named after a PHP linter I wrote while working at VK, called NoVerify. I did an internal poll for the best name, and noverify won, because the way to skip the checks done that linter was "git push --no-verify"...
mappu
Thank you for noverify! We used it at $DAYJOB in CI.
sixthDot
Would you say that this tool is required because cpp is slow to compile or is it still useful even with a module system (or whatever would make it a fast-to-compile-proglang) ?
o11c
It looks like there are some infelicities documented that really should be fixed:
* fix that silly "got another sha256" bug, it really shouldn't be hard
* optimal job count should be infinite from the perspective of the client's `make`, but the daemon should only send jobs to the servers based on how many jobs they are willing to perform in parallel. Possibly split out the "upload blobs" part from the "actually run the build" part?
* You should detect compiler version differences, which is essential for reliability. This is nontrivial (wrapper scripts, internal headers) but good solutions exist if you're willing to hard-code what compilers are supported.
null
MathMonkeyMan
Neat! I remember using [something similar][1] at a previous job.
o11c
That appears to only handle the distcc half. It looks like the main advantage of nocc is that it integrates the equivalent of ccache, in a way that works even when there are both multiple clients and multiple servers, without the ludicrous complexity of bazel-like tools.
menaerus
Not true. icecream handles that case very well. Any machine in the network can trigger the build. And all the machines in the network can register themselves as build nodes. It also integrates with the ccache.
7e
Did the authors also write their own operating system to avoid the “ludicrous complexity” of the Linux kernel? This project just looks like NIH syndrome and an unwillingness to read documentation.
7e
Why not just use Bazel?
jcelerier
How do I do if I want to make something with bazel that is going to use libraries on the host computer? Say, I want to make an app that builds against system-provided Qt6, does Bazel finally allow this?
malkia
Haven't tried it, but you can always `cc_import` a locally installed library and expose it - though not sure how this works across the wire...
Then again, this might be all asking for trouble - what if your colleague has different installed version. Best is to have these artifacts (recompiled and/or in source form) some other way.
Some other alternatives, also haven't hearded about this one:
I've had mostly experience with IncrediBuild in the past, currently SN-DBS, but colleagues are looking into FASTBuild. Though my personal favorite is bazel