Skip to content

Fresh clones fail to build — ModelSetupCoordinator.swift missing from repo (gitignored by bare Models/ pattern) #39

Description

@hiimdec

Every fresh clone of main fails to build: KeyType/Logic/Models/ModelSetupCoordinator.swift is referenced by project.pbxproj but missing from the repository. It was silently swallowed by the bare Models/ pattern in .gitignore during the directory refactor in 5214b77 (2026-05-31), so building from source per the README has been broken since then.

Symptom

git clone https://github.com/johnbean393/KeyType.git && cd KeyType
xcodebuild -workspace KeyType.xcworkspace -scheme KeyType build
error: Build input file cannot be found: '…/KeyType/KeyType/Logic/Models/ModelSetupCoordinator.swift'.
Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
(in target 'KeyType' from project 'KeyType')

Same failure when opening KeyType.xcworkspace in Xcode as the README suggests. This is unrelated to the vendored llama.xcframework setup step — the file is genuinely absent from the repo.

Root cause

.gitignore:40 is a bare Models/. The comment above it says it's meant for model weights, but an unanchored directory pattern matches a directory named Models at any depth — including source directories.

Commit 5214b77 ("chore: Refactor directories") moved KeyType/Logic/ModelSetupCoordinator.swift into the new KeyType/Logic/Models/ directory. That destination is ignored, so git staged only the deletion — the sibling moves in the same commit were recorded as renames, this one file as a pure delete:

$ git show 5214b77 --name-status | grep ModelSetupCoordinator
D	KeyType/Logic/ModelSetupCoordinator.swift

The file presumably survives untracked in your working copy (and, being ignored, git status doesn't even list it), so local builds keep passing — but no clone ever receives it.

Verify in 30 seconds, no build needed

$ git ls-tree -r HEAD --name-only | grep ModelSetupCoordinator
(no output — the file is not tracked)

$ grep -c 'ModelSetupCoordinator.swift' KeyType.xcodeproj/project.pbxproj
4

$ git check-ignore -v KeyType/Logic/Models/ModelSetupCoordinator.swift
.gitignore:40:Models/	KeyType/Logic/Models/ModelSetupCoordinator.swift

Fix

  1. Anchor the pattern to the repo root — /Models/ instead of Models/ (the *.gguf rule already catches stray weight files at any depth).
  2. Restore the file, e.g. from the parent of the refactor commit:
    git show 5214b77^:KeyType/Logic/ModelSetupCoordinator.swift > KeyType/Logic/Models/ModelSetupCoordinator.swift
    git add KeyType/Logic/Models/ModelSetupCoordinator.swift
    (With the pattern still unanchored, git add needs -f.)

I checked for other casualties: no other project.pbxproj-referenced path sits under a Models/ directory, so this one file appears to be the only loss — though any future Models/ source directory anywhere in the repo or packages would hit the same trap until the pattern is anchored.

I have this fix working locally (file restored byte-for-byte from 5214b77^, app builds and runs) and am happy to open a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions