Nix-rebuild takes hours

11th Gen Intel(R) Core™ i7-1165G7 @ 2.80GHz , 4 cores
16 GiB RAM
NixOS Channels
home-manager https://github.com/nix-community/home-manager/archive/release-24.11.tar.gz
nixos nixos-24.11 release nixos-24.11.714486.0b73e36b1962
I have started a rebuild with the following command:

sudo nixos-rebuild test --no-build-output  --verbose  1> nixosRebuild.out 2> nixosRebuild.err

For several hours nodejs-22.14.0.drv is being build. These are the last lines in the nixosRebuild.err; the file has not changed for several hours:

  /nix/store/yj98ap178b16l3agfjh7amj8cxlfdhk8-user-units.drv
  /nix/store/hj34wvy27ylfr3v9pqk4p2g4mfjawl0s-etc.drv
  /nix/store/gj7mcvq6ic4w56nb31mdk5mpl6qg9qdi-nixos-system-unendlich-24.11.714486.0b73e36b1962.drv
building '/nix/store/dcwvlcdh58ngx0g0qw42k940nplz4a09-nodejs-22.14.0.drv'...

nmon shows many cc1plusprocesses for example:

cc1plus -quiet -I /nix/store/06q0p7bhn2ffxxya20rrfqdib3h32csn-zlib-1.3.1-dev/include -I /nix/store/llwfx8zsw3n474wlkwyhm3wl223d68vm-libuv-1.48.0-dev/inclu...

Any idea how many hours or days building will take?
What can I do?

Current nixos-24.11s tip has a failing build for NodeJS 22. So it will very likely fail on your end eventually as well.

Please revert your channels.

Thanks for your help @NobbZ

Had the same thing with nodejs_22 Yesterday but my build succeeded.
Here’s the failing build from Hydra Hydra - nixos:release-24.11:nixpkgs.nodejs_22.x86_64-linux

It looks like some test is failing but I don’t understand why.

There’s also this issue about the build failure, but it’s specifically about Macs and I’m not sure if it’s the same Build failure: nodejs_22 on x86_64-darwin · Issue #350410 · NixOS/nixpkgs · GitHub

The problem still persists: this time compiling Telegram does not end:

cc1plus -quiet -I /build/source/build/Telegram/Telegram_autogen/include -I /build/source/Telegram/SourceFiles -I /build/source/Telegram/ThirdParty/tgcalls
...

The stable channel does not seem to be so stable.

The telegram-desktop build failed because the builder run out of disk space: Hydra - Log of step 1 of build 290051957 of job nixos:release-24.11:nixpkgs.telegram-desktop.x86_64-linux.

It’s not first time I’ve seen this happen. Can someone from the infra team could comment on this?

After about 4 hours telegram compilation succeeded.

Yes, the build was manually restarted.

Anyway, I’ve reported the problem and it should have been mitigated: it was caused by not enough memory allocated to /tmp on tmpfs and old build artifacts piling up.