"Multiple commands produce [...]" error when building with ALL_BUILD schema

Hello, I am following the Getting Started guide to build the swift project for the first time.

I built the project with Ninja, and am trying to setup use for Xcode. But whenever I try to build the project produced by the command: utils/build-script --swift-darwin-supported-archs "$(uname -m)" --xcode --clean, I get the following errors:

Multiple commands produce '/build/Xcode-MinSizeRelAssert/swift-macosx-x86_64/Debug/lib/swift/macosx/x86_64'

CreateBuildDirectory /build/Xcode-MinSizeRelAssert/swift-macosx-x86_64/Debug/lib/swift/macosx/x86_64

That command depends on command in Target 'cxxshim-OSX-x86_64' (project 'Swift'): script phase “Generate $(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lib/swift/macosx/x86_64”

I am building the project with the ALL_BUILD scheme.

Has anyone ever faced this issue? Thanks!

Are you trying to build the Xcode targets?

They will not work, as building Xcode targets directly is not supported anymore and expected to fail.
We have to follow the Using Ninja with Xcode instructions where we would have an external build system target(ninja build) to use together with Xcode editor functionality.
Have you tried that?