Skip to content

fix(ci): replace --no-build with disk cleanup for nix-validate#299

Merged
JacobPEvans merged 2 commits into
mainfrom
fix/nix-validate-disk-cleanup
May 11, 2026
Merged

fix(ci): replace --no-build with disk cleanup for nix-validate#299
JacobPEvans merged 2 commits into
mainfrom
fix/nix-validate-disk-cleanup

Conversation

@JacobPEvans
Copy link
Copy Markdown
Owner

Summary

Why

#298 added `--no-build` to keep the ubuntu-latest runner from exhausting disk on darwin source substitution. That worked for nix-home (its module-eval was made lazy in JacobPEvans/nix-home#234), but broke nix-darwin and nix-ai checks that reference derivation outputs across platforms:

```
error: path '-inputs' is not valid
error: path '-wrap-claude-command-…drv' is not valid
```

`--no-build` disables substitution context realisation, which those checks legitimately need.

Switch strategy:

Universally compatible with existing consumer checks — no per-repo changes needed.

Test plan

  • After merge, re-trigger CI on nix-darwin #1091, nix-ai renovate PRs, nix-home renovate PR — Nix Validate should pass
  • No new "No space left on device" failures

Assisted-by: Claude noreply@anthropic.com

PR #298 added `--no-build` to keep the linux runner from exhausting disk on
darwin source substitution. That worked for nix-home (whose module-eval was
made lazy in a follow-up PR), but broke nix-darwin and nix-ai checks that
reference derivation outputs across platforms — `--no-build` disables the
substitution context realisation those checks rely on, producing:

    error: path '<hash>-inputs' is not valid
    error: path '<hash>-wrap-claude-command-...drv' is not valid

Switch strategy: keep `--all-systems` (so darwin-only broken packages are
still caught at evaluation) but drop `--no-build` and free ~30GB on the
runner via jlumbroso/free-disk-space (Android SDK, .NET, Haskell, Docker
images). Tool-cache (Node/Python/Go) and large-packages stay intact for
other workflow steps.

Universally compatible with existing consumer checks. No per-repo changes
needed.

Assisted-by: Claude <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings May 11, 2026 21:18
@gemini-code-assist
Copy link
Copy Markdown

Note

Gemini is unable to generate a summary for this pull request due to the file types involved not being currently supported.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the reusable Nix validation workflow to restore full nix flake check --all-systems behavior (including substitution/realisation needed by downstream checks) while mitigating GitHub-hosted runner disk exhaustion by freeing space prior to installing Nix.

Changes:

  • Adds a “Free disk space” step (via jlumbroso/free-disk-space) before Nix installation to reclaim ~30GB on ubuntu-latest.
  • Removes --no-build from the nix flake check --all-systems invocation and updates the surrounding rationale comments.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread .github/workflows/_nix-validate.yml Outdated
Comment thread .github/workflows/_nix-validate.yml
Address Copilot review feedback on #299:
- Pin jlumbroso/free-disk-space to v1.3.1 (SHA 54081f138730…) instead of
  @main. The action is outside renovate-presets.json trusted orgs, so SHA
  pinning is required.
- Gate the step with `if: startsWith(inputs.runner_label, 'ubuntu-')` so
  self-hosted runners (RunsOn, etc.) are never touched. Removing
  preinstalled components on a long-lived self-hosted runner would damage
  shared state.

Assisted-by: Claude <noreply@anthropic.com>
@JacobPEvans JacobPEvans merged commit 257aebe into main May 11, 2026
2 checks passed
@JacobPEvans JacobPEvans deleted the fix/nix-validate-disk-cleanup branch May 11, 2026 23:16
JacobPEvans added a commit that referenced this pull request May 11, 2026
`nix flake check --all-systems` attempts to BUILD outputs for every declared
system, not just evaluate. For repos whose checks are pkgs.runCommand
derivations (nix-darwin: module-eval; nix-ai: wrap-claude-command, gemini-
policy, fabric-patterns-marketplace, maestro-cli, pal-mcp-server, plus the
check-* derivations) building cross-platform on the linux runner fails with:

    error: Cannot build '<hash>-X.drv'.
           Reason: platform mismatch
           Required system: 'aarch64-darwin'
           Current system: 'x86_64-linux'

Disk cleanup (introduced in #299) doesn't address this — platform mismatch
is a build-time issue, not a space issue. --no-build (introduced in #298)
broke substitution context for input flakes, producing "path is not valid"
errors elsewhere.

Solution: add an `all_systems` boolean input (default true) so consumers
opt-out per-repo. nix-home keeps the default (its module-eval was made
platform-aware so it works with --all-systems). nix-darwin and nix-ai
should set `all_systems: false` in their ci-gate workflow caller.

The free-disk-space step is now gated on `all_systems && ubuntu-*` since
disk pressure only happens when substituting cross-platform closures.

Assisted-by: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants