From 9adb528d08a04c7597d42c47a19d93cfd04e6b7f Mon Sep 17 00:00:00 2001 From: _ <50262751+hunzlahmalik@users.noreply.github.com> Date: Wed, 20 May 2026 12:06:43 +0500 Subject: [PATCH] fix(mcp-build): normalize dist modes before cp -a (macOS gRPC-FUSE) On macOS Docker Desktop, Node's fs.cpSync writes files in the bind mount with a com.docker.grpcfuse.ownership xattr declaring mode 200 even when the host inode is 644. The subsequent `cp -a` (and the original `rsync -avr`) then chmod the destination to 200, which lands on the real host inode and renders the bundle unreadable to anything outside the build container (Linux containers via gRPC-FUSE included). chmod-ing packages/server/dist before the copy rewrites the xattr to 644 while the host mode is still 644, so cp -a propagates the correct mode and the bundle is readable downstream. Behaviour on Linux hosts is unchanged: gRPC-FUSE only runs on macOS Docker Desktop; chmod -R is a no-op when modes are already correct. Co-Authored-By: Claude Opus 4.7 --- mcp/scripts/build | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mcp/scripts/build b/mcp/scripts/build index 41af7a46849..a506951b119 100755 --- a/mcp/scripts/build +++ b/mcp/scripts/build @@ -27,7 +27,11 @@ popd pnpm -r --filter "!mcp-plugin" install; pnpm -r --filter "mcp-server" run build:multi-user; -rsync -avr packages/server/dist/ ./dist/; +# Normalize cpSync output modes before cp -a propagates them. On macOS Docker Desktop, Node's fs.cpSync writes a gRPC-FUSE xattr with mode 200 that cp -a turns into a real host mode 200 (unreadable). chmod here while host mode is still 644 fixes both layers. +chmod -R u=rwX,go=rX packages/server/dist; + +mkdir -p ./dist; +cp -a packages/server/dist/. ./dist/; cp packages/server/package.json ./dist/; cp packages/server/pnpm-lock.yaml ./dist/;