swiftlang / swift

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

swift-frontend bundled with Xcode 15.4 fails “Unhandled adjustment” assertion on GitHub Actions #75830

Open jaanus opened 3 months ago

jaanus commented 3 months ago

Description

On GitHub Actions, my code fails to compile with Xcode 15.4 with error Assertion failed: (false && "Unhandled adjustment"), function adjustTypeForDeclReference, file CSApply.cpp, line 971.

I cannot reproduce this locally with Xcode 15.4 or Xcode 16 betas. My code is warning-free, error-free. It compiles, builds, and tests as expected.

Reproduction

The code related to the crash seems to be:

public protocol CanopyRecordValueGetting {
  subscript(_ key: String) -> (any CKRecordValueProtocol)? { get }
}

struct CKRecordEncryptedValuesReader: CanopyRecordValueGetting {
  let record: CKRecord
  subscript(key: String) -> CKRecordValueProtocol? {
    record.encryptedValues[key]
  }
}

I cannot reproduce this problem locally. The code is error-free and warning-free. It builds and tests as expected for me locally.

Stack dump

2024-08-10T20:16:36.0708800Z /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/bin/swift-frontend -frontend -c /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/AnyClock.swift /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/ImmediateClock.swift /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/Internal/Lock.swift -primary-file /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/Internal/_AsyncTimerSequence.swift -primary-file /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/SwiftUI.swift -primary-file /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/TestClock.swift /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/Timer.swift /Users/runner/work/Canopy/Canopy/.build/checkouts/swift-clocks/Sources/Clocks/UnimplementedClock.swift -supplementary-output-file-map /var/folders/m_/cksx93ys47x4621g0zbw_m4m0000gn/T/TemporaryDirectory.VnJPhj/supplementaryOutputs-2 -target arm64-apple-macosx10.15 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug -I /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/ModuleCache -suppress-warnings -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/bin/swift-driver -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -enable-experimental-feature StrictConcurrency -empty-abi-descriptor -resource-dir /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -isysroot -Xcc /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -Xcc -F -Xcc /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -Xcc -g -module-name Clocks -package-name swift_clocks -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/lib/swift/host/plugins -plugin-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/local/lib/swift/host/plugins -parse-as-library -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/Clocks.build/_AsyncTimerSequence.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/Clocks.build/SwiftUI.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/Clocks.build/TestClock.swift.o -index-store-path /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/index/store -index-system-modules
2024-08-10T20:16:46.9822050Z error: compile command failed due to signal 6 (use -v to see invocation)
2024-08-10T20:16:46.9839970Z Assertion failed: (false && "Unhandled adjustment"), function adjustTypeForDeclReference, file CSApply.cpp, line 971.
2024-08-10T20:16:46.9841160Z Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
2024-08-10T20:16:46.9841900Z Stack dump:
2024-08-10T20:16:46.9891490Z 0. Program arguments: /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/bin/swift-frontend -frontend -c /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitCursorArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitLookupInfoArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitRecordArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitRecordIDArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitRecordZoneArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitRecordZoneIDArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitServerChangeTokenArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitShareArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitShareMetadataArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitShareParticipantArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Archiving/CloudKitSubscriptionArchive.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKContainerAPI/CKContainerAPIType+Shorthand.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKContainerAPI/CKContainerAPIType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKContainerType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKDatabaseAPI/CKDatabaseAPIType+Shorthand.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKDatabaseAPI/CKDatabaseAPIType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CKDatabaseType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecordType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/MockCanopyResultRecord+ValueStore.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/MockCanopyResultRecord.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyType.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CKRecordError.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CKRecordZoneError.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CKRequestError.swift -primary-file /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CKSubscriptionError.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CKTransactionError.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Errors/CanopyError.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Extensions/CKRecord.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/DeletedCKRecord.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/FetchDatabaseChangesResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/FetchRecordsResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/FetchZoneChangesMethod.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/FetchZoneChangesResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/ModifyRecordsResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/ModifySubscriptionsResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Results/ModifyZonesResult.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Settings/CanopySettings.swift /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/Settings/CanopySettingsType.swift -supplementary-output-file-map /var/folders/m_/cksx93ys47x4621g0zbw_m4m0000gn/T/TemporaryDirectory.RkngCh/supplementaryOutputs-2 -target arm64-apple-macosx12.0 -Xllvm -aarch64-use-tbi -enable-objc-interop -sdk /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -I /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug -I /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib -F /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -enable-testing -g -module-cache-path /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/ModuleCache -swift-version 5 -Onone -D SWIFT_PACKAGE -D DEBUG -new-driver-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/bin/swift-driver -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift-plugin-server -empty-abi-descriptor -resource-dir /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/lib/swift -enable-anonymous-context-mangled-names -Xcc -isysroot -Xcc /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk -Xcc -F -Xcc /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks -Xcc -fPIC -Xcc -g -module-name CanopyTypes -package-name canopy -target-sdk-version 14.5 -target-sdk-name macosx14.5 -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -external-plugin-path /Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/local/lib/swift/host/plugins#/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/bin/swift-plugin-server -plugin-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/lib/swift/host/plugins -plugin-path /Users/runner/hostedtoolcache/swift-macOS/5.10.1/arm64/usr/local/lib/swift/host/plugins -parse-as-library -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKContainerType.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKDatabaseAPIType+Shorthand.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKDatabaseAPIType.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKDatabaseType.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CanopyResultRecord.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CanopyResultRecordType.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/MockCanopyResultRecord+ValueStore.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/MockCanopyResultRecord.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CanopyType.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKRecordError.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKRecordZoneError.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKRequestError.swift.o -o /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/CanopyTypes.build/CKSubscriptionError.swift.o -index-store-path /Users/runner/work/Canopy/Canopy/.build/arm64-apple-macosx/debug/index/store -index-system-modules
2024-08-10T20:16:47.0047190Z 1. Apple Swift version 5.10.1 (swift-5.10.1-RELEASE)
2024-08-10T20:16:47.0156470Z 2. Compiling with the current language version
2024-08-10T20:16:47.0287910Z 3. While evaluating request TypeCheckSourceFileRequest(source_file "/Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift")
2024-08-10T20:16:47.0427550Z 4. While evaluating request TypeCheckFunctionBodyRequest(CanopyTypes.(file).CanopyResultRecord.CKRecordEncryptedValuesReader._@/Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift:11:54)
2024-08-10T20:16:47.0552730Z 5. While type-checking statement at [/Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift:11:54 - line:13:5] RangeText="{
2024-08-10T20:16:47.0678910Z       record.encryptedValues[key]
2024-08-10T20:16:47.0683210Z     "
2024-08-10T20:16:47.0684560Z 6. While type-checking statement at [/Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift:12:7 - line:12:33] RangeText="record.encryptedValues[key"
2024-08-10T20:16:47.0686430Z 7. While type-checking expression at [/Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift:12:7 - line:12:33] RangeText="record.encryptedValues[key"
2024-08-10T20:16:47.0688120Z 8. While type-checking-target starting at /Users/runner/work/Canopy/Canopy/Targets/CanopyTypes/Sources/CanopyResultRecord/CanopyResultRecord.swift:12:29
2024-08-10T20:16:47.0689600Z 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):
2024-08-10T20:16:47.0701640Z 0  swift-frontend           0x0000000105afd5d0 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) + 56
2024-08-10T20:16:47.0702520Z 1  swift-frontend           0x0000000105afc9bc llvm::sys::RunSignalHandlers() + 112
2024-08-10T20:16:47.0703430Z 2  swift-frontend           0x0000000105afdc0c SignalHandler(int) + 304
2024-08-10T20:16:47.0704070Z 3  libsystem_platform.dylib 0x0000000192aba584 _sigtramp + 56
2024-08-10T20:16:47.0704640Z 4  libsystem_pthread.dylib  0x0000000192a89c20 pthread_kill + 288
2024-08-10T20:16:47.0705200Z 5  libsystem_c.dylib        0x0000000192996a30 abort + 180
2024-08-10T20:16:47.0705750Z 6  libsystem_c.dylib        0x0000000192995d20 err + 0
2024-08-10T20:16:47.0706910Z 7  swift-frontend           0x0000000105e5c55c (anonymous namespace)::ExprRewriter::adjustTypeForDeclReference(swift::Expr*, swift::Type, swift::Type, llvm::function_ref<swift::Type (swift::Type)>) (.cold.6) + 0
2024-08-10T20:16:47.0709660Z 8  swift-frontend           0x0000000101bd1a24 swift::CanType llvm::function_ref<swift::CanType (swift::ArchetypeType*, swift::CanType, swift::ArchetypeType*, llvm::ArrayRef<swift::ProtocolConformanceRef>)>::callback_fn<(anonymous namespace)::ExprRewriter::getOperatorSubstitutions(swift::ValueDecl*, swift::Type)::'lambda'(swift::ArchetypeType*, swift::CanType, swift::ArchetypeType*, llvm::ArrayRef<swift::ProtocolConformanceRef>)>(long, swift::ArchetypeType*, swift::CanType, swift::ArchetypeType*, llvm::ArrayRef<swift::ProtocolConformanceRef>) + 0
2024-08-10T20:16:47.0712820Z 9  swift-frontend           0x0000000101bd13f4 (anonymous namespace)::ExprRewriter::buildMemberRef(swift::Expr*, swift::SourceLoc, swift::constraints::SelectedOverload, swift::DeclNameLoc, swift::constraints::ConstraintLocatorBuilder, swift::constraints::ConstraintLocatorBuilder, bool, swift::AccessSemantics) + 6836
2024-08-10T20:16:47.0714550Z 10 swift-frontend           0x0000000101bc3a04 (anonymous namespace)::ExprWalker::walkToExprPost(swift::Expr*) + 13896
2024-08-10T20:16:47.0715620Z 11 swift-frontend           0x00000001021cf0e8 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 976
2024-08-10T20:16:47.0716620Z 12 swift-frontend           0x00000001021cfb60 (anonymous namespace)::Traversal::visitSubscriptExpr(swift::SubscriptExpr*) + 32
2024-08-10T20:16:47.0718100Z 13 swift-frontend           0x00000001021ceec8 (anonymous namespace)::Traversal::doIt(swift::Expr*) + 432
2024-08-10T20:16:47.0718970Z 14 swift-frontend           0x00000001021ced0c swift::Expr::walk(swift::ASTWalker&) + 32
2024-08-10T20:16:47.0720030Z 15 swift-frontend           0x0000000101bbbf78 (anonymous namespace)::ExprWalker::rewriteTarget(swift::constraints::SyntacticElementTarget) + 1768
2024-08-10T20:16:47.0721340Z 16 swift-frontend           0x0000000101bbb510 swift::constraints::ConstraintSystem::applySolution(swift::constraints::Solution&, swift::constraints::SyntacticElementTarget) + 588
2024-08-10T20:16:47.0722950Z 17 swift-frontend           0x0000000101dd8b8c swift::TypeChecker::typeCheckTarget(swift::constraints::SyntacticElementTarget&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 404
2024-08-10T20:16:47.0724530Z 18 swift-frontend           0x0000000101dd89a0 swift::TypeChecker::typeCheckExpression(swift::constraints::SyntacticElementTarget&, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 184
2024-08-10T20:16:47.0726170Z 19 swift-frontend           0x0000000101dd8874 swift::TypeChecker::typeCheckExpression(swift::Expr*&, swift::DeclContext*, swift::constraints::ContextualTypeInfo, swift::OptionSet<swift::TypeCheckExprFlags, unsigned int>) + 92
2024-08-10T20:16:47.0727690Z 20 swift-frontend           0x0000000101ec1a4c swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 4736
2024-08-10T20:16:47.0728900Z 21 swift-frontend           0x0000000101ec0798 bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::Stmt>(swift::Stmt*&) + 136
2024-08-10T20:16:47.0730130Z 22 swift-frontend           0x0000000101ebda28 (anonymous namespace)::StmtChecker::typeCheckASTNode(swift::ASTNode&) + 188
2024-08-10T20:16:47.0731220Z 23 swift-frontend           0x0000000101ec0864 swift::ASTVisitor<(anonymous namespace)::StmtChecker, void, swift::Stmt*, void, void, void, void>::visit(swift::Stmt*) + 152
2024-08-10T20:16:47.0732400Z 24 swift-frontend           0x0000000101ebf1fc bool (anonymous namespace)::StmtChecker::typeCheckStmt<swift::BraceStmt>(swift::BraceStmt*&) + 136
2024-08-10T20:16:47.0733530Z 25 swift-frontend           0x0000000101ebe95c swift::TypeCheckFunctionBodyRequest::evaluate(swift::Evaluator&, swift::AbstractFunctionDecl*) const + 576
2024-08-10T20:16:47.0734990Z 26 swift-frontend           0x00000001022e6c44 llvm::Expected<swift::TypeCheckFunctionBodyRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckFunctionBodyRequest>(swift::TypeCheckFunctionBodyRequest const&) + 284
2024-08-10T20:16:47.0736740Z 27 swift-frontend           0x00000001022e6adc llvm::Expected<swift::TypeCheckFunctionBodyRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckFunctionBodyRequest, (void*)0>(swift::TypeCheckFunctionBodyRequest const&) + 100
2024-08-10T20:16:47.0738620Z 28 swift-frontend           0x0000000102243b18 swift::TypeCheckFunctionBodyRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckFunctionBodyRequest>(swift::Evaluator&, swift::TypeCheckFunctionBodyRequest, swift::TypeCheckFunctionBodyRequest::OutputType) + 52
2024-08-10T20:16:47.0740030Z 29 swift-frontend           0x000000010237dbb4 swift::SourceFile::typeCheckDelayedFunctions() + 104
2024-08-10T20:16:47.0740980Z 30 swift-frontend           0x0000000101ef7b3c swift::TypeCheckSourceFileRequest::evaluate(swift::Evaluator&, swift::SourceFile*) const + 260
2024-08-10T20:16:47.0742360Z 31 swift-frontend           0x0000000101ef9c28 llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultUncached<swift::TypeCheckSourceFileRequest>(swift::TypeCheckSourceFileRequest const&) + 280
2024-08-10T20:16:47.0744040Z 32 swift-frontend           0x0000000101ef9aac llvm::Expected<swift::TypeCheckSourceFileRequest::OutputType> swift::Evaluator::getResultCached<swift::TypeCheckSourceFileRequest, (void*)0>(swift::TypeCheckSourceFileRequest const&) + 64
2024-08-10T20:16:47.0745840Z 33 swift-frontend           0x0000000101ef795c swift::TypeCheckSourceFileRequest::OutputType swift::evaluateOrDefault<swift::TypeCheckSourceFileRequest>(swift::Evaluator&, swift::TypeCheckSourceFileRequest, swift::TypeCheckSourceFileRequest::OutputType) + 44
2024-08-10T20:16:47.0747680Z 34 swift-frontend           0x0000000100ecff30 bool llvm::function_ref<bool (swift::SourceFile&)>::callback_fn<swift::CompilerInstance::performSema()::$_7>(long, swift::SourceFile&) + 16
2024-08-10T20:16:47.0749210Z 35 swift-frontend           0x0000000100ec9c58 swift::CompilerInstance::forEachFileToTypeCheck(llvm::function_ref<bool (swift::SourceFile&)>) + 76
2024-08-10T20:16:47.0750170Z 36 swift-frontend           0x0000000100ec9bec swift::CompilerInstance::performSema() + 92
2024-08-10T20:16:47.0751230Z 37 swift-frontend           0x0000000100cdf0a8 withSemanticAnalysis(swift::CompilerInstance&, swift::FrontendObserver*, llvm::function_ref<bool (swift::CompilerInstance&)>, bool) + 60
2024-08-10T20:16:47.0752380Z 38 swift-frontend           0x0000000100cd1410 performCompile(swift::CompilerInstance&, int&, swift::FrontendObserver*) + 748
2024-08-10T20:16:47.0753430Z 39 swift-frontend           0x0000000100cd0480 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2096
2024-08-10T20:16:47.0754330Z 40 swift-frontend           0x0000000100b9889c swift::mainEntry(int, char const**) + 2160
2024-08-10T20:16:47.0754890Z 41 dyld                     0x00000001926ff154 start + 2476
2024-08-10T20:16:49.3412150Z ##[error]Process completed with exit code 1.

Expected behavior

My code should build on GitHub Actions without warnings or errors, similarly as it does for me locally.

Environment

macOS 14.6 (23G80) Xcode 15.4 15F31d

Other software in CI image: https://github.com/actions/runner-images/blob/macos-14-arm64/20240805.3/images/macos/macos-14-arm64-Readme.md

Additional information

Link to failed GitHub Actions job run: https://github.com/tact/Canopy/actions/runs/10334206540/job/28607411500?pr=22

Pull request for context: https://github.com/tact/Canopy/pull/22

Link to exact version of code that is triggering the error in GitHub Actions: https://github.com/tact/Canopy/tree/585c5050ec40cbc70242cb0632f5e042e2b33764

jaanus commented 3 months ago

I moved my CI workflow from GitHub Actions to CircleCI. The exact same Xcode version 15.4.0 on CircleCI does NOT have this same error as my local setup has, and builds and tests everything successfully as expected.

So this seems to be specific to GitHub Actions and that machine image.