mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Serialization: restrict swiftmodules to distribution channels
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
This commit is contained in:
@@ -58,7 +58,7 @@ const uint16_t SWIFTMODULE_VERSION_MAJOR = 0;
|
||||
/// describe what change you made. The content of this comment isn't important;
|
||||
/// it just ensures a conflict if two people change the module format.
|
||||
/// Don't worry about adhering to the 80-column limit for this line.
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 858; // Replace inherited types with protocols in protocol layout
|
||||
const uint16_t SWIFTMODULE_VERSION_MINOR = 859; // channel check
|
||||
|
||||
/// A standard hash seed used for all string hashes in a serialized module.
|
||||
///
|
||||
@@ -860,6 +860,7 @@ namespace control_block {
|
||||
TARGET,
|
||||
SDK_NAME,
|
||||
REVISION,
|
||||
CHANNEL,
|
||||
IS_OSSA,
|
||||
ALLOWABLE_CLIENT_NAME,
|
||||
HAS_NONCOPYABLE_GENERICS,
|
||||
@@ -898,6 +899,11 @@ namespace control_block {
|
||||
BCBlob
|
||||
>;
|
||||
|
||||
using ChannelLayout = BCRecordLayout<
|
||||
CHANNEL,
|
||||
BCBlob
|
||||
>;
|
||||
|
||||
using IsOSSALayout = BCRecordLayout<
|
||||
IS_OSSA,
|
||||
BCFixed<1>
|
||||
|
||||
Reference in New Issue
Block a user