Skip to content

Commit ba9f703

Browse files
authored
Merge pull request swiftlang#79066 from swiftlang/elsh/pcmo-warning
[6.1][Package CMO] downgrade error to warning when checking for deserialization failure
2 parents 4f4f9a7 + f4f9b29 commit ba9f703

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
@@ -4723,7 +4723,7 @@ NOTE(ambiguous_because_of_trailing_closure,none,
47234723
(bool, const ValueDecl *))
47244724

47254725
// In-package resilience bypassing
4726-
ERROR(cannot_bypass_resilience_due_to_missing_member,none,
4726+
WARNING(cannot_bypass_resilience_due_to_missing_member,none,
47274727
"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",
47284728
(Identifier, bool, Identifier, Identifier, Identifier))
47294729

lib/AST/Decl.cpp

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

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)