From 73a7d413dbf1434dcd5652b1d797a014ef72d3e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Tue, 7 Apr 2026 03:55:21 +0200 Subject: [PATCH 1/2] openclaw: 2026.4.2 -> 2026.4.9 --- pkgs/by-name/op/openclaw/package.nix | 35 +++++++++++++++++++++------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/pkgs/by-name/op/openclaw/package.nix b/pkgs/by-name/op/openclaw/package.nix index 0f86c4ec9fb5..ce8300f339b3 100644 --- a/pkgs/by-name/op/openclaw/package.nix +++ b/pkgs/by-name/op/openclaw/package.nix @@ -11,7 +11,7 @@ versionCheckHook, rolldown, installShellFiles, - version ? "2026.4.2", + version ? "2026.4.9", }: stdenvNoCC.mkDerivation (finalAttrs: { pname = "openclaw"; @@ -21,10 +21,10 @@ stdenvNoCC.mkDerivation (finalAttrs: { owner = "openclaw"; repo = "openclaw"; tag = "v${finalAttrs.version}"; - hash = "sha256-wVS2OuBNrF1yWjmINxde0kC5mvY2QUUtwYpYrZcARkI="; + hash = "sha256-wqvLBe+cEoo0x096fK6qKR8bDs4QHPTlxK5e64K4yls="; }; - pnpmDepsHash = "sha256-aHepSWiQ4+UyjPHBF+4+M9/nFrgfCw422q671saJM+U="; + pnpmDepsHash = "sha256-mdppNeJVf0Def0GohiKks6W3uzsaoJUYJo/ggGmypKQ="; pnpmDeps = fetchPnpmDeps { inherit (finalAttrs) pname version src; @@ -58,10 +58,27 @@ stdenvNoCC.mkDerivation (finalAttrs: { chmod -R u+w node_modules/rolldown node_modules/@rolldown/pluginutils \ node_modules/.pnpm/node_modules/rolldown node_modules/.pnpm/node_modules/@rolldown/pluginutils - # In Nix sandbox, npm install has no network access. Patch the staging - # script to accept version-mismatched deps from root node_modules - # instead of falling back to npm install. - sed -i 's/if (installedVersion === null || !dependencyVersionSatisfied(spec, installedVersion)) {/if (installedVersion === null) {/' scripts/stage-bundled-plugin-runtime-deps.mjs + # In Nix sandbox, npm install has no network access. + # 1) Skip missing/mismatched deps in closure walk instead of aborting. + # 2) Never fall through to the npm-install path. + substituteInPlace scripts/stage-bundled-plugin-runtime-deps.mjs \ + --replace-fail \ + 'if (installedVersion === null || !dependencyVersionSatisfied(spec, installedVersion)) { + return null; + }' \ + 'if (installedVersion === null || !dependencyVersionSatisfied(spec, installedVersion)) { + continue; + }' \ + --replace-fail \ + 'stageInstalledRootRuntimeDeps({ fingerprint, packageJson, pluginDir, repoRoot }) + ) { + return; + }' \ + 'stageInstalledRootRuntimeDeps({ fingerprint, packageJson, pluginDir, repoRoot }) + ) { + return; + } + return; // nix: sandbox has no npm' pnpm build pnpm ui:build @@ -76,7 +93,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { cp --reflink=auto -r package.json dist node_modules $libdir/ - cp --reflink=auto -r assets docs skills patches extensions $libdir/ + cp --reflink=auto -r assets docs skills patches extensions qa $libdir/ rm -f $libdir/node_modules/.pnpm/node_modules/clawdbot \ $libdir/node_modules/.pnpm/node_modules/moltbot \ @@ -84,6 +101,8 @@ stdenvNoCC.mkDerivation (finalAttrs: { # Remove broken symlinks created by pnpm workspace linking in extensions find $libdir/extensions -xtype l -delete + # Remove symlinks pointing back to the build sandbox + find $libdir/dist/extensions -type l -lname '/build/*' -delete makeWrapper ${lib.getExe nodejs_22} $out/bin/openclaw \ --add-flags "$libdir/dist/index.js" \ From 08a8389f959b3715ba9f569e207b1326465a7fde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Kr=C3=BCger?= Date: Fri, 10 Apr 2026 01:51:03 +0200 Subject: [PATCH 2/2] openclaw: fix broken symlink cleanup in installPhase The -lname '/build/*' pattern didn't match the actual sandbox path (/nix/var/nix/builds/...). Use $NIX_BUILD_TOP instead. Co-Authored-By: Claude Opus 4.6 (1M context) --- pkgs/by-name/op/openclaw/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/op/openclaw/package.nix b/pkgs/by-name/op/openclaw/package.nix index ce8300f339b3..420867cd233b 100644 --- a/pkgs/by-name/op/openclaw/package.nix +++ b/pkgs/by-name/op/openclaw/package.nix @@ -102,7 +102,7 @@ stdenvNoCC.mkDerivation (finalAttrs: { # Remove broken symlinks created by pnpm workspace linking in extensions find $libdir/extensions -xtype l -delete # Remove symlinks pointing back to the build sandbox - find $libdir/dist/extensions -type l -lname '/build/*' -delete + find $libdir/dist/extensions -type l -lname "$NIX_BUILD_TOP/*" -delete makeWrapper ${lib.getExe nodejs_22} $out/bin/openclaw \ --add-flags "$libdir/dist/index.js" \