I’m the build engineer for a new iPhone application and I’ve run into the following extremely weird situation. We’re using git with Xcode 3.2.4 under Snow Leopard.
This happens whether I’m using the Xcode GUI or using xcodebuild on the command line.
- I clone a clean copy of the repository and run “Build” or “Build and Archive”.
- The build fails with a bunch of compile errors.
- I run “Clean All Targets” with “Also clean dependencies” and “Also remove precompiled headers” checked
- I run “Build” or “Build and Archive” again.
- Build succeeds.
The errors all seem to be of the form “file-something.h no such file or directory”, but the files it claims it can’t find are actually there.
Does anyone have any idea what is going on here? The git repo uses submodules, and as far as I can tell, all the “missing” files are contained in one of the submodules. However, as I noted, the files are present in the working directory, and the submodules have been inited and updated correctly.
It turns out that if I manually create all the build directories and their subdirectories before running a build (after a fresh clone), the build succeeds. Because of the submodules, there are actually three build/ directories (one in the main project, one in each submodule) and the submodule ones have a bunch of subdirectories.
This has to be due to a bug somewhere, and I will continue to research it, but at least for the moment I have a workaround and can get on with creating my automated build.
Edit: And in fact, this appears to be due to a bug in the build of one of the two submodules, three20. I’m guessing that it creates the build directories after it tries to use one or more of them. I will take this up with the three20 developers.