Hive Hive
Sign in

generate Xcode project with tag query failed

GitHub issue · Open

Metadata
Source
tuist/tuist #8172
Updated
Jun 11, 2026
Domains
CLI
Details

What happened?

We have a multi-module project with this structure,

├── Project.swift
├── Modules
│   ├── analytics
│ │   ├── Project.swift
│   ├── apiclient
│ │   ├── Project.swift

And we are setting a metadata tag for each target in each project using API

let project = Project(
name: "Analytics",
targets: [
.target(
...
metadata: .analytics
)
]
)
extension TargetMetadata {
static var analytics: TargetMetadata {
.metadata(tags: ["Analytics"])
}
}

When try to generate a project with tag query tuist generate tag:Analytics it return an error message

✖ Error
No targets were found. Ensure that the query is valid and matches targets in the graph.

but only works if specify the path for the nested project.swift

How do we reproduce it?

  1. Replicate the project structure
  2. Generate a project using a tag query

Error log

No targets were found. Ensure that the query is valid and matches targets in the graph.

macOS version

14.6

Tuist version

4.68.0

Xcode version

16.1

Flights

Investigate, reproduce, or fix this item in an isolated repository. Each Flight preserves its outcome and agent session.

New Flights are paused Configure model inference, GitHub, and a sandbox provider to start another Flight. Existing results remain available below.
No Flights yet

Start a Flight and preserve its objective, outcome, and session here.

Comments
D
dosubot[bot] Sep 10, 2025

This happens because, in multi-module setups, the tag query (like tuist generate tag:Analytics) only works if the targets with the matching tag are visible to the project graph loaded from the current directory. When you run the command from the root, Tuist may not recursively discover targets in nested Project.swift files for tag filtering, so it can’t find any targets with the requested tag and shows the error. When you specify the path to the nested project, Tuist loads that specific module and its targets, so the tag query works as expected.

This is a limitation in how Tuist’s project graph loader and tag filtering logic work: the tag query depends on the graph traversal including all nested modules, but in practice, it may only apply the filter to the immediate project or not recurse deeply enough to find tagged targets in submodules. There are no recent tickets or documentation updates addressing this specific behavior.

As a workaround, continue specifying the path to the nested module when using tag queries, or consider restructuring your manifests if you need tag queries to work from the root. For more details on how tags are used for filtering, see the TargetMetadata documentation and the generate command reference.

To reply, just mention @dosu.


Docs are dead. Just use Dosu.

Leave Feedback Ask Dosu about tuist Share Dosu with your team

P
pepicrft Sep 10, 2025

Hi @embassem 👋🏼 Thanks for reporting this. I created a small project and I’m unable to reproduce it there. If you run tuist generate tag:analytics it works. Could you check how it behaves on your end? If it works, I’d appreciate if you could reproduce it in the project, and then attach it back. I’ll then happily look into it.

DeliveryHero.zip