Skip to content

[Serialization] Suggest a solution path for modified swiftmodules causing deserialization failures #60610

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

Merged
merged 1 commit into from
Aug 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lib/Serialization/ModuleFileSharedCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,8 @@ void ModuleFileSharedCore::fatal(llvm::Error error) const {
llvm::raw_svector_ostream out(errorStr);

out << "*** DESERIALIZATION FAILURE ***\n";
out << "*** If any module named here was modified in the SDK, please delete the ***\n";
out << "*** new swiftmodule files from the SDK and keep only swiftinterfaces. ***\n";
outputDiagnosticInfo(out);
out << "\n";
if (error) {
Expand Down
2 changes: 2 additions & 0 deletions test/Serialization/Recovery/crash-recovery.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,7 @@ public class Sub: Base {
// CHECK-CRASH-4_2: Compiling with effective version 4.2
// CHECK-CRASH: While loading members for 'Sub' (in module 'Lib')
// CHECK-CRASH-LABEL: *** DESERIALIZATION FAILURE ***
// CHECK-CRASH-LABEL: *** If any module named here was modified in the SDK, please delete the ***
// CHECK-CRASH-LABEL: *** new swiftmodule files from the SDK and keep only swiftinterfaces. ***
// CHECK-CRASH: module 'Lib' with full misc version {{.*}}4.1.50
// CHECK-CRASH: could not find 'disappearingMethod()' in parent class
4 changes: 4 additions & 0 deletions test/Serialization/Recovery/crash-xref.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

// RUN: cat %t/normal_stderr | %FileCheck %s -check-prefixes=NORMALFAILURE
// NORMALFAILURE-LABEL: *** DESERIALIZATION FAILURE ***
// NORMALFAILURE-LABEL: *** If any module named here was modified in the SDK, please delete the ***
// NORMALFAILURE-LABEL: *** new swiftmodule files from the SDK and keep only swiftinterfaces. ***
// NORMALFAILURE-NEXT: module 'Client' with full misc version {{.*}}'
// NORMALFAILURE-NEXT: Could not deserialize type for 'foo()'
// NORMALFAILURE-NEXT: Caused by: top-level value not found
Expand All @@ -33,6 +35,8 @@

// RUN: cat %t/error_stderr | %FileCheck %s -check-prefixes=ALLOWFAILURE
// ALLOWFAILURE-LABEL: *** DESERIALIZATION FAILURE ***
// ALLOWFAILURE-LABEL: *** If any module named here was modified in the SDK, please delete the ***
// ALLOWFAILURE-LABEL: *** new swiftmodule files from the SDK and keep only swiftinterfaces. ***
// ALLOWFAILURE-NEXT: module 'Client' with full misc version {{.*}}' (built with -experimental-allow-module-with-compiler-errors)
// ALLOWFAILURE-NEXT: Could not deserialize type for 'foo()'
// ALLOWFAILURE-NEXT: Caused by: top-level value not found
Expand Down