Skip to content

Commit 9e207e5

Browse files
committed
[Serialization] Suggest a fix for roots in deserialization failures
Most deserialization failures at this points are caused by roots installed over the SDK. Let's extend the error message with a solution for such a case. rdar://86280699
1 parent 9e4a00d commit 9e207e5

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

lib/Serialization/ModuleFileSharedCore.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,8 @@ void ModuleFileSharedCore::fatal(llvm::Error error) const {
564564
llvm::raw_svector_ostream out(errorStr);
565565

566566
out << "*** DESERIALIZATION FAILURE ***\n";
567+
out << "*** If an SDK root installed any module named below, please delete the ***\n";
568+
out << "*** swiftmodule files from the root and keep only swiftinterface files. ***\n";
567569
outputDiagnosticInfo(out);
568570
out << "\n";
569571
if (error) {

test/Serialization/Recovery/crash-recovery.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,7 @@ public class Sub: Base {
1717
// CHECK-CRASH-4_2: Compiling with effective version 4.2
1818
// CHECK-CRASH: While loading members for 'Sub' (in module 'Lib')
1919
// CHECK-CRASH-LABEL: *** DESERIALIZATION FAILURE ***
20+
// CHECK-CRASH-LABEL: *** If an SDK root installed any module named below, please delete the ***
21+
// CHECK-CRASH-LABEL: *** swiftmodule files from the root and keep only swiftinterface files. ***
2022
// CHECK-CRASH: module 'Lib' with full misc version {{.*}}4.1.50
2123
// CHECK-CRASH: could not find 'disappearingMethod()' in parent class

0 commit comments

Comments
 (0)