Skip to content

Commit 2a7aa37

Browse files
authored
Merge pull request #64074 from xymus/report-mismatching-module-version-to-stderr
[Serialization] Remark only on stderr when loading a mismatching swiftmodule
2 parents 644c943 + f4bb6dc commit 2a7aa37

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -811,10 +811,6 @@ ERROR(serialization_module_incompatible_revision,Fatal,
811811
"compiled module was created by a different version of the compiler '%0'; "
812812
"rebuild %1 and try again: %2",
813813
(StringRef, Identifier, StringRef))
814-
REMARK(serialization_module_problematic_revision, none,
815-
"compiled module was created by a different version of the compiler '%0': "
816-
"%1",
817-
(StringRef, StringRef))
818814
ERROR(serialization_missing_single_dependency,Fatal,
819815
"missing required module '%0'", (StringRef))
820816
ERROR(serialization_missing_dependencies,Fatal,

lib/Serialization/SerializedModuleLoader.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -850,11 +850,13 @@ LoadedFile *SerializedModuleLoaderBase::loadAST(
850850
loadedModuleFile->mayHaveDiagnosticsPointingAtBuffer())
851851
OrphanedModuleFiles.push_back(std::move(loadedModuleFile));
852852
} else {
853-
// Report non-fatal compiler tag mismatch.
853+
// Report non-fatal compiler tag mismatch on stderr only to avoid
854+
// polluting the IDE UI.
854855
if (!loadInfo.problematicRevision.empty()) {
855-
Ctx.Diags.diagnose(*diagLoc,
856-
diag::serialization_module_problematic_revision,
857-
loadInfo.problematicRevision, moduleBufferID);
856+
llvm::errs() << "remark: compiled module was created by a different " <<
857+
"version of the compiler '" <<
858+
loadInfo.problematicRevision <<
859+
"': " << moduleBufferID << "\n";
858860
}
859861
}
860862

0 commit comments

Comments
 (0)