Yesterday, without provocation, Xcode started automatically deleting the Tools/mogenerator
file in my project every time I build. When I discard the resultant git deletion (put the file back) and rebuild, Xcode promptly deletes the file again. This file is needed for a run script in my project so deleting it obviously breaks my builds, but there appears to be no way to convince Xcode to just leave it where it belongs.
I have:
- Cleaned and rebuilt
- Run
git clean -fdx
- Deleted
Xcode/DerievedData
- Restarted my machine
- Nuked and recloned the repo
- Cloned the repo into a different folder
- Updated Xcode
- Uninstalled and reinstalled Xcode
I've done most of those multiple times.
I am the only one on my team who is having this issue, and a clean clone of the repo gives me the exact same problem, so I'm confident it doesn't have anything to do with my code. It has to be something in my environment. But I can't recall doing anything that would affect my environment like this. Yesterday I built without issue, and 5 minutes later I built again and this happened. I didn't change anything.
I'm at a complete loss as are all the other engineers on my team. None of us have seen anything like this before, and nothing we have tried has worked. Does this sound familiar to anyone? Is there another step I can take to clean my environment?
Update
It appears this run script in the Mogenerator target is what's causing the trouble. Initially I assumed it worked because it was the only thing that references Tools/mogenerator
, but it turns out when I remove it the file isn't deleted at all and everything works normally. Everyone else on my team has the exact same script, so I have no idea why it's causing problems for only me.
Tools/mogenerator -m #/#.xcdatamodeld --machine-dir #/Model/Generated --human-dir #/Model --swift --template-var arc=true --template-var scalarsWhenNonOptional=true