@@ -286,10 +286,18 @@ struct ModuleRebuildInfo {
286
286
// / Emits a diagnostic for all out-of-date compiled or forwarding modules
287
287
// / encountered while trying to load a module.
288
288
void diagnose (ASTContext &ctx, SourceLoc loc, StringRef moduleName,
289
- StringRef interfacePath) {
289
+ StringRef interfacePath, StringRef prebuiltCacheDir ) {
290
290
ctx.Diags .diagnose (loc, diag::rebuilding_module_from_interface,
291
291
moduleName, interfacePath);
292
-
292
+ auto SDKVer = getSDKBuildVersion (ctx.SearchPathOpts .SDKPath );
293
+ llvm::SmallString<64 > buffer = prebuiltCacheDir;
294
+ llvm::sys::path::append (buffer, " SystemVersion.plist" );
295
+ auto PBMVer = getSDKBuildVersionFromPlist (buffer.str ());
296
+ if (!SDKVer.empty () && !PBMVer.empty ()) {
297
+ // Remark the potential version difference.
298
+ ctx.Diags .diagnose (loc, diag::sdk_version_pbm_version, SDKVer,
299
+ PBMVer);
300
+ }
293
301
// We may have found multiple failing modules, that failed for different
294
302
// reasons. Emit a note for each of them.
295
303
for (auto &mod : outOfDateModules) {
@@ -911,7 +919,7 @@ class ModuleInterfaceLoaderImpl {
911
919
// Diagnose that we didn't find a loadable module, if we were asked to.
912
920
auto remarkRebuild = [&]() {
913
921
rebuildInfo.diagnose (ctx, diagnosticLoc, moduleName,
914
- interfacePath);
922
+ interfacePath, prebuiltCacheDir );
915
923
};
916
924
// If we found an out-of-date .swiftmodule, we still want to add it as
917
925
// a dependency of the .swiftinterface. That way if it's updated, but
0 commit comments