swiftlang / swift

The Swift Programming Language
https://swift.org
Apache License 2.0
67.53k stars 10.35k forks source link

Every package with Xcode + snapshot is crashing the compiler in the same way #75772

Open mattmassicotte opened 2 months ago

mattmassicotte commented 2 months ago

Description

Both the 8/6 and 8/7 6.0 release snapshots are unable to build any package on my machine when used as a custom toolchain within Xcode. As part of debugging this, I removed all code from one of them. It contained only 3 source files, all of which were:

import Foundation

Crash still reproduces.

Assertion failed: ((!isComplete() || isInvalid() || (dyn_cast<FuncDecl>(requirement) ? (dyn_cast<FuncDecl>(requirement)->isDistributed() || dyn_cast<FuncDecl>(requirement)->isDistributedThunk()) : false) || requirement->getAttrs().hasAttribute<OptionalAttr>() || requirement->getAttrs().isUnavailable( requirement->getASTContext())) && "Conformance already complete?"), function setWitness, file ProtocolConformance.cpp, line 719.

Reproduction

I can compile individiual sources from the commandline. Something about it being a package + Xcode. This crash does not reproduce with CLI builds.

Stack dump

0.  Program arguments: /Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-07-a.xctoolchain/usr/bin/swift-frontend -frontend -c /Users/matt/Chime/Code/Flexer/Sources/Flexer/BasicTextCharacterLexer.swift /Users/matt/Chime/Code/Flexer/Sources/Flexer/CharacterSet+Character.swift -primary-file /Users/matt/Chime/Code/Flexer/Sources/Flexer/LookAheadIteratorProtocol.swift /Users/matt/Chime/Code/Flexer/Sources/Flexer/LookAheadSequence.swift /Users/matt/Chime/Code/Flexer/Sources/Flexer/LookAheadSequenceReference.swift /Users/matt/Chime/Code/Flexer/Sources/Flexer/TokenProtocol.swift -emit-dependencies-path /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.d -emit-const-values-path /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.swiftconstvalues -emit-reference-dependencies-path /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.swiftdeps -serialize-diagnostics-path /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.dia -target arm64-apple-macos10.15 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk -I /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Products/Debug -I /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Products/Debug -F /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -no-color-diagnostics -enable-testing -g -debug-info-format=dwarf -dwarf-version=4 -module-cache-path /Users/matt/Library/Developer/Xcode/DerivedData/ModuleCache.noindex -profile-generate -profile-coverage-mapping -swift-version 5 -enforce-exclusivity=checked -Onone -D SWIFT_PACKAGE -D DEBUG -D Xcode -serialize-debugging-options -const-gather-protocols-file /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/Flexer_const_extract_protocols.json -enable-experimental-feature StrictConcurrency -enable-experimental-feature DebugDescriptionMacro -enable-experimental-feature OpaqueTypeErasure -empty-abi-descriptor -plugin-path /Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-07-a.xctoolchain/usr/lib/swift/host/plugins -external-plugin-path /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing#/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -validate-clang-modules-once -clang-build-session-file /Users/matt/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -Xcc -working-directory -Xcc /Users/matt/Chime/Code/Flexer/.swiftpm/xcode -resource-dir /Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-07-a.xctoolchain/usr/lib/swift -enable-anonymous-context-mangled-names -file-compilation-dir /Users/matt/Chime/Code/Flexer/.swiftpm/xcode -Xcc -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_DEBUG -Xcc -I/Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/swift-overrides.hmap -Xcc -I/Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Products/Debug/include -Xcc -I/Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/DerivedSources-normal/arm64 -Xcc -I/Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/DerivedSources/arm64 -Xcc -I/Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/DerivedSources -Xcc -DSWIFT_PACKAGE -Xcc -DDEBUG=1 -module-name Flexer -package-name flexer -frontend-parseable-output -disable-clang-spi -plugin-path /Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-07-a.xctoolchain/usr/lib/swift/host/plugins -plugin-path /Library/Developer/Toolchains/swift-6.0-DEVELOPMENT-SNAPSHOT-2024-08-07-a.xctoolchain/usr/local/lib/swift/host/plugins -target-sdk-version 15.0 -target-sdk-name macosx15.0 -external-plugin-path /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -o /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Build/Intermediates.noindex/Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.o -index-unit-output-path /Flexer.build/Debug/Flexer.build/Objects-normal/arm64/LookAheadIteratorProtocol.o -index-store-path /Users/matt/Library/Developer/Xcode/DerivedData/Flexer-brsplqboquixkzbrpglubmltbqli/Index.noindex/DataStore -index-system-modules
1.  Apple Swift version 6.0-dev (LLVM 31f0cdc6d5ff8a6, Swift aa0786cc7b3190c)
2.  Compiling with effective version 5.10
3.  While evaluating request TypeCheckSourceFileRequest(source_file "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/System.swiftmodule/arm64e-apple-macos.swiftinterface")
4.  While evaluating request TypeCheckFunctionBodyRequest(System.(file).FilePermissions.init(_:)@/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/System.swiftmodule/arm64e-apple-macos.swiftinterface:637:34)
5.  While type-checking statement at [/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/System.swiftmodule/arm64e-apple-macos.swiftinterface:637:61 - line:637:88] RangeText="{ self.init(rawValue: raw) "
6.  While type-checking expression at [/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/System.swiftmodule/arm64e-apple-macos.swiftinterface:637:63 - line:637:86] RangeText="self.init(rawValue: raw"
7.  While type-checking-target starting at /Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/usr/lib/swift/System.swiftmodule/arm64e-apple-macos.swiftinterface:637:68
8.  While evaluating request ValueWitnessRequest(FilePermissions: OptionSet module System, Swift.(file).OptionSet.init(rawValue:))
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           0x0000000109f5e9ac llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
1  swift-frontend           0x0000000109f5d178 llvm::sys::RunSignalHandlers() + 112
2  swift-frontend           0x0000000109f5eff4 SignalHandler(int) + 304
3  libsystem_platform.dylib 0x00000001965eb584 _sigtramp + 56
4  libsystem_pthread.dylib  0x00000001965bac20 pthread_kill + 288
5  libsystem_c.dylib        0x00000001964c7a30 abort + 180
6  libsystem_c.dylib        0x00000001964c6d20 err + 0
7  swift-frontend           0x000000010a4b0f1c swift::NormalProtocolConformance::setWitness(swift::ValueDecl*, swift::Witness) const (.cold.6) + 0
8  swift-frontend           0x0000000106347de4 swift::NormalProtocolConformance::overrideWitness(swift::ValueDecl*, swift::Witness) + 0
9  swift-frontend           0x0000000105dc1404 swift::ConformanceChecker::recordWitness(swift::ValueDecl*, swift::RequirementMatch const&) + 292
10 swift-frontend           0x0000000105dc4374 swift::ConformanceChecker::resolveWitnessViaLookup(swift::ValueDecl*) + 1940
11 swift-frontend           0x0000000105dc4b84 swift::ConformanceChecker::resolveWitnessTryingAllStrategies(swift::ValueDecl*) + 24
12 swift-frontend           0x0000000105dc4de4 swift::ConformanceChecker::resolveSingleWitness(swift::ValueDecl*) + 500
13 swift-frontend           0x0000000105dce444 swift::ValueWitnessRequest::evaluate(swift::Evaluator&, swift::NormalProtocolConformance*, swift::ValueDecl*) const + 120
14 swift-frontend           0x000000010634fc7c swift::ValueWitnessRequest::OutputType swift::Evaluator::getResultUncached<swift::ValueWitnessRequest, swift::ValueWitnessRequest::OutputType swift::evaluateOrDefault<swift::ValueWitnessRequest>(swift::Evaluator&, swift::ValueWitnessRequest, swift::ValueWitnessRequest::OutputType)::'lambda'()>(swift::ValueWitnessRequest const&, swift::ValueWitnessRequest::OutputType swift::evaluateOrDefault<swift::ValueWitnessRequest>(swift::Evaluator&, swift::ValueWitnessRequest, swift::ValueWitnessRequest::OutputType)::'lambda'()) + 228
15 swift-frontend           0x0000000106346050 swift::NormalProtocolConformance::getWitness(swift::ValueDecl*) const + 184
16 swift-frontend           0x0000000106345ecc swift::ProtocolConformance::getWitnessDecl(swift::ValueDecl*) const + 108
17 swift-frontend           0x0000000105dab0c4 (anonymous namespace)::LookupResultBuilder::add(swift::ValueDecl*, swift::DeclContext*, swift::ValueDecl*, swift::Type, bool) + 744
18 swift-frontend           0x0000000105dab51c swift::TypeChecker::lookupMember(swift::DeclContext*, swift::Type, swift::DeclNameRef, swift::SourceLoc, swift::optionset::OptionSet<swift::NameLookupFlags, unsigned int>) + 336
19 swift-frontend           0x0000000105c07e1c swift::constraints::ConstraintSystem::lookupMember(swift::Type, swift::DeclNameRef, swift::SourceLoc) + 192
20 swift-frontend           0x0000000105b50ce8 swift::constraints::ConstraintSystem::performMemberLookup(swift::constraints::ConstraintKind, swift::DeclNameRef, swift::Type, swift::FunctionRefKind, swift::constraints::ConstraintLocator*, bool) + 2812
21 swift-frontend           0x0000000105b53a5c swift::constraints::ConstraintSystem::simplifyMemberConstraint(swift::constraints::ConstraintKind, swift::Type, swift::DeclNameRef, swift::Type, swift::DeclContext*, swift::FunctionRefKind, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::optionset::OptionSet<swift::constraints::ConstraintSystem::TypeMatchFlags, unsigned int>, swift::constraints::ConstraintLocatorBuilder) + 1728
22 swift-frontend           0x0000000105b24d0c swift::constraints::ConstraintSystem::addValueMemberConstraint(swift::Type, swift::DeclNameRef, swift::Type, swift::DeclContext*, swift::FunctionRefKind, llvm::ArrayRef<swift::constraints::OverloadChoice>, swift::constraints::ConstraintLocatorBuilder) + 220
23 swift-frontend           0x0000000105b1f2f8 (anonymous namespace)::ConstraintGenerator::visitUnresolvedDotExpr(swift::UnresolvedDotExpr*) + 1092
24 swift-frontend           0x0000000105b19f64 (anonymous namespace)::ConstraintWalker::walkToExprPost(swift::Expr*) + 776
25 swift-frontend           0x0000000106125238 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 988
26 swift-frontend           0x0000000106126e14 (anonymous namespace)::Traversal::visitApplyExpr(swift::ApplyExpr*) + 40
27 swift-frontend           0x0000000106124f38 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 220
28 swift-frontend           0x0000000106124f0c (anonymous namespace)::Traversal::doIt(swift::Expr*) + 176
29 swift-frontend           0x0000000106124e50 swift::Expr::walk(swift::ASTWalker&) + 32
30 swift-frontend           0x0000000105b15a58 swift::constraints::ConstraintSystem::generateConstraints(swift::Expr*, swift::DeclContext*) + 120
31 swift-frontend           0x0000000105b14d20 swift::constraints::ConstraintSystem::generateConstraints(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 448
32 swift-frontend           0x0000000105b7c578 swift::constraints::ConstraintSystem::solveImpl(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 408
33 swift-frontend           0x0000000105b7be10 swift::constraints::ConstraintSystem::solve(swift::constraints::SyntacticElementTarget&, swift::FreeTypeVariableBinding) + 160
34 swift-frontend           0x0000000105d148ac swift::TypeChecker::typeCheckTarget(swift::constraints::SyntacticElementTarget&, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 312
35 swift-frontend           0x0000000105d1471c swift::TypeChecker::typeCheckExpression(swift::constraints::SyntacticElementTarget&, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 184
36 swift-frontend           0x0000000105d145f0 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::constraints::ContextualTypeInfo, swift::optionset::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 92
37 swift-frontend           0x0000000105de7040 (anonymous namespace)::StmtChecker::typeCheckASTNode(swift::ASTNode&) + 264
38 swift-frontend           0x0000000105dea884 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 160
39 swift-frontend           0x0000000105de8e98 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
40 swift-frontend           0x0000000105de85ec (anonymous namespace)::StmtChecker::typeCheckBody(swift::BraceStmt*&) + 32
41 swift-frontend           0x0000000105de8354 swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 1356
42 swift-frontend           0x000000010622fff4 swift::TypeCheckFunctionBodyRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()>(swift::TypeCheckFunctionBodyRequest const&, swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType)::'lambda'()) + 240
43 swift-frontend           0x000000010619d5d4 swift::AbstractFunctionDecl::getTypecheckedBody() const + 120
44 swift-frontend           0x00000001062d72b0 swift::SourceFile::typeCheckDelayedFunctions() + 104
45 swift-frontend           0x0000000105e28d58 swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 256
46 swift-frontend           0x0000000105e2a8b0 swift::TypeCheckSourceFileRequest::OutputType swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()>(swift::TypeCheckSourceFileRequest const&, swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType)::'lambda'()) + 232
47 swift-frontend           0x0000000105e28c30 swift::performTypeChecking(swift::SourceFile&) + 84
48 swift-frontend           0x0000000104cf9d70 bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_7>(long, swift::SourceFile&) + 16
49 swift-frontend           0x0000000104cf3800 swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 156
50 swift-frontend           0x0000000104cf3744 swift::CompilerInstance::performSema() + 76
51 swift-frontend           0x0000000104cfe690 swift::ExplicitModuleInterfaceBuilder::buildSwiftModuleFromInterface(llvm::StringRef, llvm::StringRef, bool, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>*, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>, llvm::StringRef) + 1008
52 swift-frontend           0x0000000104d00218 std::__1::error_code llvm::function_ref<std::__1::error_code (swift::SubCompilerInstanceInfo&)>::callback_fn<swift::ImplicitModuleInterfaceBuilder::buildSwiftModuleInternal(llvm::StringRef, bool, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>*, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>)::$_3::operator()() const::'lambda'(swift::SubCompilerInstanceInfo&)>(long, swift::SubCompilerInstanceInfo&) + 208
53 swift-frontend           0x0000000104d0b22c swift::InterfaceSubContextDelegateImpl::runInSubCompilerInstance(llvm::StringRef, llvm::StringRef, llvm::StringRef, llvm::StringRef, swift::SourceLoc, bool, llvm::function_ref<std::__1::error_code (swift::SubCompilerInstanceInfo&)>) + 2372
54 swift-frontend           0x0000000104cfffac void llvm::function_ref<void ()>::callback_fn<swift::ImplicitModuleInterfaceBuilder::buildSwiftModuleInternal(llvm::StringRef, bool, std::__1::unique_ptr<llvm::MemoryBuffer, std::__1::default_delete<llvm::MemoryBuffer>>*, llvm::ArrayRef<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char>>>)::$_3>(long) + 268
55 swift-frontend           0x0000000109ed4fbc llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) + 164
56 swift-frontend           0x0000000109ed50dc RunSafelyOnThread_Dispatch(void*) + 52
57 swift-frontend           0x0000000109ed5104 void* llvm::thread::ThreadProxy<std::__1::tuple<void (*)(void*), (anonymous namespace)::RunSafelyOnThreadInfo*>>(void*) + 24
58 libsystem_pthread.dylib  0x00000001965baf94 _pthread_start + 136
59 libsystem_pthread.dylib  0x00000001965b5d34 thread_start + 8

Expected behavior

The 8/2 snapshot works fine for all of these.

Environment

Apple Swift version 6.0-dev (LLVM 31f0cdc6d5ff8a6, Swift aa0786cc7b3190c) Target: arm64-apple-macosx14.0

Additional information

No response

mattmassicotte commented 2 months ago

This problem looks like it has evolved with (at least) the 8/14 snapshot. I still cannot build any package, but the crash has changed.

1.  Apple Swift version 6.0-dev (LLVM 3751470251df3e4, Swift 026ffddec66fd08)
2.  Compiling with effective version 5.10
3.  While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for Darwin)
4.  While running pass #2548 SILModuleTransform "MandatorySILLinker".
5.  While deserializing SIL function "lgammaf_r"
6.  *** DESERIALIZATION FAILURE ***

