Skip to content

Fatal Error #382

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

Closed
TeamPuzel opened this issue Sep 24, 2022 · 9 comments
Closed

Fatal Error #382

TeamPuzel opened this issue Sep 24, 2022 · 9 comments

Comments

@TeamPuzel
Copy link

That's all I see when trying to use carton dev, even when using the templates

@kateinoigakukun
Copy link
Member

Sorry for your inconvenience. I'd like to know more details about your situation because I can't reproduce your issue on my side.

  1. Which version of carton are you using?
  2. Which OS and OS version are you using?
  3. Please report the exact command output you got.

@TeamPuzel
Copy link
Author

Hey,
I'm using the version installed with brew, I'm on the latest dev beta, but a while ago I tried on Monterey too
Screenshot 2022-09-24 at 11 57 24
The problem is, there is no output

@kateinoigakukun
Copy link
Member

Could you try with --verbose option and tell me the output?

@TeamPuzel
Copy link
Author

hm it looks like Foundation on 13 requires swift 5.7?

^\n/Users/david/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 (swiftlang-5.7.0.130.3 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-beta.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-beta.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-beta.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-beta.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/david/Documents/Files/Xcode/Packages/web-test/Package.swift:3: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

I tried using the 5.7 toolchain but it also failed

@mustiikhalil
Copy link

mustiikhalil commented Sep 24, 2022

I think I'm facing the same issue, and a bit of digging gave me this; error

- checking Swift compiler path: /Users/silly/.carton/sdk/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/silly/.swiftenv/versions/wasm-5.6.0-RELEASE/usr/bin/swift
- checking Swift compiler path: /Users/silly/Library/Developer/Toolchains/swift-wasm-5.6.0-RELEASE.xctoolchain/usr/bin/swift
Inferring basic settings...
- swift executable: /Users/silly/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-darwin21.6.0
Xcode: 14.1 beta
OS: Monterey 12.6

Sorry for the huge text blob

Parsing package manifest: [debug]: evaluating manifest for 'website-2.0' 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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.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-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/System/Library/Frameworks/Foundation.framework/Modules/Foundation.swiftmodule/arm64e-apple-macos.swiftinterface:9:19: error: could not build Objective-C module \'Foundation\'\n@_exported import Foundation\n ^\n/Users/silly/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 (swiftlang-5.7.0.130.3 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-beta.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-beta.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-beta.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-beta.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/silly/development/website-2.0/Package.swift:3: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

@yonihemi
Copy link
Member

I think the issue comes from our use of libSwiftPM - on macOS it defaults to use the toolchain provided by xcrun vs our toolchain. We have an imminent fix for Xcode 14/Swift 5.7 but we should look into fixing it in a more resilient way.

@mustiikhalil
Copy link

mustiikhalil commented Sep 25, 2022

I've tried compiling the new solution from source, however it seems that the issue still persists. Not sure if I'm doing something wrong from my end though

Fixed, by re-downloading the 5.7 sdk.

@gmondada
Copy link

gmondada commented Dec 10, 2022

I downloaded the 5.7 with:
carton sdk install wasm-5.7-SNAPSHOT-2022-11-09-a

I created a .swift-version file with wasm-5.7-SNAPSHOT-2022-11-09-a inside.

Now carton dev goes further but in Safari console I get:

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

Tested with carton 0.17 built from source code and it works.

@kateinoigakukun
Copy link
Member

Version 1.0 rewrote the dev server with better error diagnostics. Could you try again with the new version? Please re-open if you still have any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants