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

Poor diagnostic when importing executable target module in a test

    XMLWordPrintable

    Details

      Description

      swift test -v
      /swift-3.0-RELEASE-ubuntu15.10/usr/bin/swiftc --driver-mode=swift -I /swift-3.0-RELEASE-ubuntu15.10/usr/lib/swift/pm -L /swift-3.0-RELEASE-ubuntu15.10/usr/lib/swift/pm -lPackageDescription /home/test_main/Package.swift -fileno 4
      /swift-3.0-RELEASE-ubuntu15.10/usr/bin/swift-build-tool -f /home/test_main/.build/debug.yaml test -v
      '/swift-3.0-RELEASE-ubuntu15.10/usr/bin/swiftc' -Xlinker '-rpath=$ORIGIN' -g -L/home/test_main/.build/debug -o /home/test_main/.build/debug/test_mainPackageTests.xctest -module-name test_mainPackageTests /home/test_main/Tests/LinuxMain.swift -emit-executable -I /home/test_main/.build/debug /home/test_main/.build/debug/test_mainTests.build/test_mainTests.swift.o /home/test_main/.build/debug/test_main.build/main.swift.o /home/test_main/.build/debug/test_main.build/test_no_main.swift.o
      /usr/bin/ld.gold: error: /home/test_main/.build/debug/test_main.build/main.swift.o: multiple definition of 'main'
      /usr/bin/ld.gold: /tmp/LinuxMain-41188c.o: previous definition here
      /usr/bin/ld.gold: fatal error: /home/test_main/.build/debug/test_mainPackageTests.xctest: open: Is a directory
      clang: error: linker command failed with exit code 1 (use -v to see invocation)
      <unknown>:0: error: link command failed with exit code 1 (use -v to see invocation)
      <unknown>:0: error: build had 1 command failures
      error: exit(1): /swift-3.0-RELEASE-ubuntu15.10/usr/bin/swift-build-tool -f /home/test_main/.build/debug.yaml test -v

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              ontouchstart Sam Liu
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: