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

SPM fails to invoke plugins when building local dependencies

    XMLWordPrintable

    Details

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

      DEVELOPMENT-SNAPSHOT-2021-03-07-a

      Description

      If a local dependency uses a package manager plugin, packages that depend on it fail to invoke the plugins when building. I have attached a minimal pair of example projects as a test case. If you navigate to the client-package directory, and run

      SWIFTPM_ENABLE_PLUGINS=1 swift build
      

      it fails with

      Open File failed on file: plugin-local-dependency/client-package/.build/x86_64-unknown-linux-gnu/debug/ModuleCache/modules.timestamp
      Error: No such file or directory
      Attempted again: 10 times
      plugin-local-dependency/example-package/Sources/Example/example.swift:3:11: error: cannot find type 'X' in scope
          let x:X
                ^
      

      However, if you build example-package directly, the plugin runs as expected, and it builds successfully.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            taylorswift taylor swift
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated: