Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't build target with external SPM dependency #5195

Closed
iSalahK opened this issue May 22, 2023 · 6 comments
Closed

Can't build target with external SPM dependency #5195

iSalahK opened this issue May 22, 2023 · 6 comments
Labels
type:bug Something isn't working

Comments

@iSalahK
Copy link

iSalahK commented May 22, 2023

What happened?

When compiling a target with an external SPM dependency, I got this compilation error:

./MyProject/Tuist/Dependencies/SwiftPackageManager/.build/checkouts/XMPPFramework/Package.swift:2:8: No such module 'PackageDescription'
It looks like it's trying to compile the SPM Package.swift file, I don't have this kind of issue with other SPM dependencies.
Package repository: https://github.com/robbiehanson/XMPPFramework.git

How do we reproduce it?

SampleApp with the error:
https://github.com/tuist/tuist/files/11541267/SampleXmppTuist.zip

  1. Add https://github.com/robbiehanson/XMPPFramework.git to Dependencies.swift
let packages: [Package] = [
    .package(url: "https://github.com/robbiehanson/XMPPFramework.git", .exact("4.1.0")),
]
let dependencies = Dependencies(
    swiftPackageManager: .init(packages),
    platforms: [.iOS]
)
  1. Run tuist fetch
  2. Create a Tuist Project with a target which has the XMPPFramework as an external TargetDependency
  3. Run tuist generate
  4. Build your target
  5. The compilation fails with "No such module 'PackageDescription'"

Error log

./MyProject/Tuist/Dependencies/SwiftPackageManager/.build/checkouts/XMPPFramework/Package.swift:2:8: No such module 'PackageDescription'

macOS version

13.3.1

Tuist version

3.19.0

Xcode version

14.3

@iSalahK iSalahK added the type:bug Something isn't working label May 22, 2023
@danieleformichelli
Copy link
Collaborator

Please provide sample project

@iSalahK
Copy link
Author

iSalahK commented May 23, 2023

Sure, here is a basic sample app with a SPM dependency to the XMPPFramework.

SampleXmppTuist.zip

@Lilfaen
Copy link
Contributor

Lilfaen commented May 30, 2023

Using .remote(url: "https://github.com/robbiehanson/XMPPFramework.git", requirement: .exact("4.1.0")) instead of .package(url: "https://github.com/robbiehanson/XMPPFramework.git", .exact("4.1.0")) works for me.

See here: https://tuist.github.io/tuist/main/documentation/projectdescription/dependencies/
The .package is used in the SPM package description, i believe, not in tuist: https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html#package-dependency

@iSalahK
Copy link
Author

iSalahK commented Jun 2, 2023

Using .remote(url: "https://github.com/robbiehanson/XMPPFramework.git", requirement: .exact("4.1.0")) instead of .package(url: "https://github.com/robbiehanson/XMPPFramework.git", .exact("4.1.0")) works for me.

See here: https://tuist.github.io/tuist/main/documentation/projectdescription/dependencies/ The .package is used in the SPM package description, i believe, not in tuist: https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html#package-dependency

@Lilfaen
I've updated the dependency with .remote instead of .package and I still have the exact same issue.
Can you share a working sample ?

@github-actions
Copy link
Contributor

github-actions bot commented Jul 4, 2023

Hola 👋,

We want to inform you that the issue has been marked as stale. This means that there hasn't been any activity or updates on it for quite some time, and it's possible that it may no longer be relevant or actionable.
If you still believe that this issue is valid and requires attention, please provide an update or any additional information that can help us address it. Otherwise, we may consider closing it in the near future.
Thank you for your understanding.

@github-actions github-actions bot added the stale label Jul 4, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jul 9, 2023

Hola 👋,

We want to inform you that we have decided to close this stale issue as there hasn't been any activity or response regarding it after marking it as stale.

We understand that circumstances may have changed or priorities may have shifted, and that's completely understandable. If you still believe that this issue needs to be addressed, please feel free to reopen it and provide any necessary updates or additional information.

We appreciate your understanding and look forward to your continued contributions to the project.

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants