Garry's Opinionated OpenClaw/Hermes Agent Brain
TypeScript
fix(ci-local): portable xargs and a container-built CLI on macOS hosts (#5901)
garrytanca04a26914ff
diff --git a/docker-compose.ci.yml b/docker-compose.ci.ymlindex 654f87e7da..72911a6a5c 100644--- a/docker-compose.ci.yml+++ b/docker-compose.ci.yml@@ -156,6 +156,8 @@ services:- gbrain-ci-node-modules:/app/node_modules- gbrain-ci-admin-node-modules:/app/admin/node_modules- gbrain-ci-admin-dist:/app/admin/dist+ # Compiled CLI tests must execute a Linux binary, never a host Mac build.+ - gbrain-ci-bin:/app/bin# Warm install cache across runs.- gbrain-ci-bun-cache:/root/.bun/install/cache@@ -167,4 +169,5 @@ volumes:gbrain-ci-node-modules:gbrain-ci-admin-node-modules:gbrain-ci-admin-dist:+ gbrain-ci-bin:gbrain-ci-bun-cache:diff --git a/scripts/ci-local.sh b/scripts/ci-local.shindex ecf99ac8c6..c07974978a 100755--- a/scripts/ci-local.sh+++ b/scripts/ci-local.sh@@ -188,7 +188,7 @@ elseGBRAIN_PGBOUNCER_E2E_DB=gbrain_test \GBRAIN_CI_REQUIRE_PGBOUNCER=1 \GBRAIN_TEST_DB=1 \- xargs -a /tmp/e2e-selected.txt bash scripts/run-e2e.sh+ xargs bash scripts/run-e2e.sh < /tmp/e2e-selected.txtfi'elseRUN_PHASES_CMD='echo "[runner] guards + typecheck"@@ -268,7 +268,7 @@ printf '%s\\n' 1 2 3 4 | xargs -P4 -I{} sh -c 'GBRAIN_PGBOUNCER_E2E_DB=gbrain_pooled_\${shard}_test \\GBRAIN_CI_REQUIRE_PGBOUNCER=1 \\GBRAIN_TEST_DB=1 \\- xargs -a /tmp/e2e-selected.txt bash scripts/run-e2e.sh >> \$log 2>&1+ xargs bash scripts/run-e2e.sh < /tmp/e2e-selected.txt >> \$log 2>&1elseSHARD=\${shard}/4 \\DATABASE_URL=postgresql://postgres:postgres@postgres-\${shard}:5432/gbrain_test \\@@ -338,6 +338,8 @@ git config --global --add safe.directory '*' || true# Revalidate even a warm dependency volume against this checkout's lockfile.echo "[runner] bun install --frozen-lockfile"bun install --frozen-lockfile+echo "[runner] compiling isolated Linux CLI for executable security checks"+bun run build__RUN_PHASES__EOF)diff --git a/test/scripts/ci-local-rendering.test.ts b/test/scripts/ci-local-rendering.test.tsindex e322eff907..058f0f5680 100644--- a/test/scripts/ci-local-rendering.test.ts+++ b/test/scripts/ci-local-rendering.test.ts@@ -18,6 +18,21 @@ test('the CI admin build keeps container dependencies and Vite cache off the hosexpect(Object.hasOwn(compose.volumes, 'gbrain-ci-admin-node-modules')).toBe(true);expect(compose.services.runner.volumes).toContain('gbrain-ci-admin-dist:/app/admin/dist');expect(Object.hasOwn(compose.volumes, 'gbrain-ci-admin-dist')).toBe(true);+ // Compiled-CLI tests must run a Linux binary built in the container, never a+ // host (e.g. macOS) build leaking through the /app bind mount.+ expect(compose.services.runner.volumes).toContain('gbrain-ci-bin:/app/bin');+ expect(Object.hasOwn(compose.volumes, 'gbrain-ci-bin')).toBe(true);+});++test('the runner compiles its own CLI and avoids GNU-only xargs flags', () => {+ const template = source.slice(templateStart, templateEnd);+ // `xargs -a FILE` is GNU-only; BSD xargs (macOS hosts) rejects it.+ expect(source).not.toMatch(/xargs\s+-a\b/);+ const install = template.indexOf('bun install --frozen-lockfile');+ const build = template.indexOf('bun run build', install);+ expect(install).toBeGreaterThanOrEqual(0);+ expect(build).toBeGreaterThan(install);+ expect(build).toBeLessThan(template.indexOf('__RUN_PHASES__'));});describe('ci-local command rendering', () => {