Repository navigation
Studio installer: do not run Apple's git shim to ask whether git works - #11759
Merged
Merged
Conversation
Without the Command Line Tools, Apple Silicon's /usr/bin/git is a shim, and running it (even git --version) raises the "install the command line developer tools" dialog. install.sh's _has_working_git answers from the path there; install_python_stack.py's ran the shim unconditionally. That was harmless while only the triton step, skipped on macOS, asked, but since the pinned Diffusers main build became the default (#11405) every macOS install asks, so a Mac without the CLT got the dialog mid-install. The Python probe now mirrors install.sh: on Apple Silicon hardware (Rosetta included, via hw.optional.arm64), a git that resolves to exactly /usr/bin/git with no toolchain selected (xcode-select -p fails) is answered as missing without running it. Homebrew, Xcode.app and Intel Mac gits are still run.
Member
Author
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Codex Review: Didn't find any major issues. Already looking forward to the next diff. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
shaojun
pushed a commit
to shaojun/unsloth
that referenced
this pull request
Sep 29, 2026
unslothai#11759) Without the Command Line Tools, Apple Silicon's /usr/bin/git is a shim, and running it (even git --version) raises the "install the command line developer tools" dialog. install.sh's _has_working_git answers from the path there; install_python_stack.py's ran the shim unconditionally. That was harmless while only the triton step, skipped on macOS, asked, but since the pinned Diffusers main build became the default (unslothai#11405) every macOS install asks, so a Mac without the CLT got the dialog mid-install. The Python probe now mirrors install.sh: on Apple Silicon hardware (Rosetta included, via hw.optional.arm64), a git that resolves to exactly /usr/bin/git with no toolchain selected (xcode-select -p fails) is answered as missing without running it. Homebrew, Xcode.app and Intel Mac gits are still run.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On an Apple Silicon Mac without the Command Line Tools,
/usr/bin/gitis Apple's shim. Running it, even asgit --version, raises the "install the command line developer tools" dialog.install.sh's_has_working_gitalready avoids this by answering from the path.install_python_stack.py's_has_working_git()did not: it always rangit --version. That used to be harmless, because only the triton step asked and it is skipped on macOS.#11405 made the pinned Diffusers main build part of the default install.
_prefetch_diffusers_main,_diffusers_main_needs_dependency_passand_diffusers_main_stepall ask_has_working_git(), so every default macOS install now runs the probe. On a Mac without the CLT, that means the dialog pops up in the middle of the install. The dialog is the prompt the consumer path was built to avoid (#7547).Fix
The Python probe now mirrors
install.sh. It answers "no git" without running anything when all of these hold:platform.machine() == "arm64", orsysctl hw.optional.arm64is 1, which covers a Python running under Rosetta, as_MAC_ROSETTAdoes;gitresolves to exactly/usr/bin/git;xcode-select -pfails, meaning no toolchain is selected.Homebrew, MacPorts, Xcode.app and Intel Mac gits are still run, as in
install.sh. With no working git, the installer already falls back to the pinned archive.On the clean-machine trace leg (CLT present), the only new traced call is
xcode-select -p, whichnotoolsalready allows. On the mask legs the sentinel is ahead of/usr/binonPATH, so nothing changes there.Tests
tests/studio/install/test_git_probe_clt_shim.pyruns the probe against a stand-insubprocess.runthat records every command. There are 9 cases:PATH: nothing is run;install.sh.Without the fix, 3 of the 9 fail: both no-CLT rows and the
install.shagreement row. The wider installer suites (tests/studio/install,tests/python/test_install_python_stack.py) show no new failures compared with main.