Skip to content

Commit 73e859a

Browse files
authored
Merge pull request #75912 from xymus/serial-channel-diag
Serialization: reword diagnostic about serialization channel mismatch
2 parents fa72680 + 020d578 commit 73e859a

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

include/swift/AST/DiagnosticsSema.def

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -864,9 +864,10 @@ ERROR(serialization_module_incompatible_revision,Fatal,
864864
"rebuild %1 and try again: %2",
865865
(StringRef, Identifier, StringRef))
866866
ERROR(serialization_module_incompatible_channel,Fatal,
867-
"compiled module was created for a different distribution channel '%0' "
868-
"than the local compiler '%1', "
869-
"please ensure %2 is found from the expected path: %3",
867+
"the binary module for %2 was compiled for '%0', "
868+
"it cannot be imported by the current compiler "
869+
"which is aligned with '%1'. "
870+
"Binary module loaded from path: %3",
870871
(StringRef, StringRef, Identifier, StringRef))
871872
ERROR(serialization_missing_single_dependency,Fatal,
872873
"missing required module '%0'", (StringRef))

test/Serialization/restrict-swiftmodule-to-channel.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public func foo() {}
2525

2626
/// 2. Test importing the non-resilient no-channel library from a channel compiler.
2727
//--- NonResilientClient.swift
28-
import NonResilientLib // expected-error {{compiled module was created for a different distribution channel '' than the local compiler 'restricted-channel', please ensure 'NonResilientLib' is found from the expected path:}}
28+
import NonResilientLib // expected-error {{the binary module for 'NonResilientLib' was compiled for '', it cannot be imported by the current compiler which is aligned with 'restricted-channel'. Binary module loaded from path:}}
2929
foo()
3030

3131
/// Building a NonResilientLib client should reject the import for a tagged compiler
@@ -37,7 +37,7 @@ foo()
3737

3838
/// 3. Test importing the resilient no-channel library.
3939
//--- ResilientClient.swift
40-
import ResilientLib // expected-reject-error {{compiled module was created for a different distribution channel '' than the local compiler 'restricted-channel', please ensure 'ResilientLib' is found from the expected path:}}
40+
import ResilientLib // expected-reject-error {{the binary module for 'ResilientLib' was compiled for '', it cannot be imported by the current compiler which is aligned with 'restricted-channel'. Binary module loaded from path:}}
4141
// expected-rebuild-remark @-1 {{rebuilding module 'ResilientLib' from interface}}
4242
// expected-rebuild-note @-2 {{compiled module is out of date}}
4343
// expected-rebuild-note @-3 {{compiled for a different distribution channel}}
@@ -80,7 +80,7 @@ foo()
8080

8181
/// 4. Test importing the channel restricted library
8282
//--- ChannelClient.swift
83-
import ChannelLib // expected-reject-error {{compiled module was created for a different distribution channel 'restricted-channel' than the local compiler 'other-channel', please ensure 'ChannelLib' is found from the expected path}}
83+
import ChannelLib // expected-reject-error {{the binary module for 'ChannelLib' was compiled for 'restricted-channel', it cannot be imported by the current compiler which is aligned with 'other-channel'. Binary module loaded from path:}}
8484
foo()
8585

8686
/// Importing ChannelLib should succeed with the same channel.

0 commit comments

Comments
 (0)