Describe the bug
Building of some packages on remote hosts fails. The affected packages produce no terminal output for long periods of time and thus the SSH connection gets closed for inactivity.
To Reproduce
Steps to reproduce the behavior:
qtwebengine with -j0, to force remote build
Jan 05 13:33:52 SERVER systemd-logind[785]: Session 17 logged out. Waiting for processes to exit.
Jan 05 13:33:52 SERVER systemd-logind[785]: Removed session 17.
Jan 05 13:33:55 SERVER nix-daemon[2645]: unexpected Nix daemon error: writing to file: Broken pipe
client_loop: send disconnect: Broken pipe
error: unexpected end-of-file
builder for '/nix/store/9qskm7w05npz9vsh4r65dsjk11yvwi8m-qtwebengine-5.15.2.drv' failed with exit code 1
cannot build derivation '/nix/store/xkr3cs62lf4lbi9bdswl7nsvbjcfwcv6-zoom-us-5.4.53350.1027.drv': 1 dependencies couldn't be built
...
```
Expected behavior
No manual workarounds on SSH configs for remote building. nixos-rebuild -j 0 should always work, as long as there is a network connection.
Maybe nix could send some sort of heartbeat packets over the same connection?
# nix-env --version
nix-env (Nix) 2.3.10
# nixos-version
21.03.git.014440d7105 (Okapi)
SSH can already do this, see the ServerAliveInterval and TCPKeepAlive options in ssh_config.
I know remote builds are kinda high-level, but it still is bad UX. I love the deterministic approach nix's ecosystem takes, and this doesn't feel right, since the only exhausted resource is a ssh/tcp heartbeat.
If you think everybody should solve this on his own, feel free to close this ticket.
p.s.: since it's my first interaction with @edolstra: Thanks for (starting) nix and the ecosystem around it!
Most helpful comment
SSH can already do this, see the
ServerAliveIntervalandTCPKeepAliveoptions inssh_config.