Skip to content

Commit 4d03463

Browse files
authored
fix(crabbox): require Xcode for macOS proof
1 parent d9298a7 commit 4d03463

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

scripts/crabbox-wrapper.mjs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2593,6 +2593,10 @@ function remoteAwsMacosSwiftBootstrap() {
25932593
'echo "[crabbox] current Swift is $1.$2; select/install Xcode 26.x or use a Blacksmith macOS runner with Xcode_26.1.app." >&2;',
25942594
"return 2;",
25952595
"fi;",
2596+
'openclaw_xcodebuild_version="$(xcodebuild -version 2>&1)" || { printf "%s\\n" "$openclaw_xcodebuild_version" >&2; echo "[crabbox] OpenClaw macOS app proof requires Xcode 26.x; active developer directory does not provide usable xcodebuild." >&2; return 2; };',
2597+
'printf "%s\\n" "$openclaw_xcodebuild_version" >&2;',
2598+
'openclaw_xcode_major="$(printf "%s\\n" "$openclaw_xcodebuild_version" | sed -nE "s/^Xcode ([0-9]+)(\\..*)?$/\\1/p" | head -n 1)";',
2599+
'if [ "$openclaw_xcode_major" != "26" ]; then echo "[crabbox] OpenClaw macOS app proof requires Xcode 26.x; current xcodebuild is ${openclaw_xcode_major:-unknown}." >&2; return 2; fi;',
25962600
"};",
25972601
"openclaw_crabbox_require_macos_swift_62",
25982602
].join(" ");

test/scripts/crabbox-wrapper.test.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1183,6 +1183,8 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
11831183
expect(remoteCommand).toContain("/Applications/Xcode-26*.app");
11841184
expect(remoteCommand).toContain('sudo xcode-select -s "$openclaw_developer"');
11851185
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
1186+
expect(remoteCommand).toContain("xcodebuild -version");
1187+
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Xcode 26.x");
11861188
expect(remoteCommand).not.toContain("openclaw_crabbox_bootstrap_macos_js");
11871189
expectGroupedShellCommand(
11881190
remoteCommand,
@@ -1204,6 +1206,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
12041206
expect(remoteCommand).toContain("pnpm --version >&2");
12051207
expect(remoteCommand).toContain("openclaw_crabbox_require_macos_swift_62");
12061208
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
1209+
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Xcode 26.x");
12071210
expectGroupedShellCommand(remoteCommand, "pnpm mac:package");
12081211
});
12091212

@@ -2234,6 +2237,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
22342237
expect(output.scriptContent).toContain("openclaw_crabbox_require_macos_swift_62");
22352238
expect(output.scriptContent).toContain("openclaw_crabbox_require_macos_swift_62 || exit $?");
22362239
expect(output.scriptContent).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
2240+
expect(output.scriptContent).toContain("OpenClaw macOS app proof requires Xcode 26.x");
22372241
expect(output.scriptContent).toContain(`\n${script}`);
22382242
});
22392243

0 commit comments

Comments
 (0)