Skip to content

Commit 4df8324

Browse files
committed
fix(ci): normalize macos crabbox locale
1 parent 3901f48 commit 4df8324

3 files changed

Lines changed: 36 additions & 0 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Docs: https://docs.openclaw.ai
4545

4646
### Fixes
4747

48+
- Release/CI/E2E: normalize inherited Linux `C.UTF-8` locale settings before raw AWS macOS Crabbox bootstrap commands, avoiding macOS locale warnings during package-manager hydration.
4849
- Agents/providers: keep streaming tool-call argument parsing record-shaped when providers emit valid non-object JSON such as `null` or arrays.
4950
- Release/CI/E2E: reset incremental log readers when watched log files rotate without shrinking, so same-size replacements do not hide new readiness or RPC lines.
5051
- Talk: preserve explicit `null` payloads on controller-created turn and output-audio lifecycle events.

‎scripts/crabbox-wrapper.mjs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1643,6 +1643,10 @@ function remoteAwsMacosJsBootstrap({ packageManager = false } = {}) {
16431643
`node_version=${shellQuote(nodeVersion)};`,
16441644
'arch="$(uname -m)";',
16451645
'case "$arch" in arm64) node_arch=arm64 ;; x86_64) node_arch=x64 ;; *) echo "unsupported macOS arch: $arch" >&2; return 2 ;; esac;',
1646+
'macos_locale="${OPENCLAW_CRABBOX_MACOS_LOCALE:-en_US.UTF-8}";',
1647+
'case "${LANG:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LANG="$macos_locale" ;; esac;',
1648+
'case "${LC_ALL:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LC_ALL="$macos_locale" ;; esac;',
1649+
'case "${LC_CTYPE:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LC_CTYPE="$macos_locale" ;; esac;',
16461650
'if [ -z "${TMPDIR:-}" ]; then export TMPDIR="/tmp"; fi;',
16471651
'if [ ! -d "$TMPDIR" ]; then mkdir -p "$TMPDIR" 2>/dev/null || export TMPDIR="/tmp"; fi;',
16481652
'if [ ! -d "$TMPDIR" ]; then echo "usable TMPDIR not found: $TMPDIR" >&2; return 1; fi;',

‎test/scripts/crabbox-wrapper.test.ts‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,37 @@ describe.concurrent("scripts/crabbox-wrapper", () => {
681681
expectGroupedShellCommand(remoteCommand, "node --version");
682682
});
683683

684+
it("normalizes inherited Linux UTF-8 locale names for raw AWS macOS bootstrap", () => {
685+
const result = runWrapper(
686+
"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",
687+
["run", "--provider", "aws", "--target", "macos", "--", "node", "--version"],
688+
{
689+
env: {
690+
LANG: "C.UTF-8",
691+
LC_ALL: "C.UTF-8",
692+
LC_CTYPE: "C.UTF-8",
693+
},
694+
},
695+
);
696+
697+
const output = parseFakeCrabboxOutput(result);
698+
const remoteCommand = normalizeShellLineEndings(output.args.at(-1) ?? "");
699+
expect(result.status).toBe(0);
700+
expect(remoteCommand).toContain(
701+
'macos_locale="${OPENCLAW_CRABBOX_MACOS_LOCALE:-en_US.UTF-8}"',
702+
);
703+
expect(remoteCommand).toContain(
704+
'case "${LANG:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LANG="$macos_locale" ;; esac;',
705+
);
706+
expect(remoteCommand).toContain(
707+
'case "${LC_ALL:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LC_ALL="$macos_locale" ;; esac;',
708+
);
709+
expect(remoteCommand).toContain(
710+
'case "${LC_CTYPE:-}" in C.UTF-8|C.utf8|c.UTF-8|c.utf8) export LC_CTYPE="$macos_locale" ;; esac;',
711+
);
712+
expectGroupedShellCommand(remoteCommand, "node --version");
713+
});
714+
684715
it("bootstraps Corepack for raw AWS macOS pnpm commands", () => {
685716
const result = runWrapper(
686717
"provider: hetzner, aws, local-container, blacksmith-testbox, or cloudflare\n",

0 commit comments

Comments
 (0)