The package I'm testing with remains unchanged and has no statements other than the imports.

mattmassicotte commented 2 months ago

The resulting crash has changed again with the 8/21 snapshot. I can now make a brand new package from the built-in template and compile successfully. If I then add import Foundation I can reproduce the failure when trying to build with Xcode 16.

Building from the command line works

1.  Apple Swift version 6.0-dev (LLVM c3efe9282719c35, Swift e26305bb70cce53)
2.  Compiling with effective version 5.10
3.  While evaluating request ExecuteSILPipelineRequest(Run pipelines { Mandatory Diagnostic Passes + Enabling Optimization Passes } on SIL for Darwin)
4.  While running pass #2548 SILModuleTransform "MandatorySILLinker".
5.  While deserializing SIL function "$s6Darwin14POSIXErrorCodeO8rawValueACSgs5Int32V_tcfC"
6.  *** DESERIALIZATION FAILURE ***
*** If any module named here was modified in the SDK, please delete the ***
*** new swiftmodule files from the SDK and keep only swiftinterfaces.   ***
module '_errno', builder version '6.0(6.0)/Apple Swift version 6.0-dev (LLVM c3efe9282719c35, Swift e26305bb70cce53)', built from swiftinterface, resilient, loaded from '/Users/matt/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/_errno-3SWK1TRCCNCB5.swiftmodule'
SILFunction type mismatch for '$s6Darwin14POSIXErrorCodeO8rawValueACSgs5Int32V_tcfC': '$@convention(method) (Int32, @thin POSIXErrorCode.Type) -> Optional<POSIXErrorCode>' != '$@convention(method) (Int32, @thin POSIXErrorCode.Type) -> Optional<POSIXErrorCode>'