Nix: speed up gateway builds and enforce cache-only CI consumers#57
Open
gumadeiras wants to merge 3 commits intomainfrom
Open
Nix: speed up gateway builds and enforce cache-only CI consumers#57gumadeiras wants to merge 3 commits intomainfrom
gumadeiras wants to merge 3 commits intomainfrom
Conversation
There was a problem hiding this comment.
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-gatewayand reduce install overhead by moving (not deep-copying)node_modules. - Add integrity validation for
node_modulessymlinks 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.
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)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.nixdontFixup = truenix/scripts/gateway-install.shcp -r) to move (mv)Measured local results:
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.shnode_modulesand fails if any are foundnix/scripts/check-gateway-smoke.shopenclaw --helpnix/checks/openclaw-gateway-smoke.nixflake.nixchecks.*.gateway-smoke3. CI split into cache producer vs cache consumer behavior
Workflows updated so CI consumes cache intentionally:
.github/workflows/cache-only.ymlcache.garnix.io--max-jobs 0(cache-only).github/workflows/config-options-check.yml--max-jobs 0).github/workflows/hm-activation-linux.yml--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.