Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal error after getting started guide #509

Open
pnewell opened this issue Aug 20, 2022 · 15 comments
Open

Fatal error after getting started guide #509

pnewell opened this issue Aug 20, 2022 · 15 comments
Assignees
Labels
bug Something isn't working question Further information is requested

Comments

@pnewell
Copy link

pnewell commented Aug 20, 2022

Describe the bug
I went through the getting started guide in full, and on the last step I run carton dev and terminal seems to crash? ultimately I get the following response: "Error: fatalError"

To Reproduce
Steps to reproduce the behavior:

  1. carton dev

Expected behavior
Dev environment initializes, loads at http://127.0.0.1:8080/

Screenshots
If this is a layout/rendering issue, please provide screenshots for both Tokamak and SwiftUI that highlight the difference.
Screenshot 2022-08-19 at 9 36 31 PM Redacted
Screenshot 2022-08-19 at 9 39 21 PM Redacted

Desktop (please complete the following information):

  • OS: macOS Ventura beta
  • Version of Tokamak: 0.10.1

Additional context
Add any other context about the problem here.

@pnewell pnewell added the bug Something isn't working label Aug 20, 2022
@MaxDesiatov
Copy link
Collaborator

Could you provide more details about your environment please? What's the exact version of macOS beta are you running? Is this error reproducible for you with other macOS versions?

@MaxDesiatov MaxDesiatov added the question Further information is requested label Aug 20, 2022
@MaxDesiatov MaxDesiatov assigned pnewell and unassigned MaxDesiatov Aug 20, 2022
@Wouter01
Copy link

Wouter01 commented Aug 20, 2022

Hi,
I've got this error too on the latest macOS Ventura beta.
I was able to work around this by installing the latest version of swiftwasm and then setting this as the version for building. However, then I got errors while building with carton dev. I've added the errors I got (EDIT: removed because they are fixed). I don't know if it's relevant but it's something I guess.

Edit:
Seems like the build errors are already fixed. If you change the dependency in Package.swift to .package(url: "https://github.com/TokamakUI/Tokamak", branch: "main") it will compile. However, I only get a blank screen (dev and release build)

@MaxDesiatov
Copy link
Collaborator

MaxDesiatov commented Aug 20, 2022

However, I only get a blank screen (dev and release build)

This is expected on the main branch, as a major refactoring is in progress (cc @carson-katri)

@Wouter01
Copy link

However, I only get a blank screen (dev and release build)

This is expected on the main branch, as a major refactoring is in progress (cc @carson-katri)

Got that! Weird thing is, if I use the latest release (0.10.1) and just fix the bug that prevents compiling there, it'll also show a blank screen.

@OmerFlame
Copy link

OmerFlame commented Sep 5, 2022

@Wouter01 I am currently experiencing the same difficulties. I took the liberty to take a look at the console in the browser and found a JavaScriptKit error that goes as follows:

JavaScriptKit supports only WASI reactor ABI. Please make sure you are building with: -Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor

And looking at the build command that carton is running, we can see that JavaScriptKit's requirements are not being met:

/Library/Developer/Toolchains/swift-wasm-DEVELOPMENT-SNAPSHOT-2022-09-01-a.xctoolchain/usr/bin/swift build -c debug --product TokamakApp --triple wasm32-unknown-wasi -Xlinker /Users/omershamai/.carton/static/so_sanitizer.wasm -Xlinker --stack-first

Seems like the Tokamak team needs to fix their build script.

EDIT: I just noticed that I can pass through my own commands, so I pushed ahead and input the commands required by JavaScriptKit. It compiled, but then I got another JavaScript error in the browser console, this time it's much more ambiguous:

TypeError: instance.exports.main is not a function. (In 'instance.exports.main()', 'instance.exports.main' is undefined)

Something's off here.

@rayanwaked
Copy link

rayanwaked commented Sep 25, 2022

I just started using Tokamak today and I was confronted by this same issue. In my case, Xcode did not have any Command Line Tools selected, which resulted in this error. To fix this, I did the following:

Diagnose

Open your Terminal and type the command below

xcode-select -p

If your Terminal outputs no developer tools were found at '/applications/xcode.app', then you need to open Xcode and select a CLT.

Select CLT

Xcode > Preferences > Locations > Command Line Tools > Xcode XX.X.X.

Make sure the directory below displays /Applications/Xcode.app

Confirm

Run xcode-select -p again, and it should output /Applications/Xcode.app/Contents/Developer.

Note: If you have both Xcode and Xcode Beta. Do not select the Xcode Beta CLT, for me the error didn't go away when it was selected.

Hope this helps.

@OmerFlame
Copy link

This has been fixed as of release 0.11.0. Please close.

@Wouter01
Copy link

This has been fixed as of release 0.11.0. Please close.

I just tested again, and I'm still getting errors.
This time, I got the same error you wrote about earlier:

TypeError: instance.exports.main is not a function. (In 'instance.exports.main()', 'instance.exports.main' is undefined)

I'm using v 0.11 with swift-wasm-5.7.1-RELEASE

@mcritz
Copy link

mcritz commented Oct 31, 2022

Still getting same error on latest macOS

@rayanwaked
Copy link

Still getting same error on latest macOS

Run brew install swiftwasm/tap/carton in terminal then cd to your project and carton dev again. It should work afterwards.

Make sure you have the correct command line tool selected in Xcode, as well.

@mcritz
Copy link

mcritz commented Nov 5, 2022

brew install swiftwasm/tap/carton still downloads https://github.com/swiftwasm/carton/releases/download/0.16.0/carton-0.16.0.monterey.bottle.tar.gz

and I still get fatalError with carton dev

@mcritz
Copy link

mcritz commented Nov 20, 2022

Running carton dev --verbose gets this:

HelloTokamak % carton dev --verbose
- checking Swift compiler path: /Users/mcritz/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/mcritz/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: x86_64-apple-darwin22.2.0

Parsing package manifest: 
[debug]: evaluating manifest for 'hellotokamak' v. unknown 
[error]: invalidManifestFormat("<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:371:81: error: function does not return string type\n- (nullable instancetype)initWithUTF8String:(const char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);\n                                                                                ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:372:52: error: function does not return NSString\n- (instancetype)initWithString:(NSString *)aString NS_FORMAT_ARGUMENT(1);\n                                                   ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:387:53: error: function does not return NSString\n+ (instancetype)stringWithString:(NSString *)string NS_FORMAT_ARGUMENT(1);\n                                                    ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:389:83: error: function does not return string type\n+ (nullable instancetype)stringWithUTF8String:(const char *)nullTerminatedCString NS_FORMAT_ARGUMENT(1);\n                                                                                  ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:395:114: error: function does not return string type\n- (nullable instancetype)initWithCString:(const char *)nullTerminatedCString encoding:(NSStringEncoding)encoding NS_FORMAT_ARGUMENT(1);\n                                                                                                                 ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSString.h:396:97: error: function does not return string type\n+ (nullable instancetype)stringWithCString:(const char *)cString encoding:(NSStringEncoding)enc NS_FORMAT_ARGUMENT(1);\n                                                                                                ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObjCRuntime.h:103:48: note: expanded from macro \'NS_FORMAT_ARGUMENT\'\n        #define NS_FORMAT_ARGUMENT(A) __attribute__ ((format_arg(A)))\n                                                      ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/x86_64-apple-macos.swiftinterface:9:19: error: could not build Objective-C module \'Foundation\'\n@_exported import Foundation\n                  ^\n/Users/mcritz/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI/PackageDescription.swiftinterface:4:8: error: failed to build module \'Foundation\'; this SDK is not supported by the compiler (the SDK is built with \'Apple Swift version 5.7.1 (swiftlang-5.7.1.134.4 clang-1400.0.29.51)\', while this compiler is \'SwiftWasm Swift version 5.6 (swiftlang-5.6.0)\'). Please select a toolchain which matches the SDK.\nimport Foundation\n       ^\n<module-includes>:1:9: note: in file included from <module-includes>:1:\n#import \"Headers/Foundation.h\"\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:12:\n#import <Foundation/NSBundle.h>\n        ^\n/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:\n#import <Foundation/NSString.h>\n        ^\n/Users/mcritz/Developer/HelloTokamak/Package.swift:2:8: error: failed to build module \'PackageDescription\' for importation due to the errors above; the textual interface may be broken by project issues or a compiler bug\nimport PackageDescription\n       ^", diagnosticFile: nil)Error: fatalError

@alvarhansen
Copy link

I was trying to run carton dev --product TokamakDemo on master (f1cbfcf073e2675566b0e9aa337441357d40d88a) and got same/similar fatal error. Fix for me was to change .swift-version to wasm-5.7.1-RELEASE.

diff --git a/.swift-version b/.swift-version
index 08ddfb7..11e165e 100644
--- a/.swift-version
+++ b/.swift-version
@@ -1 +1 @@
-wasm-5.6.0-RELEASE
+wasm-5.7.1-RELEASE

