Skip to content

Fix makePathRelative using wrong base path when projectDirectory differs#1608

Merged
yonaskolb merged 2 commits intomasterfrom
yonaskolb/fix-1606-path-reg
Mar 12, 2026
Merged

Fix makePathRelative using wrong base path when projectDirectory differs#1608
yonaskolb merged 2 commits intomasterfrom
yonaskolb/fix-1606-path-reg

Conversation

@yonaskolb
Copy link
Owner

@yonaskolb yonaskolb commented Mar 12, 2026

Summary

  • Fixes missing parent directory in absolute paths in 2.45.3 #1606
  • makePathRelative used project.basePath to compute the aggregated parent path, while resolveGroupPath used projectDirectory ?? project.basePath. When these differ (e.g. via --project flag), intermediate group paths become inconsistent, causing Xcode to resolve source files to the wrong location (parent directory dropped).
  • Regression from Various synced folder enhancements #1596 which added the makePathRelative call in the createIntermediateGroups code path.
  • Extracts a basePath computed property to consolidate projectDirectory ?? project.basePath and prevent future mismatches.

Test plan

  • Added test: "generates intermediate groups with different projectDirectory" — verifies paths resolve correctly when projectDirectory differs from basePath
  • All 74 existing tests pass
  • Verified with real project generation: xcodegen generate --spec ProjectRoot/XcodeGen/project.yml --project ProjectRoot/ now produces correct paths

🤖 Generated with Claude Code

yonaskolb and others added 2 commits March 12, 2026 17:56
…ers (#1606)

`makePathRelative` used `project.basePath` to compute parent paths, while
`resolveGroupPath` used `projectDirectory ?? project.basePath`. When these
differ (e.g. via --project flag), intermediate group paths become inconsistent,
causing Xcode to resolve files to the wrong location.

Regression from #1596 which added the `makePathRelative` call in the
`createIntermediateGroups` code path.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Consolidates `projectDirectory ?? project.basePath` into a single
`basePath` property to prevent future mismatches between path resolution
call sites.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@yonaskolb yonaskolb merged commit 3e6e5e3 into master Mar 12, 2026
6 checks passed
@yonaskolb yonaskolb deleted the yonaskolb/fix-1606-path-reg branch March 12, 2026 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing parent directory in absolute paths in 2.45.3

1 participant