Hive Hive
Sign in

fix(cli): locate DerivedData for spaced project names

GitHub issue · Closed

Metadata
Source
tuist/tuist #11583
Updated
Jul 5, 2026
Domains
CLI
Details

What changed

  • Updated DerivedDataLocator to mirror Xcode’s DerivedData directory prefix behavior by replacing spaces in the project/workspace name with underscores before appending the existing MD5 path hash.
  • Added a regression test using a project path with a space in the filename to assert that Tuist looks under the underscore-normalized DerivedData prefix.
  • Updated the agent guidance in the root and CLI AGENTS.md files so CLI validation regenerates a narrow Tuist workspace and uses xcodebuild/xcsiftbuild instead of falling back to SwiftPM, preserving Tuist caching.

Why

A customer’s Xcode scheme post-action could run tuist inspect build, but Tuist failed to find the generated .xcactivitylog. The project filename contained a space, so Tuist looked under a DerivedData directory prefixed with the literal name while Xcode wrote the logs under the same prefix with spaces replaced by underscores.

Root cause

DerivedDataLocator used the raw basenameWithoutExt as the DerivedData directory prefix. Xcode sanitizes spaces in that prefix to underscores, while keeping the hash based on the full original path. Because the prefix differed, tuist inspect build searched the wrong DerivedData directory for projects with spaces in their names.

Impact

Build insights collection can now locate Xcode activity logs for project/workspace names containing spaces. The guideline update also prevents future CLI work from bypassing Tuist-generated workspaces and cache usage during validation.

Validation

  • tuist install
  • tuist generate tuist TuistXcodeBuildProducts TuistXcodeBuildProductsTests ProjectDescription --no-open
  • xcodebuild test -workspace Tuist.xcworkspace -scheme Tuist-Workspace -only-testing TuistXcodeBuildProductsTests/DerivedDataLocatorTests -destination platform=macOS -derivedDataPath /private/tmp/tuist-insights-derived-data CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= COMPILATION_CACHE_ENABLE_CACHING=NO
    • Result: ** TEST SUCCEEDED ** with 9 DerivedDataLocatorTests passing, including locate_replaces_spaces_in_hash_based_path_prefix().
  • git diff --check -- AGENTS.md cli/AGENTS.md cli/Sources/TuistXcodeBuildProducts/DerivedDataLocator.swift cli/Tests/TuistXcodeBuildProductsTests/Utils/DerivedDataLocatorTests.swift
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
T
tuist[bot] Jun 30, 2026

🛠️ Tuist Run Report 🛠️

Tests 🧪
Scheme Status Cache hit rate Tests Skipped Ran Commit
TuistAcceptanceTests 90 % 194 0 194 0c9dba3ed
TuistUnitTests 90 % 3922 6 3916 0c9dba3ed
Failed Tests ❌
Flaky Tests ⚠️
  • TuistUnitTests: 3 flaky tests (View all)
Test case Module Suite
parseTestStatuses_extractsModuleAndSuiteNames() TuistXCResultServiceTests XCResultServiceTests
parseTestWithCustomLabelXCResult() TuistXCResultServiceTests XCResultServiceTests
parseTestXCResult() TuistXCResultServiceTests XCResultServiceTests
Builds 🔨
Scheme Status Duration Commit
TuistAcceptanceTests 2m 33s 0c9dba3ed
TuistUnitTests 3m 33s 0c9dba3ed