I have bug when trying to compile SwiftUI project in Xcode 11.3 on Swift 5.2 nightly snapshot:
ld: file not found: /Library/Developer/Toolchains/swift-5.2-DEVELOPMENT-SNAPSHOT-2020-01-06-a.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.profile_iossim.a
file not found: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2020-01-24-a.xctoolchain/usr/lib/clang/7.0.0/lib/darwin/libclang_rt.profile_iossim.a
Latest Xcode snapshots seem to be generally busted. I get the same error as @nonameplum when building Alamofire for iOS, and I'm getting a variety of other bizarre errors when building for Catalyst:
<unknown>:0: warning: using sysroot for 'MacOSX' but targeting 'iPhone'
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:10: note: while building module 'IOKit' imported from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:
#include <IOKit/IOKitLib.h>
^
<module-includes>:121:9: note: in file included from <module-includes>:121:
#import "Headers/usb/IOUSBLib.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/IOUSBLib.h:27:
#include <IOKit/usb/USB.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:29:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/USB.h:29:
#include <IOKit/usb/USBSpec.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/USBSpec.h:38:10: error: 'IOKit/usb/IOUSBHostFamily.h' file not found
#include <IOKit/usb/IOUSBHostFamily.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/IOKit.framework/Headers/usb/USBSpec.h:38:10: note: did not find header 'usb/IOUSBHostFamily.h' in framework 'IOKit' (loaded from '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks')
#include <IOKit/usb/IOUSBHostFamily.h>
^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/CoreGraphics.h"
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:42:10: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CoreGraphics.h:42:
#include <CoreGraphics/CGDisplayConfiguration.h>
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/CoreGraphics.framework/Headers/CGDisplayConfiguration.h:12:10: error: could not build module 'IOKit'
#include <IOKit/IOKitLib.h>
^
<unknown>:0: error: could not build Objective-C module 'CoreGraphics'
Additionally, our tests fail to build on macOS due to changes in the URLCache initializers:
This no longer builds, as it appears the new initializer has changed to public init(__memoryCapacity memoryCapacity: Int, diskCapacity: Int, directoryURL: URL?), which I'm guess is an issue with the importer.
Where should I report these bugs? Is the generation of these overlays open source?
This happens because the toolchains don't include compiler-rt libraries for iOS. We're looking into this, but in the meantime you can work around the problem by copying the compiler-rt libraries from Xcode. A command like this will take care of it (adjust the toolchain path as needed):