Skip to content

[Serialization] Delay all actions in the same module together. #8123

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

Conversation

jrose-apple
Copy link
Contributor

Back in December @DougGregor added code to delay the formation of generic environments until all declarations from a particular module had been deserialized, to avoid circular dependencies caused by too-eager deserialization of protocol members. This worked great for fully-built modules, but still had some problems with module merging, the phase of multi-file compilation where the "partial" swiftmodules that correspond to each source file in a target are loaded and remitted as a single swiftmodule. Fix this by picking one of the partial swiftmodules as the representative one for delayed actions, and wait until deserialization is complete for all of the serialized ASTs in the same target to form the generic environments.

rdar://problem/30984417

Back in December DougG added code to delay the formation of generic
environments until all declarations from a particular module had been
deserialized, to avoid circular dependencies caused by too-eager
deserialization of protocol members. This worked great for fully-built
modules, but still had some problems with module merging, the phase of
multi-file compilation where the "partial" swiftmodules that
correspond to each source file in a target are loaded and remitted as
a single swiftmodule. Fix this by picking one of the partial
swiftmodules as the representative one for delayed actions, and wait
until deserialization is complete for /all/ of the serialized ASTs in
the same target to form the generic environments.

rdar://problem/30984417
@jrose-apple jrose-apple requested a review from slavapestov March 15, 2017 21:50
@jrose-apple
Copy link
Contributor Author

@swift-ci Please test

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test Linux Platform
Git Commit - ab45afd
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

@shahmishal The label job failed and that failed even the top-level job? :-( https://ci.swift.org/job/swift-PR-Linux/6353/

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test Linux

@swift-ci
Copy link
Contributor

Build failed
Jenkins build - Swift Test OS X Platform
Git Commit - ab45afd
Test requested by - @jrose-apple

@jrose-apple
Copy link
Contributor Author

@swift-ci Please smoke test macOS

@slavapestov
Copy link
Contributor

LGTM. I'm not a fan of radar numbers in identifiers in test code, but I won't insist you change it before checking it in. ;)

@jrose-apple jrose-apple merged commit a8e4e72 into swiftlang:master Mar 16, 2017
@jrose-apple jrose-apple deleted the serialization-multi-file-circularity-ad-infinitum branch March 16, 2017 22:22
@jrose-apple
Copy link
Contributor Author

Thanks. I wanted to make it clear that they were unrelated to the other types already in the test, and to discourage people from reusing them in future additions. Many of these circularity issues are order-dependent.

@DougGregor
Copy link
Member

I completely forgot about the multi-partial-module merging case. Thanks, @jrose-apple

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.

4 participants