Skip to content

Nix: speed up gateway builds and enforce cache-only CI consumers#57

Open
gumadeiras wants to merge 3 commits intomainfrom
codex/cache-speed-fix-safeguards
Open

Nix: speed up gateway builds and enforce cache-only CI consumers#57
gumadeiras wants to merge 3 commits intomainfrom
codex/cache-speed-fix-safeguards

Conversation

@gumadeiras
Copy link
Member

Summary

1. Build speed improvements where it matters most

Before, a large amount of time was spent in Nix fixup/cleanup and deep-copying node_modules.

Changes:

  • nix/packages/openclaw-gateway.nix
    • set dontFixup = true
  • nix/scripts/gateway-install.sh
    • changed deep copy (cp -r) to move (mv)

Measured local results:

  • forced rebuild improved from ~145.6s to ~82.1s (~44% faster)
  • with added safety checks enabled, still around ~96.1s (~34% faster than baseline)

2. Safety added back after disabling full fixup

Because full Nix fixup is disabled for performance, this adds targeted integrity checks:

  • nix/scripts/gateway-install.sh
    • explicitly validates broken symlinks in node_modules and fails if any are found
  • nix/scripts/check-gateway-smoke.sh
    • new smoke test script that runs openclaw --help
  • nix/checks/openclaw-gateway-smoke.nix
    • new Nix check derivation
  • flake.nix
    • wires in checks.*.gateway-smoke

3. CI split into cache producer vs cache consumer behavior

Workflows updated so CI consumes cache intentionally:

  • .github/workflows/cache-only.yml

    • producer-style job verifies required outputs are available in cache.garnix.io
    • consumer-style job runs Linux checks with --max-jobs 0 (cache-only)
    • consumer-style job verifies Darwin outputs in cache
  • .github/workflows/config-options-check.yml

    • now waits for Garnix
    • runs in cache-only mode (--max-jobs 0)
  • .github/workflows/hm-activation-linux.yml

    • now waits for Garnix
    • runs in cache-only mode (--max-jobs 0)

Why

This focuses on the real bottleneck (Nix fixup/copy overhead on huge outputs), keeps most of the speed gains, and restores confidence via explicit integrity and smoke checks.

Copilot AI review requested due to automatic review settings February 16, 2026 02:02
Copy link

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

Speed up Nix builds for the gateway package while enforcing “cache-only” CI consumers, and add targeted integrity/smoke checks to compensate for disabling Nix fixup.

Changes:

  • Disable Nix fixup for openclaw-gateway and reduce install overhead by moving (not deep-copying) node_modules.
  • Add integrity validation for node_modules symlinks plus a new gateway smoke check wired into the flake.
  • Update CI workflows to wait for Garnix and then run in cache-only mode (--max-jobs 0), plus add a cache pipeline workflow.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
nix/scripts/gateway-install.sh Switch to mv for outputs and add symlink-integrity validation for node_modules.
nix/scripts/check-gateway-smoke.sh New smoke test script running openclaw --help.
nix/packages/openclaw-gateway.nix Disable fixup to cut build time overhead.
nix/checks/openclaw-gateway-smoke.nix New Nix check derivation to run the smoke test.
flake.nix Wire gateway-smoke into flake checks.
.github/workflows/hm-activation-linux.yml Wait for Garnix and enforce cache-only builds.
.github/workflows/config-options-check.yml Wait for Garnix and enforce cache-only builds.
.github/workflows/cache-only.yml Split into producer vs consumer cache pipeline and add cache-only Linux/Darwin consumption checks.

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

gumadeiras and others added 2 commits February 15, 2026 21:18
What:
- revert cache pipeline producer/consumer workflow orchestration in `.github/workflows/cache-only.yml`
- revert duplicated Garnix wait/polling logic from config-options and hm-activation workflows
- remove gateway-smoke check wiring from `flake.nix`
- delete `nix/checks/openclaw-gateway-smoke.nix` and `nix/scripts/check-gateway-smoke.sh`

Why:
- keep PR #57 minimal and focused on high-value gateway packaging/install speedups
- avoid non-essential CI complexity and SHA/polling failure surface
- preserve only core build-time optimizations (`dontFixup`, install `mv`, symlink integrity guard)

Tests:
- `nix build .#checks.x86_64-linux.gateway --print-build-logs` (pass)
- `nix flake check --accept-flake-config --print-build-logs` (pass; warns about omitted incompatible systems)
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