Skip to content

ci(nix-build): librefang-cli job repeatedly fails with 'Nix daemon disconnected unexpectedly' (runner disk exhaustion) #6081

Description

@houko

Symptom

On the push-to-main run for #6075 (run 27277064565), both nix build matrix jobs failed ~50 minutes in with:

error: Nix daemon disconnected unexpectedly (maybe it crashed?)

After gh run rerun --failed, librefang-desktop passed but librefang-cli failed a second time with the identical signature — so this is not a one-off flake.

Diagnosis

The same merge commit's CI run hit System.IO.IOException: No space left on device on another ubuntu-latest runner (Test / Ubuntu (shard 2/4), run 27277064497, which passed on rerun).
ubuntu-latest ships with only ~14 GB of free disk; a full Nix build of the 24-crate workspace plus its /nix/store closure exceeds that, and the nix-daemon is killed when the disk fills — which surfaces as the "disconnected unexpectedly" error.
The cache-nix-action GC cap (gc-max-store-size-linux: 5G) only bounds the cached store, not peak build usage.

Fix

Add a pre-build step to .github/workflows/nix-build.yml that removes the large preinstalled toolchains the job never uses (dotnet, Android SDK, GHC, CodeQL bundle, docker images) — frees ~25 GB without pulling in a third-party action.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/ciCI/CD and build toolingarea/cliCLI and TUI interfacehas-prA pull request has been linked to this issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions