Skip to content

Catch missing msgfmt and harden the Metal Toolchain probe in doctor - #738

Merged
sbertix merged 1 commit into
mainfrom
sbertix/gh-729-make-doctor-passes-but-build-fails-missi
Jul 29, 2026
Merged

Catch missing msgfmt and harden the Metal Toolchain probe in doctor#738
sbertix merged 1 commit into
mainfrom
sbertix/gh-729-make-doctor-passes-but-build-fails-missi

Conversation

@sbertix

@sbertix sbertix commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #729

Summary

make doctor reported all checks green while make build-app then failed on
prerequisites the doctor never verified. Two gaps, both in scripts/doctor.sh:

  • msgfmt (GNU gettext) was unchecked. Ghostty shells out to msgfmt to
    compile its .po translation catalogs (ThirdParty/ghostty/src/build/GhosttyI18n.zig:33),
    and macOS does not ship it, so a build without it fails with
    failed to spawn ... msgfmt: FileNotFound (once per locale). Doctor now
    checks for it, running msgfmt --version and confirming the output is GNU
    gettext so a broken version-manager shim or an unrelated command named
    msgfmt cannot pass as installed. The fix hint covers both Homebrew
    (brew install gettext && brew link --force gettext) and a brew-free path
    (nix profile install nixpkgs#gettext).
  • The Metal Toolchain check produced a false negative from a stale xcrun
    cache.
    After xcodebuild -downloadComponent MetalToolchain (a cryptex
    mount, not /Library/Developer/Toolchains/), xcrun metal --version still
    reported the toolchain missing because xcrun cached the earlier negative
    lookup. Doctor now retries the probe after xcrun --kill-cache when the
    first attempt fails, so a stale cache no longer masquerades as a missing
    toolchain while still correctly reporting a genuinely missing one.

Type of change

  • Bug fix (the linked issue is a bug report)
  • Feature (the linked issue is a feature request marked ready)
  • Documentation
  • Other (please describe)

How was this tested?

Shell-only tooling change (no Swift/app surface), so verification was against
scripts/doctor.sh directly:

  • bash -n scripts/doctor.sh clean; ./scripts/doctor.sh exits 0 on a
    correctly provisioned machine (all checks green).

  • msgfmt check exercised with PATH shims: real GNU msgfmt -> pass; a shim
    exiting non-zero, a non-GNU command named msgfmt, and an absent binary
    each -> doctor turns red with the actionable fix.

  • make check passes (format + lint)

  • make test passes

  • I built and ran the app to confirm the change works

Checklist

  • This pull request is linked to an issue with Closes # above.
  • For a feature, the linked issue is labeled ready.
  • I am the author of this work and accountable for it; no commit is authored or co-authored by an AI agent.
  • I have read the Contributing guide and the Code of Conduct.

make doctor reported all checks green while make build-app then failed on
prerequisites doctor did not verify.

Add a msgfmt (GNU gettext) check: Ghostty shells out to msgfmt to compile
its .po catalogs and macOS does not ship it. The check runs msgfmt and
confirms it is GNU gettext, so a broken version-manager shim or an
unrelated command named msgfmt cannot read as installed.

Retry the Metal Toolchain probe after killing xcrun's cache, so a stale
negative lookup no longer reports a freshly downloaded toolchain as missing.
@sbertix
sbertix enabled auto-merge (squash) July 29, 2026 21:24
@sbertix
sbertix merged commit 6f58640 into main Jul 29, 2026
3 checks passed
@sbertix
sbertix deleted the sbertix/gh-729-make-doctor-passes-but-build-fails-missi branch July 29, 2026 21:31
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.

Make doctor passes but build fails — missing msgfmt check and stale-xcrun-cache false negative for Metal Toolchain

1 participant