Skip to main content

Platform Key FamilyDisplayName Warning

Fix "warning: unhandled Platform key FamilyDisplayName" error when using git/lazygit in Nix development environments.

Problem

When running git commands or lazygit in the dotfiles directory, you see:

warning: unhandled Platform key FamilyDisplayName

This warning appears in stderr and can cause lazygit to crash with:

*fs.PathError chdir warning: unhandled Platform key FamilyDisplayName: no such file or directory

Root cause: Nix's development environment sets DEVELOPER_DIR to its own SDK, which includes an outdated xcbuild from 2019. When git or lazygit invoke xcrun, this old version cannot parse modern Xcode platform plist files (introduced in recent macOS versions).

Solution

Override DEVELOPER_DIR in .envrc to use the system's CommandLineTools instead of Nix's SDK.

Add to .envrc:

use flake

# Override Nix's DEVELOPER_DIR to use system Xcode tools
# Fixes "Platform key FamilyDisplayName" warning from old xcbuild
# See: https://github.com/jetify-com/devbox/issues/2754
if [ -d /Library/Developer/CommandLineTools ]; then
export DEVELOPER_DIR=/Library/Developer/CommandLineTools
fi

After editing .envrc:

direnv allow

The environment will automatically reload with the fix applied.

Verification

  1. Check that DEVELOPER_DIR is correctly set:

    echo $DEVELOPER_DIR
    # Should output: /Library/Developer/CommandLineTools
  2. Test git commands:

    git status
    # Should run without the warning
  3. Test lazygit:

    lg
    # Should launch without errors
  • .envrc - Direnv environment configuration
  • flake.nix - Nix development environment definition

References