Skip to content

macOS bootstrap: install Xcode Command Line Tools before chezmoi needs git #22

Open

Description

@jdevera

Found during the fresh-macOS install documented in #20.

Problem

On a brand-new Mac, chezmoi init --apply jdevera fails almost immediately:

xcode-select: note: No developer tools were found, requesting install.
chezmoi: git: exit status 1

chezmoi needs git (e.g. to clone the source repo and fetch git externals), but git only exists once the Xcode Command Line Tools are installed.

Root cause

The Xcode CLT install lives in home/.chezmoiscripts/run_once_after_010-install-homebrew.sh.tmpl, which is a run_once_after_ script — it runs after chezmoi has already applied state and used git. By then it's too late.

Suggested direction

Install the Xcode CLT (or at least ensure git is available) as a pre-source / pre-apply hook that runs before chezmoi touches git — e.g. a .chezmoiscripts/run_before_* step, or folded into home/.install-one-password.sh / the site/install bootstrap. The Homebrew script can keep its idempotent "already installed" check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions