Uploaded image for project: 'Swift'
  1. Swift
  2. SR-6091

Module linked multiple times if dylib is importing same module that main executable does

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Medium
    • Resolution: Duplicate
    • Component/s: Package Manager
    • Labels:
      None
    • Environment:

      macos, swift 4.0

      Description

      I noticed I am getting Class X.Y is implemented in both A and B when loading dylib importing module X while main module (the one that loads dylib) is importing same module X.

       

      I created PluginInterface module that is supposed dynamically linked to PluginImplementation package which will create dylib. Then I created PluginConsumer package that loads libPluginImplementation.dylib and imports PluginInterface to be able to comunicate with the plugin. When I run PluginConsumer, I get mentioned error when I load dylib:

       

      objc[66212]: Class _TtC15PluginInterface15PluginInterface is implemented in both /Users/Lope/Dev/swift/SwiftPlugins/PluginConsumer/.build/x86_64-apple-macosx10.10/debug/libPluginInterface.dylib (0x10fc7b668) and /Users/Lope/Dev/swift/SwiftPlugins/PluginImplementation/.build/x86_64-apple-macosx10.10/debug/libPluginInterface.dylib (0x1107dd668). One of the two will be used. Which one is undefined.

       

      You can find all three packages in following repositories:

       

      https://github.com/Lopdo/SwiftPlugins-PluginInterface

      https://github.com/Lopdo/SwiftPlugins-PluginImplementation

      https://github.com/Lopdo/SwiftPlugins-PluginConsumer

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                Lope Lope
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: