Skip to content

Serialization: Restrict swiftmodules to distribution channels #72001

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 2 commits into from
Mar 1, 2024

Conversation

xymus
Copy link
Contributor

@xymus xymus commented Mar 1, 2024

There are scenarios where different compilers are distributed with compatible serialization format versions and the same tag. Distinguish swiftmodules in such a case by assigning them to different distribution channels. A compiler expecting a specific channel will only read swiftmodules from the same channel. The channels should be defined by downstream code as it is by definition vendor specific.

For compiler developers, using a compiler without a set channel or defining the env var SWIFT_IGNORE_SWIFTMODULE_REVISION skips this new check.

rdar://123731777

@xymus
Copy link
Contributor Author

xymus commented Mar 1, 2024

@swift-ci Please smoke test

xymus added 2 commits March 1, 2024 10:52
There are scenarios where different compilers are distributed with
compatible serialization format versions and the same tag. Distinguish
swiftmodules in such a case by assigning them to different distribution
channels. A compiler expecting a specific channel will only read
swiftmodules from the same channel. The channels should be defined by
downstream code as it is by definition vendor specific.

For development, a no-channel compiler loads or defining the env var
SWIFT_IGNORE_SWIFTMODULE_REVISION skips this new check.

rdar://123731777
@xymus xymus force-pushed the restrict-to-channel branch from a07d0fb to 7edd23a Compare March 1, 2024 18:55
@xymus
Copy link
Contributor Author

xymus commented Mar 1, 2024

Removed having the channel default to the vendor name as it's likely not a stable enough value for testing. The channel will need to be set in downstream code where it is useful.

@swift-ci Please smoke test

Copy link
Contributor

@tshortli tshortli left a comment

Choose a reason for hiding this comment

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

Looks great, thanks!

@xymus
Copy link
Contributor Author

xymus commented Mar 1, 2024

@swift-ci Please smoke test macOS

@xymus
Copy link
Contributor Author

xymus commented Mar 1, 2024

@swift-ci Please smoke test Linux

@xymus xymus merged commit 70cf5d4 into swiftlang:main Mar 1, 2024
@xymus xymus deleted the restrict-to-channel branch March 1, 2024 22:54
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.

2 participants