swiftwasm / swift

WebAssembly support for the Swift programming language

Home Page:https://swiftwasm.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to use newer Xcode than SwiftWasm toolchain's Swift version

turbolent opened this issue · comments

After installing the 5.8 toolchain in Xcode 15, I get the following error:

Unable to discover `swiftc` command line tool info: Could not parse Swift versions from: SwiftWasm Swift version 5.8 (swiftlang-5.8.0)

This is very FAQ, so let me explain here for record.

There are several error caused by newer Xcode and older SwiftWasm toolchain combination.

  1. Dispatch module references too new declarations while building for host target.
/Applications/Xcode-15beta5.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:702:121: error: no type named '__DispatchData' in module 'Dispatch'

This usually happens while building Package.swift containing import Foundation by swift build.

  1. Unable to discover swiftc command line tool info while building in Xcode
    But actually building with SwiftWasm toolchain in Xcode is not supported at this time, so it won't work even though using the same Swift versions with Xcode and SwiftWasm toolchain.

So at this time, SwiftWasm toolchain is only usable with Xcodes corresponding the same Swift version. We are transiting to Swift SDK instead of xctoolchain and it will solve the root issue.

A new version of SwiftWasm toolchain has been released https://github.com/swiftwasm/swift/releases/tag/swift-wasm-5.9.1-RELEASE

The new toolchain works with Xcode 15.x