Skip to content

[Serialization] Recover from failures under AnyObjectLookup #41647

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
Mar 4, 2022

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Mar 3, 2022

rdar://89494507

@xymus xymus requested a review from bnbarham March 3, 2022 19:02
@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

@beccadax Thank you for the concise reproducer!

@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

CC @nkcsgexi since this is close to something you're investigating.

Copy link
Contributor

@nkcsgexi nkcsgexi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +795 to +801
auto declOrError = getDeclChecked(item.second);
if (!declOrError) {
if (!getContext().LangOpts.EnableDeserializationRecovery)
fatal(declOrError.takeError());
consumeError(declOrError.takeError());
continue;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have this block in... quite a few places now. Should we abstract it into another method? Probably fine to do in a follow up either way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could use an alternative to getDeclChecked that drops the error. It could clean up these call sites a bit and we could use it to apply more precise filtering of the errors, to drop only XRef/implementation-only errors for example.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me!

@xymus xymus force-pushed the recover-from-anyobject-lookup branch from a5a592d to 694b629 Compare March 3, 2022 21:02
@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

Updated to use the mock-sdk and fix other OSes.

@swift-ci Please smoke test

@xymus xymus force-pushed the recover-from-anyobject-lookup branch from 694b629 to 4d75242 Compare March 3, 2022 21:54
@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

@swift-ci Please smoke test

1 similar comment
@xymus
Copy link
Contributor Author

xymus commented Mar 3, 2022

@swift-ci Please smoke test

@xymus
Copy link
Contributor Author

xymus commented Mar 4, 2022

@swift-ci Please smoke test macOS

@xymus xymus merged commit 48e23a6 into swiftlang:main Mar 4, 2022
@xymus xymus deleted the recover-from-anyobject-lookup branch March 4, 2022 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants