How to ensure consistent xcodebuild results when the new build system is used?

252 views Asked by At

We are using a homemade script that builds a couple of projects using xcodebuild and analyzes the returned number of build errors and warnings.

When the new build system was introduced in Xcode, I've found that the number of output errors or warnings may be different between runs. So, for years, we have been using the old build system by running xcodebuild with -UseModernBuildSystem=NO arguments.

Since upgrading to M1 MacBook Pro and Xcode 13.3, it looks like I can no longer use the old build system - at least, I don't see any considerable difference when including or omitting the -UseModernBuildSystem=NO xcodebuild argument.

I also tried the following in order to disable parallel compilation, the numbers of output errors and warnings are still different for some projects between compilations.

system "defaults write com.apple.dt.Xcode BuildSystemScheduleInherentlyParallelCommandsSerially -bool YES"
system "defaults write com.apple.dt.Xcode PBXNumberOfParallelBuildSubtasks 1"

I am also clearing the DerivedData folder programmatically between the script runs.

Any suggestions on how to achieve a consistent number of output errors or warnings with the new Xcode build system?

0

There are 0 answers