Repository navigation
fix(cli): no macOS developer-tools prompt from git, xcrun or cc checks on a Mac without the tools - #7257
Conversation
There was a problem hiding this comment.
Requesting changes at 2406e2ab.
The approach is right: deciding from paths, never running the stub. The fails without the fix: line names skills.test.ts "bare skills on a Mac without the developer tools…", and that test does exercise the guard. Three things block it:
- CI is red because of this diff. The body says
oxfmt --checkand the comment ratchet are clean, but on this head:- Preflight
format:checkflagspackages/cli/src/utils/appleStubs.test.ts. That fails Windows render verification and preview-regression. - Comments:
NEW file over its package's comment share: packages/cli/src/utils/appleStubs.ts is 10.2% (6/59), the package is 9.7%.
- Preflight
- A Mac that has only Xcode.app is treated as having no tools.
developerDir()usesDEVELOPER_DIR, then/var/db/xcode_select_link, then/Library/Developer/CommandLineTools. When nothing has been chosen withxcode-select -s, the link may not exist. That is typical when Xcode comes from the App Store and the separate CLT package was never installed. xcode-select / xcrun then fall back to/Applications/Xcode.app/Contents/Developer, and/usr/bin/gitruns fine. With this PR,skills/init/updateskip with "git not available", the Apple provider says there is no Swift compiler, and whisper won't build from source, all on a fully provisioned Mac. That turns a dialog fix into a silent capability loss. Please add the/Applications/Xcode.app/Contents/Developerfallback before the CLT default, and add a case for it inappleStubs.test.ts. - Minor, not blocking:
onPathsplits on:and doesn't check that the file is executable. It's harmless today because the result only matters on darwin. Noting it in case someone reuses it.
Fix 1 and 2 and I'll re-review the new head.
Edit accuracy: accurate 267 (base branch 267), smooth 98 of thoseThe gate passes. Quarantined, measured but not gated (8)
Unstable (1)
|
There was a problem hiding this comment.
Requesting changes at 8f6d0c62.
The code changes answer all three earlier points:
developerDirs()now falls back to/Applications/Xcode.app/Contents/Developerbefore the CLT folder, and there's a test for it.onPathchecks X_OK and splits PATH onpath.delimiter.- Formatting and the comment ratchet pass (Comments is green).
The fails without the fix: line still names a valid test.
Blocker: a test this PR breaks fails on every run. In CI, skills.test.ts › "hyperframes skills › uses darwin-compatible npx command for preflight and the full install" fails at skills.test.ts:286 with expected undefined to be 'npx'. It fails in Flake gate (10/10 runs), in Test (cli 2/2), and in both CLI: npx shim jobs (ubuntu + windows). That test calls setPlatform("darwin") on a Linux/Windows runner. There, neither /Applications/Xcode.app/.../usr/bin nor /Library/Developer/CommandLineTools/usr/bin exists, so the new guard treats git as the stub and skills skips before npx ever runs. Give that test a developer folder that exists, for example vi.stubEnv("DEVELOPER_DIR", <tmpdir containing usr/bin>), so it keeps testing the npx command it's meant to test. While you're there, look for any other setPlatform("darwin") cases in the touched suites (skills.installTarget, whisper, the providers) that could hit the same guard.
Once CI is green on the new head I'll approve.
There was a problem hiding this comment.
Requesting changes at 3fdbc808.
The skills-test fix is right. A temp DEVELOPER_DIR with usr/bin is stubbed in beforeEach, and the "fails without the fix" test still overrides it with a nonexistent folder. That test now passes on ubuntu, windows and macOS in Flake gate, Test (cli 2/2) and the three npx shim jobs. CI's first attempt failed in Test (runtime) and Test (cli 1/2), on a browserManager timeout and a Chrome WS-endpoint launch timeout, neither touching this diff. I re-ran those failed jobs and CI is now green.
Blocker: Windows render verification › "Tests on windows-latest: engine-cli-1" fails 4 tests in the new src/utils/appleStubs.test.ts:
- "runs them once the Command Line Tools are installed"
- "runs them on a Mac with only Xcode.app…"
- "follows the developer folder xcode-select chose, or DEVELOPER_DIR"
onPath› "finds the first executable on PATH…"
The cause is that appleStubs.ts builds paths with the host's node:path. On Windows, join(dir, "usr", "bin") produces backslashes, so it never matches the fake Mac's /…/usr/bin paths. delimiter is ;, so "/opt/homebrew/bin:/usr/bin" stays one entry. Production on a real Mac is fine, but this is a required lane.
Suggested fix: use node:path/posix (join, dirname, basename) for the macOS developer-folder logic, since those paths are always POSIX. For onPath, either take the delimiter from the host (h.platform === "win32" ? ";" : ":") or give the test's fake host a PATH and delimiter that match. Then re-run the Windows lane.
There was a problem hiding this comment.
Approving at ebcddd43. No blockers remain.
- Windows fix:
appleStubs.tsnow usesnode:path/posix, and the Mac PATH lookup splits on:inside the module. Callers pass a bare name ("git","cc","xcrun"), which resolves on PATH or falls back to/usr/bin/<name>, so the old cross-platformonPathexport is gone. Off macOS it still returnstruebefore any lookup. The Homebrew-first vs/usr/bincases are now covered throughrunsWithoutInstallPrompt("git", …). - Earlier points: the Xcode.app fallback, the executable check on PATH, formatting and the comment share all hold.
- fails without the fix: the line still names the
skills.test.tsstub-git case, and the guard still makes it pass. - CI on this head:
- Green: Windows render verification, Flake gate, Test (cli 1/2 and 2/2), the npx shims (ubuntu, windows, macOS), Comments, preview-regression and CodeQL.
- Red: only CI › Build, on
@hyperframes/producer unpacked size 3112478 bytes is over its budget of 3081613. main's latest CI (968f97fe) fails with the same byte count, and this diff doesn't touch producer, so it comes from main.
…view to heygen-com#7258 Adopts heygen-com#7306 (motion-blur composition counts in render_complete telemetry, adapted to discoverMovers; readEvents stays false without heygen-com#7191) and heygen-com#7318 (a set that interrupts a tween holds at any worker count) together with its merged prerequisite heygen-com#6851. PR axis advances to heygen-com#7258; heygen-com#7253 and heygen-com#7257 are open and pinned as monitored (97->99). Co-authored-by: Vance Ingalls <vance@heygen.com> Co-authored-by: Miguel Ángel <miguel.sierra@heygen.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…s on a Mac without the tools
ebcddd4 to
5909eb6
Compare
…n-com#7110, heygen-com#7000; advance watermark Eight commits, PR heygen-com#7452 and ten pin moves are recorded with their evidence in the continued ledger, DECISIONS and UPSTREAM. Adopted: heygen-com#7249 (template entries detected structurally), heygen-com#7110 (whisper nan/inf output), heygen-com#7000 (engine probe test on fake timers). Deferred: heygen-com#7444, heygen-com#7452. Not applicable: heygen-com#7257, heygen-com#7443, heygen-com#7450. The watermark moves to c149730, PR heygen-com#7452, and the nine moved pins plus heygen-com#7434 are re-pinned at their current heads. Co-Authored-By: Claude Sonnet <noreply@anthropic.com>
What
On a Mac without the developer tools, the CLI no longer opens macOS's "install the command line developer tools" dialog when it checks for git, Swift or a C compiler. It now sees that the tool isn't there and skips, saying why, as it already does when git is missing on other systems.
Why
A report: on macOS without Xcode's tools, macOS popped the install-developer-tools dialog during a CLI run. Until those tools are installed, macOS puts stubs in
/usr/binforgit,xcrun,ccand others: running one opens that dialog and fails. Three CLI checks run one just to learn whether the tool exists:skills(andinit/update, which install skills) rangit --version.describeprovider (Apple SoundAnalysis) ranxcrun --find swiftcto see whether it can build its helper./usr/bin/gitwithwhich, then rangit clone, then a cmake build that compiles with/usr/bin/cc.I traced
beats <file> --json, the command in the report, on a macOS runner with CLI 0.9.16: it starts onlywhich, ffprobe, ffmpeg and the telemetry flush, none of them a stub. So these three checks are what can open the dialog, not beats itself.How
utils/appleStubs.tsdecides, without running anything, whether a command is one of those stubs and whether the tools are installed. It reads wherexcode-selectpoints (DEVELOPER_DIR, else/var/db/xcode_select_link; with neither,/Applications/Xcode.app/Contents/Developeror the Command Line Tools folder, asxcode-selectitself falls back) and checks that folder has ausr/bin. A tool outside/usr/bin(Homebrew's git) or off macOS is always fine./usr/binstub. All of it uses POSIX paths, since these are macOS paths on whatever host runs the tests.skillstreats a stub git as missing (it already skips with "git not available"), the Apple provider reports "no Swift compiler", and whisper neither clones with a stub git nor builds with a stub compiler.Test plan
Unit tests added/updated
Manual testing performed
Documentation updated (if applicable)
Comments follow CONTRIBUTING.md "Comments": they say why, not what, and a bug fix says what the code must do and how to reproduce the bug
fails without the fix:
skills.test.ts"bareskillson a Mac without the developer tools skips without running macOS's git stub" fails with main'sskills.ts(expected [ 'npx', 'git' ] to not include 'git': main runs the stub) and passes here, 3 runs in a row.appleStubs.test.ts(6 tests, 3 runs): stubs refused with no tools; allowed with the Command Line Tools, with only Xcode.app and nothing chosen (fails with the Xcode.app fallback removed), with an Xcode chosen byxcode-selectorDEVELOPER_DIR; Homebrew git, non-stub/usr/bintools and other systems always allowed; a bare name resolved on PATH without running anything. The fake Mac uses POSIX paths, so the tests mean the same on Windows (CI's Windows lane is the check; I ran Linux only).The callers' tests:
skills.test.ts,skills.installTarget.test.ts,src/whisper,src/audio/analysis/providers(306 pass, 1 skipped).oxfmt --checkon the 6 touched files,scripts/comment-ratchet.mjswith the new files included (4 source files at or under their share), andtscreports no errors in the touched files.skills.test.tsgives every test a developer folder that exists, so its darwin cases test npx on any host. With git resolving to/usr/bin/git(as on CI) the darwin npx test failed without it (expected undefined to be 'npx') andskills.test.tsplusskills.installTarget.test.tspass with it (51 tests, 3 runs).Not covered: a real Mac without the tools; the checks are pure path reads, tested with a stand-in filesystem. The whisper and provider wiring are one-line guards with no test of their own.