diff --git a/flake.nix b/flake.nix index 2a144ec..164758f 100644 --- a/flake.nix +++ b/flake.nix @@ -105,6 +105,9 @@ package-contents = pkgs.callPackage ./nix/checks/openclaw-package-contents.nix { openclawGateway = packageSetStable.openclaw-gateway; }; + package-contents-dogfood = pkgs.callPackage ./nix/checks/openclaw-package-contents.nix { + openclawGateway = packageSetDogfood.openclaw-gateway; + }; default-instance = pkgs.callPackage ./nix/checks/openclaw-default-instance.nix { }; config-validity = pkgs.callPackage ./nix/checks/openclaw-config-validity.nix { openclawGateway = packageSetStable.openclaw-gateway; diff --git a/nix/patches/allow-package-public-surface-hardlinks.patch b/nix/patches/allow-package-public-surface-hardlinks.patch index 6dde09a..56c7802 100644 --- a/nix/patches/allow-package-public-surface-hardlinks.patch +++ b/nix/patches/allow-package-public-surface-hardlinks.patch @@ -1,25 +1,13 @@ diff --git a/src/plugins/public-surface-loader.ts b/src/plugins/public-surface-loader.ts -index 1f5b5ab..c9727e1 100644 +index 5f6f939..8cb550f 100644 --- a/src/plugins/public-surface-loader.ts +++ b/src/plugins/public-surface-loader.ts -@@ -116,13 +116,16 @@ export function loadBundledPluginPublicArtifactModuleSync(para - if (cached) { - return cached as T; - } -- -+ const packageRoot = path.resolve(OPENCLAW_PACKAGE_ROOT); -+ const resolvedModulePath = path.resolve(location.modulePath); -+ const isPackagePublicSurface = resolvedModulePath.startsWith(`${packageRoot}${path.sep}`); -+ - const opened = openBoundaryFileSync({ - absolutePath: location.modulePath, +@@ -128,7 +128,7 @@ export function loadBundledPluginPublicArtifactModuleSync(para rootPath: location.boundaryRoot, -- boundaryLabel: -- location.boundaryRoot === OPENCLAW_PACKAGE_ROOT ? "OpenClaw package root" : "plugin root", + boundaryLabel: + location.boundaryRoot === OPENCLAW_PACKAGE_ROOT ? "OpenClaw package root" : "plugin root", - rejectHardlinks: true, -+ boundaryLabel: -+ location.boundaryRoot === OPENCLAW_PACKAGE_ROOT ? "OpenClaw package root" : "plugin root", -+ rejectHardlinks: !isPackagePublicSurface, ++ rejectHardlinks: location.boundaryRoot !== OPENCLAW_PACKAGE_ROOT, }); if (!opened.ok) { throw new Error( diff --git a/nix/scripts/check-package-contents.sh b/nix/scripts/check-package-contents.sh index 2fd4615..8bc77bc 100755 --- a/nix/scripts/check-package-contents.sh +++ b/nix/scripts/check-package-contents.sh @@ -35,6 +35,18 @@ require_path "${root}/skills" require_path "${root}/node_modules/hasown" require_path "${root}/node_modules/combined-stream" +public_surface_loader="$( + grep -Rsl "function loadBundledPluginPublicArtifactModuleSync" "${root}/dist" | head -1 +)" +if [ -z "$public_surface_loader" ]; then + echo "Missing bundled plugin public surface loader" >&2 + exit 1 +fi +if grep -q "rejectHardlinks: true" "$public_surface_loader"; then + echo "Bundled plugin public surface loader still rejects hardlinked package files" >&2 + exit 1 +fi + require_js_alias_target() { alias="$1" alias_path="${root}/dist/${alias}" diff --git a/nix/sources/openclaw-dogfood-source.nix b/nix/sources/openclaw-dogfood-source.nix index 16cce37..4bf5b86 100644 --- a/nix/sources/openclaw-dogfood-source.nix +++ b/nix/sources/openclaw-dogfood-source.nix @@ -12,6 +12,5 @@ hash = "sha256-jndOOSSFROyrK4RiwAsJfUuCJTj7qbmmm4Qz8BqtJ/c="; }; - applyPublicSurfaceHardlinksPatch = false; applySkipPluginAutoEnableNixModePatch = false; }