fix(crabbox): require Xcode for macOS proof

This commit is contained in:
Vincent Koc 2026-06-24 09:01:42 +08:00 committed by GitHub
parent d9298a74be
commit 4d034639ad
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 0 deletions

View file

@ -2593,6 +2593,10 @@ function remoteAwsMacosSwiftBootstrap() {
'echo "[crabbox] current Swift is $1.$2; select/install Xcode 26.x or use a Blacksmith macOS runner with Xcode_26.1.app." >&2;',
"return 2;",
"fi;",
'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; };',
'printf "%s\\n" "$openclaw_xcodebuild_version" >&2;',
'openclaw_xcode_major="$(printf "%s\\n" "$openclaw_xcodebuild_version" | sed -nE "s/^Xcode ([0-9]+)(\\..*)?$/\\1/p" | head -n 1)";',
'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;',
"};",
"openclaw_crabbox_require_macos_swift_62",
].join(" ");

View file

@ -1183,6 +1183,8 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
expect(remoteCommand).toContain("/Applications/Xcode-26*.app");
expect(remoteCommand).toContain('sudo xcode-select -s "$openclaw_developer"');
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
expect(remoteCommand).toContain("xcodebuild -version");
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Xcode 26.x");
expect(remoteCommand).not.toContain("openclaw_crabbox_bootstrap_macos_js");
expectGroupedShellCommand(
remoteCommand,
@ -1204,6 +1206,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
expect(remoteCommand).toContain("pnpm --version >&2");
expect(remoteCommand).toContain("openclaw_crabbox_require_macos_swift_62");
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
expect(remoteCommand).toContain("OpenClaw macOS app proof requires Xcode 26.x");
expectGroupedShellCommand(remoteCommand, "pnpm mac:package");
});
@ -2234,6 +2237,7 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
expect(output.scriptContent).toContain("openclaw_crabbox_require_macos_swift_62");
expect(output.scriptContent).toContain("openclaw_crabbox_require_macos_swift_62 || exit $?");
expect(output.scriptContent).toContain("OpenClaw macOS app proof requires Swift tools 6.2+");
expect(output.scriptContent).toContain("OpenClaw macOS app proof requires Xcode 26.x");
expect(output.scriptContent).toContain(`\n${script}`);
});