@kdeda
Copy link

kdeda commented Jun 1, 2023

Decided to take this for an initial spin and out of the box we fail. Xcode 14.3, Ventura 13
I'm glad to report @alvarhansen tips worked, however using wasm-5.8.0-RELEASE does not, but that is not a problem.
Great work.

@airstrike
Copy link

Installed carton from homebrew and TokamakUI from the cloned repo as instructed in the README and also got fatalError. The fact that the error clears my terminal log doesn't help reporting...

 ✔ carton dev --product TokamakDemo
- checking Swift compiler path: /Users/andy/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: arm64-apple-darwin23.3.0

Parsing package manifest:
[debug]: evaluating manifest for 'tokamak' v. unknown

so I ran with --verbose and got

- checking Swift compiler path: /Users/andy/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
SwiftWasm Swift version 5.6 (swiftlang-5.6.0)
Target: arm64-apple-darwin23.3.0

Parsing package manifest: 
[debug]: evaluating manifest for 'tokamak' v. unknown
[error]: Invalid manifest (compiled with: ["/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swiftc", "-vfsoverlay", "/var/folders/np/tj3n126j4x7d2d4hw6ndhx2w0000gn/T/TemporaryDirectory.5t2Mm1/vfs.yaml", "-L", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-target", "arm64-apple-macosx11.0", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-F", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks", "-I", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-L", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib", "-swift-version", "5", "-I", "/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI", "-sdk", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk", "-package-description-version", "5.6.0", "/Users/andy/projects/Tokamak/Package.swift", "-o", "/var/folders/np/tj3n126j4x7d2d4hw6ndhx2w0000gn/T/TemporaryDirectory.HIHaEi/tokamak-manifest"])
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:1694:33: error: expected parameter name followed by ':'
    @preconcurrency case custom(@Sendable (Foundation.Date, any Swift.Encoder) throws -> Swift.Void)
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:1699:33: error: expected parameter name followed by ':'
    @preconcurrency case custom(@Sendable (Foundation.Data, any Swift.Encoder) throws -> Swift.Void)
                                ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:5064:28: error: expected ',' separator
  @_backDeploy(before: iOS 17, macOS 14, tvOS 17, watchOS 10)
                           ^
                          ,
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:19:26: error: no type named 'DispatchQueue' in module 'Dispatch'
    case custom(Dispatch.DispatchQueue?, @convention(block) () -> Swift.Void)
                         ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:66:47: error: no type named '__DispatchData' in module 'Dispatch'
  public typealias _ObjectiveCType = Dispatch.__DispatchData
                                              ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:11:15: error: type 'DispatchData' does not conform to protocol '_ObjectiveCBridgeable'
public struct DispatchData : Swift.RandomAccessCollection, Swift._ObjectiveCBridgeable {
              ^
Swift._ObjectiveCBridgeable:2:20: note: protocol requires nested type '_ObjectiveCType'; do you want to add it?
    associatedtype _ObjectiveCType : AnyObject
                   ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/usr/lib/swift/Dispatch.swiftmodule/arm64e-apple-macos.swiftinterface:75:84: error: no type named '__DispatchData' in module 'Dispatch'
  @_semantics("convertToObjectiveC") public func _bridgeToObjectiveC() -> Dispatch.__DispatchData

// ... thousands of other output rows omitted here...

/Users/andy/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/lib/swift/pm/ManifestAPI/PackageDescription.swiftinterface:4:8: error: failed to build module 'Foundation'; this SDK is not supported by the compiler (the SDK is built with 'Apple Swift version 5.9.2 (swiftlang-5.9.2.2.11 clang-1500.1.0.2.2)', while this compiler is 'SwiftWasm Swift version 5.6 (swiftlang-5.6.0)'). Please select a toolchain which matches the SDK.
import Foundation
       ^
<module-includes>:1:9: note: in file included from <module-includes>:1:
#import "Headers/Foundation.h"
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:13:
#import <Foundation/NSBundle.h>
        ^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:9: note: in file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSBundle.h:6:
#import <Foundation/NSString.h>
        ^
Error: fatalError        

This is because the current SwiftWasm release (5.6) is behind Swift SDK (5.9+)

I'm not sure if the previous comments on this thread were dealing with the same issue, as fatalError is just too generic to accurately tell what happened. So it actually feels like Tokamak should first check if there are SDK issues (and check for other issues faced by previous commenters) and guide users to a resolution (or explanation, at a minimum)

See also #555 and swiftwasm/swift#5562

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working question Further information is requested
Development

No branches or pull requests

9 participants