Skip to content

fix: keep Darwin preferred languages global - #25

Merged
tiensonqin merged 1 commit into
mainfrom
fix/1794114386-darwin-preferred-languages
Nov 8, 2026
Merged

tiensonqin merged 1 commit into
mainfrom
fix/1794114386-darwin-preferred-languages

Conversation

@tiensonqin

Copy link
Copy Markdown

Summary

Read Darwin PreferredLanguages only from the global AppleLanguages domain. When it is absent, return an empty list rather than falling back to NSLocale.preferredLanguages, which becomes app-scoped after SaveLocale.

Remove only TestLocales' invalid nonempty-list assumption; preserve region validation, saved-language round trips, cleanup, and the system-before/after equality invariant. No new tests, APIs, dependencies or SDK-feature changes.

Testing

  • Preserved pristine-5c failure (x-Test versus en-001); reproduced red with the existing invariant and verified green after the minimal production fix.
  • Before any test preference mutation, a temporary native pre-main guard verified the actual synthetic main CFBundle ID ai.devin.mygo.locale79be43a0. The guard and application-bundle runner are outside the repository; no global/human preference writes or GUI testing.
  • CGO_ENABLED=0 go test -count=1 -timeout 20m -exec <owned-application test runner> ./...: passed. Only the Darwin test binary is wrapped; MYGO_E2E is absent.
  • CGO_ENABLED=1 go test -race -count=1 -exec <owned-application test runner> ./internal/darwin: passed (race instrumentation only).
  • CGO-disabled build, vet and mygo_noinspector vet: Darwin arm64, Linux amd64 and Windows amd64 passed. Gofmt/diff checks passed.
  • Paired Go 1.27.3 release-size builds for counter-native and hello: no byte growth in all ten pairs (Darwin arm64; Linux amd64/arm64; Windows amd64/arm64).

Tested on:

  • macOS
  • Windows
  • Linux
  • Web
  • Other: Linux/Windows cross-build and vet only, not runtime acceptance

AI disclosure

  • Tool and model: Devin, built by Cognition AI; underlying model/version is not exposed by this environment.
  • Used for: implementation, existing-test adjustment, validation and this description.
  • A human read every line of this change and can explain it.

Link to Devin session: https://app.devin.ai/sessions/79be43a0fc7b4ee3b783fa85566b6c1d
Open in Devin Desktop: https://app.devin.ai/desktop/session/79be43a0fc7b4ee3b783fa85566b6c1d?variant=devin
Requested by: @tiensonqin

@devin-ai-integration

Copy link
Copy Markdown

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@tiensonqin
tiensonqin merged commit fc67c1f into main Nov 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant