Compare commits

...

3 Commits

Author SHA1 Message Date
joshp123
1d88dceda6 🤖 nix: trim PR #57 to packaging-only speedups
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)
2026-02-15 20:19:19 -08:00
Gustavo Madeira Santana
9dc336c6f5 nix: harden gateway symlink and smoke scripts 2026-02-15 21:18:18 -05:00
Gustavo Madeira Santana
a691c74207 Nix: speed up gateway builds and add cache-only safeguards 2026-02-15 21:02:16 -05:00
2 changed files with 25 additions and 1 deletions

View File

@ -83,6 +83,7 @@ stdenv.mkDerivation (finalAttrs: {
postPatch = "${../scripts/gateway-postpatch.sh}";
buildPhase = "${../scripts/gateway-build.sh}";
installPhase = "${../scripts/gateway-install.sh}";
dontFixup = true;
dontStrip = true;
dontPatchShebangs = true;

View File

@ -17,9 +17,30 @@ log_step() {
printf '>> [timing] %s: %ss\n' "$name" "$((end - start))" >&2
}
check_no_broken_symlinks() {
root="$1"
if [ ! -d "$root" ]; then
return 0
fi
broken_tmp="$(mktemp)"
# Portable and faster than `find ... -exec test -e {} \;` on large trees.
find "$root" -type l -print | while IFS= read -r link; do
[ -e "$link" ] || printf '%s\n' "$link"
done > "$broken_tmp"
if [ -s "$broken_tmp" ]; then
echo "dangling symlinks found under $root" >&2
cat "$broken_tmp" >&2
rm -f "$broken_tmp"
return 1
fi
rm -f "$broken_tmp"
}
mkdir -p "$out/lib/openclaw" "$out/bin"
log_step "copy build outputs" cp -r dist node_modules package.json "$out/lib/openclaw/"
# Build dir is ephemeral in Nix; moving avoids an expensive deep copy of node_modules.
log_step "move build outputs" mv dist node_modules package.json "$out/lib/openclaw/"
if [ -d extensions ]; then
log_step "copy extensions" cp -r extensions "$out/lib/openclaw/"
fi
@ -94,4 +115,6 @@ if [ -n "$hasown_src" ]; then
fi
fi
log_step "validate node_modules symlinks" check_no_broken_symlinks "$out/lib/openclaw/node_modules"
bash -e -c '. "$STDENV_SETUP"; makeWrapper "$NODE_BIN" "$out/bin/openclaw" --add-flags "$out/lib/openclaw/dist/index.js" --set-default OPENCLAW_NIX_MODE "1"'