Thought my old PC was looking lonely, decided to turn it into a distcc build server for Portage and my other compilation needs. Resulted in a noticeable speed boost.

For older/unused hardware, Linux is the gift that keeps on giving.  

#Linux #SelfHosting #programming #distcc #compilation #Gentoo

@piepants @nixCraft #distcc to the rescue to compile all those Gentoo programs across multiple laptops 25 years ago…

Pains of needing to use an older computer to work...

I am installing #distcc in my #android tablet so I can compile without needing to restart the computer because of freezes.

Fun times.

If you are wondering, this PC is a Inspiron 5421 (Modified to have an SSD and more RAM) and my tablet is a Samsung SM-P620.

Oh, and I also using tethering because the wifi does not support 5Ghz.

Man, I miss my other PC.

So, distcc lets you compile C or C++ applications on machines (or nodes) over the network, sharing the workload. But for the life of me I can't make it work from within a distrobox on the Steam Deck.

So I tried icecream (icecc), which is made by the SuSE folks. Not only does it work with distrobox, but it requires less configuration (just enable some systemd services or run the daemon) and everything Just Works. Having three machines + compiling projects with the --parallel flag should make even Qt compile quickly.

#c #cpp #cplusplus #distcc #distrobox #icecc #suse

Playing gentoo is also hard if you use powerbook g4 #distcc #ftw

The warm days are coming and it's time to pimp my laptop's #distcc configuration. I have switched to using a "distcJ" #ccache prefix command, which will mainly run distcc with dynamic options and some ad-hoc ones to keep my laptop responsive.

The local build machines are using a #systemd override for distcc service with:

```
[Service]
Environment="DISTCC_CMDLIST=/etc/distccd.commands"
PassEnvironment=DISTCC_CMDLIST
```
and I sent them a bunch of SDK compilers that I use for work and are now integrated in this whitelist.

But we need to do something about the fact that these commands are run in the exact same path as the remote user's: I don't want distccd to have access to my home directory.

I had build failures on #gentoo where sci-libs/lapack and others were failing to build due to a CMake check failing:

ld: CMakeFiles/VerifyFortranC.dir/main.c.o: in function `main': undefined reference to `VerifyFortran'

I had always been careful when using #distcc to specify the suffix of the compiler version to use, but this time I was beaten, there was an incompatibility even though the command line was the same...

Hard-to-notice compiler version mismatch, between my machine:

gcc version 13.2.1 20240210 (Gentoo 13.2.1_p20240210 p13)

and a #distcc machine:

gcc version 13.2.1 20231014 (Gentoo 13.2.1_p20231014 p10)

and for some reason this other machine was ok:

gcc version 13.2.1 20240113 (Gentoo 13.2.1_p20240113-r1 p12)

What I imagined would happen: I enable #DistCC on my weak laptop, it will pour compilation jobs on my Ryzen PC like crazy, keeping all 12 threads on boost 100% busy and finish webkit-gtk in no time.

What actually happened: the 4 laptop cores are 100% busy preprocessing and can't keep up delivering jobs to the Ryzen, and it is eating through them so fast it's barely busy.

Well, at least preprocessing doesn't take as much memory as the compiler, so things are actually progressing rather than getting stuck on swapping.

#Gentoo

Jak sobie to wyobrażałem: włączę #DistCC na cienkim lapku, zasypie stacjonarnego Ryzena kompilacjami, utrzymując 12 wątków z boostem na 100% obciążeniu, i skończy kompilować webkit-gtk w chwilę.

Jak wyszło w praktyce: 4 rdzenie laptopa są w 100% obciążone preprocesorem i nie wyrabiają z dostarczaniem zadań Ryzenowi, a ten je wykonuje tak szybko, że ledwie jest obciążony.

No cóż, przynajmniej preprocesor nie zużywa tak dużo pamięci jak pełna kompilacja, więc budowanie cały czas postępuje, zamiast zaciąć się na swapowaniu.

#Gentoo

@nixCraft Gentoo 20 years ago… having to learn #distcc