Can't run TestFoundation target in swift-corelibs-foundation repository

I am starting contributing Swift Foundation framework. I am using swift-corelibs-foundation repository by following this guide: swift-corelibs-foundation/ at main · apple/swift-corelibs-foundation · GitHub

But it is failed when I try to run TestFoundation:

/Applications/ '(anonymous)' has different definitions in different modules; definition in module 'CoreFoundation' is here
swift-corelibs-foundation/CoreFoundation/Base.subproj/ Redefinition of module 'CoreFoundation'
swift-corelibs-foundation/CoreFoundation/String.subproj/CFString.h:835:127: Reference to 'kCFStringEncodingASCII' is ambiguous
Could not build Objective-C module 'CoreGraphics'

Here is screenshot:

After these steps it is succeed:

  1. Clean
  2. Build
  3. Run Cmd-R

I have found another solution from here also:

  • swiftc does not order include paths. This means that build artifact module.modulemap and the installed module.modulemap will conflict with each other. To work around the issue while developing Foundation, remove /usr/local/include/CoreFoundation/module.modulemap before building.
Terms of Service

Privacy Policy

Cookie Policy