You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are two packages in the repository, "NetworkUser" and "PseudoNetworkModule".
"NetworkUser" depends on "PseudoNetworkModule".
As you can see in Package.swift of "PseudoNetworkModule", its package name is "Network" and library name is "SwiftNetwork". (Yes, "Network" is the same name with a new module introduced from macOS >= 10.14.)
Both product target and test target of "NetworkUser" import "Network".
[Discussion]
`swift test` in "NetworkUser" induces the linker error, however, tests with Xcode(10.2) are successful without any errors.
There are no errors on Linux.
The workaround is, of course, to change the names of "PseudoNetworkModule" 🙂
The text was updated successfully, but these errors were encountered:
Hm. I think the target name is the one that matters, which makes sense because not every target is a project, but then I wonder why we allow the target name to be different from the library name. @aciidb0mb3r?
Hmm, looks like the linker is not resolving the symbols from SwiftNetwork dylib (maybe its auto linking to system Network?). It works fine if I rename the product to just "Network".
@belkadan A library can contain multiple top-level targets in the SwiftPM model.
Environment
Apple Swift version 5.0 (swiftlang-1001.0.69.5 clang-1001.0.46.3)
Apple Swift Package Manager - Swift 5.0.0 (swiftpm-14490.60.2)
macOS Mojave 10.14.4
Additional Detail from JIRA
md5: 40c0280556a7f72372155cc3ab22649e
Issue Description:
A linker error occurs under very limited conditions.
[How to reproduce (on macOS)]
Then, you can see errors like below:
[Explanation]
There are two packages in the repository, "NetworkUser" and "PseudoNetworkModule".
"NetworkUser" depends on "PseudoNetworkModule".
As you can see in Package.swift of "PseudoNetworkModule", its package name is "Network" and library name is "SwiftNetwork". (Yes, "Network" is the same name with a new module introduced from macOS >= 10.14.)
Both product target and test target of "NetworkUser" import "Network".
[Discussion]
`swift test` in "NetworkUser" induces the linker error, however, tests with Xcode(10.2) are successful without any errors.
There are no errors on Linux.
The workaround is, of course, to change the names of "PseudoNetworkModule" 🙂
The text was updated successfully, but these errors were encountered: