Ninja build local failure

After an update-checkout I'm not able to build compiler using ./swift/utils/build-script --release --skip-build-benchmarks --swift-darwin-supported-archs "$(uname -m)" --sccache --skip-ios --skip-tvos --skip-watchos with the following issue:

error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: can't open file: tools/clang/lib/Driver/CMakeFiles/obj.clangDriver.dir/SanitizerArgs.cpp.o (Operation not permitted)

[797/988][ 80%][889.250s] Building CXX object tools/clang/lib/Analysis/CMakeFiles/obj.clangAnalysis.dir/CalledOnceCheck.cpp.o

ninja: build stopped: subcommand failed.

ERROR: command terminated with a non-zero exit status 1, aborting

Is anyone else seeing this as well?
The problem is only with ninja ... --Xcode is working

Edit: A little bit more context is that the file SanitizerArgs.cpp.o doesn't exist in this folder

I was not able to reproduce that build failure after calling utils/update-checkout --clone and using the build command you provided. For me, the best solution has been to delete the problem-causing repositories from my computer. Only then, update-checkout seems to correctly grab the newest version. If that still doesn't solve the problem, the best solution might be to try deleting and re-downloading all the repositories. As a last resort, you could try cleaning out the build folder.

Just an update on this thread that maybe can help someone in the future:
I found the issue and it was that a Software for virus & threat detection recently installed was thinking that the SanitizerArgs.cpp.o was a malicious file, so right after being created it was being scanned and deleted by the software ... :upside_down_face:
So it failed at linking time because well it didn't exist anymore.

3 Likes