Skip to content

Commit 997eab4

Browse files
authored
Merge pull request #79019 from swiftlang/elsh/downgrade-to-warning
Package CMO: downgrade error to warning when checking for deserialization errors.
2 parents c831aa5 + 4b6e0bf commit 997eab4

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4745,7 +4745,7 @@ NOTE(ambiguous_because_of_trailing_closure,none,
47454745
(bool, const ValueDecl *))
47464746

47474747
// In-package resilience bypassing
4748-
ERROR(cannot_bypass_resilience_due_to_missing_member,none,
4748+
WARNING(cannot_bypass_resilience_due_to_missing_member,none,
47494749
"cannot bypass resilience due to member deserialization failure while attempting to access %select{member %0|missing member}1 of %2 in module %3 from module %4",
47504750
(Identifier, bool, Identifier, Identifier, Identifier))
47514751

lib/AST/Decl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4810,6 +4810,7 @@ bool ValueDecl::bypassResilienceInPackage(ModuleDecl *accessingModule) const {
48104810
if (auto IDC = dyn_cast<IterableDeclContext>(this)) {
48114811
// Recursively check if members and their members have failing
48124812
// deserialization, and emit a diagnostic.
4813+
// FIXME: It throws a warning for now; need to upgrade to an error.
48134814
IDC->checkDeserializeMemberErrorInPackage(accessingModule);
48144815
}
48154816
}

test/SILOptimizer/package-cmo-disallow-bypass-resilience-on-deserialization-fail.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222

2323
/// Build a swift module that depends on the above Core swift module without `INCLUDE_FOO`;
2424
/// it should fail and diagnose that there was a deserialization failure.
25-
// RUN: not %target-build-swift-dylib(%t/artifacts/SwiftBuilds/%target-library-name(MyUIA)) %t/src/UIA.swift \
25+
// RUN: %target-build-swift-dylib(%t/artifacts/SwiftBuilds/%target-library-name(MyUIA)) %t/src/UIA.swift \
2626
// RUN: -module-name MyUIA -emit-module -package-name pkg \
2727
// RUN: -enable-library-evolution -O -wmo \
2828
// RUN: -I %t/artifacts/SwiftBuilds -L %t/artifacts/SwiftBuilds \
2929
// RUN: -I %t/artifacts/ObjcBuilds -L %t/artifacts/ObjcBuilds \
3030
// RUN: -lMyCore -lObjCAPI -Rmodule-loading \
3131
// RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK
32-
// CHECK-DAG: error: cannot bypass resilience due to member deserialization failure while attempting to access missing member of 'PkgStructA' in module 'MyCore' from module 'MyCore'
32+
// CHECK-DAG: warning: cannot bypass resilience due to member deserialization failure while attempting to access missing member of 'PkgStructA' in module 'MyCore' from module 'MyCore'
3333

3434
/// Build a swift module that depends on Core without `INCLUDE_FOO` but
3535
/// opt out of deserialization checks; it builds even though deserialization failed.

0 commit comments

Comments
 (0)