tuist: 📦 [Dependencies.swift][SPM] 'No such module' with custom configurations
Describe the bug
When building with a custom configuration using SPM packages with Dependencies.swift, we receive a ‘No such module’ error.
To Reproduce Steps to reproduce the behavior:
- Create a project with custom configurations
- Add SPM packages using
Dependencies.swiftfile - Create a local framework that depends of the SPM
- Build the main project using a custom configuration
- See error
Expected behavior A successfully build
Desktop (please complete the following information):
- OS: Monterey (12.1)
- Version 2.7.2
Additional context
I found this issue #3599 and has applied the changes of #3683, but the problem still happening.
tuist generate output
Using bundled version at path /Users/lucasmpaim/banco/ios/.tuist-bin
Built ProjectDescriptionHelpers in (0.343s)
Target 'Bid' has been linked from target 'AppApp', target 'CoreRepository', target 'CoreRepositoryInterface', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'Bid' has been linked from target 'CoreRepositoryInterface' and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'Bid' has been linked from target 'CoreRepository' and target 'CoreRepositoryInterface', it is a static product so may introduce unwanted side effects.
Target 'DateHelper' has been linked from target 'AppApp', target 'AppCore', target 'AppNetwork', target 'Credits', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'DateHelper' has been linked from target 'AppCore', target 'AppNetwork', and target 'Credits', it is a static product so may introduce unwanted side effects.
Target 'DateHelper' has been linked from target 'AppCore', target 'AppNetwork', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'DateHelper' has been linked from target 'AppCore' and target 'AppNetwork', it is a static product so may introduce unwanted side effects.
Target 'InputMask' has been linked from target 'AppApp' and target 'AppUI', it is a static product so may introduce unwanted side effects.
Target 'JWTDecode' has been linked from target 'AppApp' and target 'AppNetwork', it is a static product so may introduce unwanted side effects.
Target 'KeychainAccess' has been linked from target 'AppApp', target 'AppCore', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'KeychainAccess' has been linked from target 'AppCore' and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'Lottie' has been linked from target 'AppApp' and target 'AppCore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppApp', target 'AppCore', target 'AppExtract', target 'AppNetwork', target 'AppPermissions', target 'AppUI', target 'Credits', target 'DataLayer', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore' and target 'AppExtract', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore', target 'AppNetwork', target 'AppUI', target 'Credits', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore', target 'AppNetwork', target 'DataLayer', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore', target 'AppNetwork', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore' and target 'AppPermissions', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore', target 'AppUI', and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore' and target 'AppUI', it is a static product so may introduce unwanted side effects.
Target 'PromiseKit' has been linked from target 'AppCore' and target 'ObjectStore', it is a static product so may introduce unwanted side effects.
Target 'Realm' has been linked from target 'AppApp', target 'CoreRepository', target 'CoreRepositoryInterface', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'Realm' has been linked from target 'CoreRepositoryInterface' and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'Realm' has been linked from target 'CoreRepository' and target 'CoreRepositoryInterface', it is a static product so may introduce unwanted side effects.
Target 'RealmCore' has been linked from target 'AppApp', target 'CoreRepository', target 'CoreRepositoryInterface', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'RealmCore' has been linked from target 'CoreRepositoryInterface' and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'RealmCore' has been linked from target 'CoreRepository' and target 'CoreRepositoryInterface', it is a static product so may introduce unwanted side effects.
Target 'RealmSwift' has been linked from target 'AppApp', target 'CoreRepository', target 'CoreRepositoryInterface', and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'RealmSwift' has been linked from target 'CoreRepositoryInterface' and target 'DataLayer', it is a static product so may introduce unwanted side effects.
Target 'RealmSwift' has been linked from target 'CoreRepository' and target 'CoreRepositoryInterface', it is a static product so may introduce unwanted side effects.
Target 'SnapKit' has been linked from target 'AppApp', target 'AppExtract', target 'AppUI', and target 'Credits', it is a static product so may introduce unwanted side effects.
Target 'SnapKit' has been linked from target 'AppUI' and target 'Credits', it is a static product so may introduce unwanted side effects.
Target 'SwiftRichString' has been linked from target 'AppApp', target 'AppCore', target 'AppUI', and target 'Credits', it is a static product so may introduce unwanted side effects.
Target 'SwiftRichString' has been linked from target 'AppCore', target 'AppUI', and target 'Credits', it is a static product so may introduce unwanted side effects.
Target 'SwiftRichString' has been linked from target 'AppCore' and target 'AppUI', it is a static product so may introduce unwanted side effects.
The project 'NetAnalyser' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'CryptoSwift' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'SnapKit' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'MarqueeLabel' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'JWTDecode' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'Lottie' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'PromiseKit' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'SDWebImage' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'IQKeyboardManagerSwift' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'SwiftRichString' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'UXCam' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'RealmDatabase' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'Realm' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'KeychainAccess' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'Alamofire' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'DateHelper' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'Adjust' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
The project 'InputMask' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
Generating workspace App.xcworkspace
Generating project AppExtract
Generating project AppPermissions
Generating project AppFlags
Generating project AppLogger
Generating project AppCrypto
Generating project AppCore
Generating project App
Generating project AppSelfie
Generating project AppUI
Generating project CoreRepository
Generating project CoreTesting
Generating project Credits
Generating project DataLayer
Generating project FeatureFlags
Generating project AppNetwork
Generating project ObjectStore
Generating project ProjectConfig
Generating project ReleaseFlags
Generating project Alamofire
Generating project CryptoSwift
Generating project DateHelper
Generating project IQKeyboardManagerSwift
Generating project JWTDecode
Generating project KeychainAccess
Generating project MarqueeLabel
Generating project NetAnalyser
Generating project PromiseKit
Generating project SDWebImage
Generating project SnapKit
Generating project SwiftRichString
Generating project InputMask
Generating project UXCam
Generating project Adjust
Generating project Lottie
Generating project RealmDatabase
Generating project Realm
Project generated.
Total time taken: 4.516s
Dependencies.swift
import ProjectDescription
let dependencies = Dependencies(
carthage: [],
swiftPackageManager: SwiftPackageManagerDependencies(
[
.remote(url: "https://github.com/SnapKit/SnapKit", requirement: .exact("5.0.1")),
.remote(url: "https://github.com/melvitax/DateHelper", requirement: .exact("4.4.1")),
.remote(url: "https://github.com/malcommac/SwiftRichString.git", requirement: .exact("3.6.0")),
.remote(url: "https://github.com/krzyzanowskim/CryptoSwift", requirement: .exact("1.4.0")),
.remote(url: "https://github.com/mxcl/PromiseKit.git", requirement: .exact("6.16.3")),
.remote(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", requirement: .exact("4.2.2")),
.remote(url: "https://github.com/auth0/JWTDecode.swift.git", requirement: .exact("2.4.0")),
.remote(url: "https://github.com/airbnb/lottie-ios.git", requirement: .exact("3.1.5")),
.remote(url: "https://github.com/cbpowell/MarqueeLabel.git", requirement: .exact("4.0.2")),
.remote(url: "https://github.com/Alamofire/Alamofire", requirement: .exact("5.1.0")),
.remote(url: "https://github.com/RedMadRobot/input-mask-ios", requirement: .exact("6.0.0")),
.remote(url: "https://github.com/lucasmpaim/NetAnalyser.git", requirement: .exact("0.0.3")),
.remote(url: "https://github.com/hackiftekhar/IQKeyboardManager.git", requirement: .exact("6.5.8")),
.remote(url: "https://github.com/SDWebImage/SDWebImage", requirement: .exact("5.12.1")),
.remote(url: "https://github.com/adjust/ios_sdk", requirement: .exact("4.29.3")),
.remote(url: "https://github.com/uxcam/ios-sdk", requirement: .exact("3.3.0")),
.remote(
url: "https://github.com/realm/realm-swift.git",
requirement: .exact("10.22.0")
)
],
baseSettings: Settings.settings(
configurations: [
.debug(name: "Prod-Debug"),
.debug(name: "QA-Debug"),
.debug(name: "Debug"),
.release(name: "Prod-Release"),
.release(name: "QA-Release"),
.release(name: "Release")
]
)
),
platforms: [.iOS]
)
When I made a build with Debug configuration, everything works file, but when I use a custom configuration like Prod-Debug I receive errors like:
❌ /Users/lucasmpaim/banco/ios/AppPackages/AppCore/Sources/AppCore/DateHelper/Private/DateHelperFormatter.swift:9:8: no such module 'DateHelper'
import DateHelper
For the packages, I just create the configurations with the same name than my root project and local packages without the .xcconfig files, also failed with a empty .xcconfig file.
Something weird, is that I receive warnings about the project:
The project 'DateHelper' has missing or mismatching configurations. It has [Debug (debug), Release (release)], other projects have [Debug (debug), Prod-Debug (debug), Prod-Release (release), QA-Debug (debug), QA-Release (release), Release (release)]
but when I look the generated project all configurations are there
SPM Screenshot
Root Project Screenshot
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 19 (4 by maintainers)
I think it has been fixed by @mstfy in 3.1.0, have you tried it out?