mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Merge pull request #78672 from artemcm/DepScanInvalidRejectedBinaryModulesWarn
[Dependency Scanning] Emit a warning when failing to load a binary module of a non-resilient dependency
This commit is contained in:
@@ -325,45 +325,6 @@ struct ModuleRebuildInfo {
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *invalidModuleReason(serialization::Status status) {
|
||||
using namespace serialization;
|
||||
switch (status) {
|
||||
case Status::FormatTooOld:
|
||||
return "compiled with an older version of the compiler";
|
||||
case Status::FormatTooNew:
|
||||
return "compiled with a newer version of the compiler";
|
||||
case Status::RevisionIncompatible:
|
||||
return "compiled with a different version of the compiler";
|
||||
case Status::ChannelIncompatible:
|
||||
return "compiled for a different distribution channel";
|
||||
case Status::NotInOSSA:
|
||||
return "module was not built with OSSA";
|
||||
case Status::MissingDependency:
|
||||
return "missing dependency";
|
||||
case Status::MissingUnderlyingModule:
|
||||
return "missing underlying module";
|
||||
case Status::CircularDependency:
|
||||
return "circular dependency";
|
||||
case Status::FailedToLoadBridgingHeader:
|
||||
return "failed to load bridging header";
|
||||
case Status::Malformed:
|
||||
return "malformed";
|
||||
case Status::MalformedDocumentation:
|
||||
return "malformed documentation";
|
||||
case Status::NameMismatch:
|
||||
return "name mismatch";
|
||||
case Status::TargetIncompatible:
|
||||
return "compiled for a different target platform";
|
||||
case Status::TargetTooNew:
|
||||
return "target platform newer than current platform";
|
||||
case Status::SDKMismatch:
|
||||
return "SDK does not match";
|
||||
case Status::Valid:
|
||||
return nullptr;
|
||||
}
|
||||
llvm_unreachable("bad status");
|
||||
}
|
||||
|
||||
/// Emits a diagnostic for all out-of-date compiled or forwarding modules
|
||||
/// encountered while trying to load a module.
|
||||
template<typename... DiagArgs>
|
||||
@@ -406,9 +367,9 @@ struct ModuleRebuildInfo {
|
||||
// If there was a compiled module that wasn't able to be read, diagnose
|
||||
// the reason we couldn't read it.
|
||||
if (auto status = mod.serializationStatus) {
|
||||
if (auto reason = invalidModuleReason(*status)) {
|
||||
if (auto reason = SerializedModuleLoaderBase::invalidModuleReason(*status)) {
|
||||
diags.diagnose(loc, diag::compiled_module_invalid_reason,
|
||||
mod.path, reason);
|
||||
mod.path, reason.value());
|
||||
} else {
|
||||
diags.diagnose(loc, diag::compiled_module_invalid, mod.path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user