Downloaded pure swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a snapshot, but it gives me different errors with swift build:
Building for debugging...
warning: ignoring '-enable-batch-mode' because '-whole-module-optimization' was also specified
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
error: emit-module command failed with exit code 1 (use -v to see invocation)
<unknown>:0: error: compiling for macOS 10.13, but module 'Swift' has a minimum deployment target of macOS 14: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/lib/swift/embedded/Swift.swiftmodule/arm64-apple-macos.swiftmodule
<unknown>:0: error: compiling for macOS 10.13, but module 'Swift' has a minimum deployment target of macOS 14: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/lib/swift/embedded/Swift.swiftmodule/arm64-apple-macos.swiftmodule
Added platforms: [.macOS(.v14)] into Package.swift of App, Lib1, and Lib2.
Getting error:
Building for debugging...
warning: ignoring '-enable-batch-mode' because '-whole-module-optimization' was also specified
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
error: emit-module command failed with exit code 1 (use -v to see invocation)
./Lib2/Sources/Lib2/Lib2.swift:9:12: error: let 'lib2' is not concurrency-safe because non-'Sendable' type 'Lib2' may have shared mutable state
1 | public struct Lib2 {
| `- note: consider making struct 'Lib2' conform to the 'Sendable' protocol
2 | public let value: Int
3 |
:
7 | }
8 |
9 | public let lib2 = Lib2()
| |- error: let 'lib2' is not concurrency-safe because non-'Sendable' type 'Lib2' may have shared mutable state
| |- note: annotate 'lib2' with '@MainActor' if property should only be accessed from the main actor
| `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
Which is fair. Conformed Lib2 to Sendable and now getting compiler crash:
Building for debugging...
warning: ignoring '-enable-batch-mode' because '-whole-module-optimization' was also specified
remark: Incremental compilation has been disabled: it is not compatible with whole module optimization
error: emit-module command failed due to signal 6 (use -v to see invocation)
Assertion failed: (!isEmbedded(concreteType) || isMetadataAllowedInEmbedded(concreteType)), function forTypeMetadata, file Linking.h, line 856.
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
0. Program arguments: /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/bin/swift-frontend -frontend -emit-module -experimental-skip-non-inlinable-function-bodies-without-types ./Lib2/Sources/Lib2/Lib2.swift -target arm64-apple-macosx14.0 -Xllvm -aarch64-use-tbi -disable-objc-interop -cxx-interoperability-mode=default -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I ./App/.build/arm64-apple-macosx/debug/Modules -I /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path ./App/.build/arm64-apple-macosx/debug/ModuleCache -swift-version 6 -Onone -D SWIFT_PACKAGE -D DEBUG -gnone -disable-stack-protector -emit-empty-object-file -enable-experimental-feature Embedded -empty-abi-descriptor -Xcc -working-directory -Xcc ./App -resource-dir /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir ./App -Xcc -fdeclspec -Xcc -isysroot -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -Xcc -F -Xcc /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -Xcc -g -module-name Lib2 -package-name lib2 -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-DEVELOPMENT-SNAPSHOT-2024-06-03-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -emit-module-doc-path ./App/.build/arm64-apple-macosx/debug/Modules/Lib2.swiftdoc -emit-module-source-info-path ./App/.build/arm64-apple-macosx/debug/Modules/Lib2.swiftsourceinfo -emit-objc-header-path ./App/.build/arm64-apple-macosx/debug/Lib2.build/Lib2-Swift.h -emit-dependencies-path ./App/.build/arm64-apple-macosx/debug/Lib2.build/Lib2.emit-module.d -parse-as-library -o ./App/.build/arm64-apple-macosx/debug/Modules/Lib2.swiftmodule -emit-abi-descriptor-path ./App/.build/arm64-apple-macosx/debug/Modules/Lib2.abi.json
1. Apple Swift version 6.0-dev (LLVM c7c87ee42989d4b, Swift 0aa0687fe0f4047)
2. Compiling with the current language version
3. While generating Clang header
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0 swift-frontend 0x000000010974f9e0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1 swift-frontend 0x000000010974e1ac llvm::sys::RunSignalHandlers() + 112
2 swift-frontend 0x0000000109750028 SignalHandler(int) + 304
3 libsystem_platform.dylib 0x000000018921da24 _sigtramp + 56
4 libsystem_pthread.dylib 0x00000001891edcc0 pthread_kill + 288
5 libsystem_c.dylib 0x00000001890f9a40 abort + 180
6 libsystem_c.dylib 0x00000001890f8d30 err + 0
7 swift-frontend 0x0000000109791150 swift::irgen::LinkEntity::isObjCImplementation(swift::CanType) (.cold.1) + 0
8 swift-frontend 0x000000010449168c printPrimitiveGenericTypeTraits(llvm::raw_ostream&, swift::ASTContext&, swift::PrimitiveTypeMapping&, bool) + 2788
9 swift-frontend 0x0000000104493cfc void llvm::function_ref<void (llvm::raw_ostream&)>::callback_fn<swift::printSwiftToClangCoreScaffold(swift::SwiftToClangInteropContext&, swift::ASTContext&, swift::PrimitiveTypeMapping&, llvm::raw_ostream&)::$_0::operator()(llvm::raw_ostream&) const::'lambda'(llvm::raw_ostream&)::operator()(llvm::raw_ostream&) const::'lambda'(llvm::raw_ostream&)>(long, llvm::raw_ostream&) + 8312
10 swift-frontend 0x0000000104449d88 swift::ClangSyntaxPrinter::printExternC(llvm::function_ref<void (llvm::raw_ostream&)>) const + 268
11 swift-frontend 0x0000000104491c3c void llvm::function_ref<void (llvm::raw_ostream&)>::callback_fn<swift::printSwiftToClangCoreScaffold(swift::SwiftToClangInteropContext&, swift::ASTContext&, swift::PrimitiveTypeMapping&, llvm::raw_ostream&)::$_0::operator()(llvm::raw_ostream&) const::'lambda'(llvm::raw_ostream&)>(long, llvm::raw_ostream&) + 56
12 swift-frontend 0x0000000104449b60 swift::ClangSyntaxPrinter::printNamespace(llvm::function_ref<void (llvm::raw_ostream&)>, llvm::function_ref<void (llvm::raw_ostream&)>, swift::ClangSyntaxPrinter::NamespaceTrivia, swift::ModuleDecl const*) const + 276
13 swift-frontend 0x0000000104449c70 swift::ClangSyntaxPrinter::printNamespace(llvm::StringRef, llvm::function_ref<void (llvm::raw_ostream&)>, swift::ClangSyntaxPrinter::NamespaceTrivia) const + 44
14 swift-frontend 0x0000000104491a38 void llvm::function_ref<void (llvm::raw_ostream&)>::callback_fn<swift::printSwiftToClangCoreScaffold(swift::SwiftToClangInteropContext&, swift::ASTContext&, swift::PrimitiveTypeMapping&, llvm::raw_ostream&)::$_0>(long, llvm::raw_ostream&) + 124
15 swift-frontend 0x0000000104449b60 swift::ClangSyntaxPrinter::printNamespace(llvm::function_ref<void (llvm::raw_ostream&)>, llvm::function_ref<void (llvm::raw_ostream&)>, swift::ClangSyntaxPrinter::NamespaceTrivia, swift::ModuleDecl const*) const + 276
16 swift-frontend 0x0000000104449c70 swift::ClangSyntaxPrinter::printNamespace(llvm::StringRef, llvm::function_ref<void (llvm::raw_ostream&)>, swift::ClangSyntaxPrinter::NamespaceTrivia) const + 44
17 swift-frontend 0x00000001044917fc swift::printSwiftToClangCoreScaffold(swift::SwiftToClangInteropContext&, swift::ASTContext&, swift::PrimitiveTypeMapping&, llvm::raw_ostream&) + 364
18 swift-frontend 0x00000001044687e0 swift::printModuleContentsAsCxx(llvm::raw_ostream&, swift::ModuleDecl&, swift::SwiftToClangInteropContext&, bool, llvm::StringSet<llvm::MallocAllocator>&) + 2468
19 swift-frontend 0x0000000104477e9c void llvm::function_ref<void ()>::callback_fn<swift::printAsClangHeader(llvm::raw_ostream&, swift::ModuleDecl*, llvm::StringRef, swift::FrontendOptions const&, swift::IRGenOptions const&, clang::HeaderSearch&)::$_2>(long) + 668
20 swift-frontend 0x0000000104473118 emitCxxConditional(llvm::raw_ostream&, llvm::function_ref<void ()>, llvm::function_ref<void ()>) + 124
21 swift-frontend 0x0000000104472e94 swift::printAsClangHeader(llvm::raw_ostream&, swift::ModuleDecl*, llvm::StringRef, swift::FrontendOptions const&, swift::IRGenOptions const&, clang::HeaderSearch&) + 6424
22 swift-frontend 0x00000001040cfb88 swift::withOutputPath(swift::DiagnosticEngine&, llvm::vfs::OutputBackend&, llvm::StringRef, llvm::function_ref<bool (llvm::raw_pwrite_stream&)>) + 168
23 swift-frontend 0x00000001042a570c performEndOfPipelineActions(swift::CompilerInstance&) + 3604
24 swift-frontend 0x00000001042a1d74 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 740
25 swift-frontend 0x00000001042a0cc0 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2376
26 swift-frontend 0x00000001040ab52c swift::mainEntry(int, char const**) + 3096
27 dyld 0x0000000188e6d0e0 start + 2360
CompilerCrash_EmbeddedSwiftWASM.zip - project with changes which reproduces the compiler crash.