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

Removing package from Package.swift doesn't result in import error

    XMLWordPrintable

    Details

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

      Xcode 12.4

      Description

      Reproduction steps:

      1. Create a new SwiftPM package.
      2. Add (say) ArgumentParser as a dependency https://github.com/apple/swift-argument-parser
      3. Add import ArgumentParser to one of the source code files. Things should compile okay with swift build.
      4. Remove the ArgumentParser dependency from Package.swift
      5. Run swift build again.

      Expected behavior: Second run of swift build should fail because ArgumentParser is no longer a dependency, so the module should fail to import.

      Actual behavior: Second run of swift build succeeds, but trying swift build -c release fails with the expected error.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              theindigamer Varun Gandhi
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated: