Skip to content

Package CMO: downgrade error to warning when checking for deserialization errors. #79019

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -4735,7 +4735,7 @@ NOTE(ambiguous_because_of_trailing_closure,none,
(bool, const ValueDecl *))

// In-package resilience bypassing
ERROR(cannot_bypass_resilience_due_to_missing_member,none,
WARNING(cannot_bypass_resilience_due_to_missing_member,none,
"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",
(Identifier, bool, Identifier, Identifier, Identifier))

Expand Down
1 change: 1 addition & 0 deletions lib/AST/Decl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4752,6 +4752,7 @@ bool ValueDecl::bypassResilienceInPackage(ModuleDecl *accessingModule) const {
if (auto IDC = dyn_cast<IterableDeclContext>(this)) {
// Recursively check if members and their members have failing
// deserialization, and emit a diagnostic.
// FIXME: It throws a warning for now; need to upgrade to an error.
IDC->checkDeserializeMemberErrorInPackage(accessingModule);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@

/// Build a swift module that depends on the above Core swift module without `INCLUDE_FOO`;
/// it should fail and diagnose that there was a deserialization failure.
// RUN: not %target-build-swift-dylib(%t/artifacts/SwiftBuilds/%target-library-name(MyUIA)) %t/src/UIA.swift \
// RUN: %target-build-swift-dylib(%t/artifacts/SwiftBuilds/%target-library-name(MyUIA)) %t/src/UIA.swift \
// RUN: -module-name MyUIA -emit-module -package-name pkg \
// RUN: -enable-library-evolution -O -wmo \
// RUN: -I %t/artifacts/SwiftBuilds -L %t/artifacts/SwiftBuilds \
// RUN: -I %t/artifacts/ObjcBuilds -L %t/artifacts/ObjcBuilds \
// RUN: -lMyCore -lObjCAPI -Rmodule-loading \
// RUN: 2>&1 | %FileCheck %s --check-prefix=CHECK
// 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'
// 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'

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