Skip to content

[5.3][Serialization] Add option to load swiftmodule files as volatile and avoid mmap #33172

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 3 commits into from
Jul 29, 2020

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Jul 28, 2020

Swiftmodule files are loaded with mmap when read by a client for deserialization. This can lead to crashes when building Swift projects in parallel if a client is reading from a swiftmodule file while the project installing it replaces the file. This PR adds a frontend flag to force loading swiftmodule files as volatile and avoid mmap.

xymus added 3 commits July 28, 2020 15:54
Avoid mmaping swiftmodule files to hopefully fix issues seen when
building many Swift projects in parallel on NFS. This only affects
loading ModuleFile, it doesn't affect scanning swiftmodule for
dependecies which are still handled as non-volatile.

rdar://63755989
Introduce a new frontend flag -enable-volatile-modules to trigger
loading swiftmodule files as volatile and avoid using mmap. Revert the
default behavior to using mmap.

rdar://63755989
@xymus xymus added the r5.3 label Jul 28, 2020
@xymus xymus requested a review from nkcsgexi July 28, 2020 23:33
@xymus xymus requested a review from a team as a code owner July 28, 2020 23:33
@xymus
Copy link
Contributor Author

xymus commented Jul 28, 2020

@swift-ci Please test

@xymus
Copy link
Contributor Author

xymus commented Jul 29, 2020

@swift-ci Please nominate

@xymus xymus merged commit ffef4da into swiftlang:release/5.3 Jul 29, 2020
@AnthonyLatsis AnthonyLatsis added swift 5.3 🍒 release cherry pick Flag: Release branch cherry picks labels Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍒 release cherry pick Flag: Release branch cherry picks swift 5.3
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants