tuist / tuist

Tuist's CLI
https://tuist.io
MIT License
4.57k stars 554 forks source link

Can't find build configuration or variant for caching #6458

Closed AndreaMiotto closed 3 months ago

AndreaMiotto commented 3 months ago

What problem or need do you have?

When I try tuist generate I get the following error:

We couldn't find a build configuration of variant 'debug' for caching. Make sure one exists in the project.

Here my Project.swift

import ProjectDescription

let settings: Settings = .settings(
    configurations: [
        .debug(name: "Debug", xcconfig: "./Configs/Debug.xcconfig"),
        .release(name: "Release", xcconfig: "./Configs/Release.xcconfig"),
    ]
)

let project = Project(
    name: "App",
    organizationName: "",
    settings: settings,
    targets: [
        .target(
            name: "App",
            destinations: .visionOS,
            product: .app,
            bundleId: "com.xxx.xxx",
            deploymentTargets: .visionOS("1.0.0"),
            infoPlist: "App/Info.plist",
            sources: ["App/Sources/**"],
            resources: ["App/Resources/**"],
            dependencies: []
        ),
        // .target(
        //     name: "GucciAncorTests",
        //     destinations: .visionOS,
        //     product: .unitTests,
        //     bundleId: "com.gucci.gucci.AppTests",
        //     infoPlist: .default,
        //     sources: ["AppTests/**"],
        //     resources: [],
        //     dependencies: [.target(name: "AppTests")]
        // ),
    ],
    schemes: [
        .scheme(
            name: "App-Debug",
            shared: true,
            buildAction: .buildAction(targets: ["App"]),
//            testAction: .targets(["AppTests"]),
            runAction: .runAction(executable: "App")
        ),
        .scheme(
            name: "App-Release",
            shared: true,
            buildAction: .buildAction(targets: ["App"]),
            runAction: .runAction(executable: "App")
        )
    ]
)

Potential solution

No response

macOS version

14.5

Tuist version

4.18.0

Xcode version

15.4

fortmarek commented 3 months ago

Hey @AndreaMiotto!

Would you mind providing a fully reproducible sample here? The Project.swift file is very similar to our fixture with a custom configuration where tuist cache does work.

AndreaMiotto commented 3 months ago

I switched the deploymentTargets to .ios, and the generation worked. The I switched again into .visionos and it was still working. Not so sure what happened but now I'm fine.