@@ -286,10 +286,18 @@ struct ModuleRebuildInfo {
286286 // / Emits a diagnostic for all out-of-date compiled or forwarding modules
287287 // / encountered while trying to load a module.
288288 void diagnose (ASTContext &ctx, SourceLoc loc, StringRef moduleName,
289- StringRef interfacePath) {
289+ StringRef interfacePath, StringRef prebuiltCacheDir ) {
290290 ctx.Diags .diagnose (loc, diag::rebuilding_module_from_interface,
291291 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+ }
293301 // We may have found multiple failing modules, that failed for different
294302 // reasons. Emit a note for each of them.
295303 for (auto &mod : outOfDateModules) {
@@ -911,7 +919,7 @@ class ModuleInterfaceLoaderImpl {
911919 // Diagnose that we didn't find a loadable module, if we were asked to.
912920 auto remarkRebuild = [&]() {
913921 rebuildInfo.diagnose (ctx, diagnosticLoc, moduleName,
914- interfacePath);
922+ interfacePath, prebuiltCacheDir );
915923 };
916924 // If we found an out-of-date .swiftmodule, we still want to add it as
917925 // a dependency of the .swiftinterface. That way if it's updated, but
0 commit comments