If anyone else is experiencing this, the issue turned out to be that the files were in a directory synced with iCloud. Moving the project folder to a non-synced directory and building there worked without issue, though I'm not sure why.