Fix path detection for SPM packages when "Build" appears in paths#37
Closed
Copilot wants to merge 6 commits into
Closed
Fix path detection for SPM packages when "Build" appears in paths#37Copilot wants to merge 6 commits into
Copilot wants to merge 6 commits into
Conversation
Co-authored-by: MartinP7r <2669027+MartinP7r@users.noreply.github.com>
Co-authored-by: MartinP7r <2669027+MartinP7r@users.noreply.github.com>
Co-authored-by: MartinP7r <2669027+MartinP7r@users.noreply.github.com>
Co-authored-by: MartinP7r <2669027+MartinP7r@users.noreply.github.com>
Co-authored-by: MartinP7r <2669027+MartinP7r@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix AckGen not found error in Xcode
Fix path detection for SPM packages when "Build" appears in paths
Feb 7, 2026
MartinP7r
added a commit
that referenced
this pull request
Mar 8, 2026
The old code used `components(separatedBy: "/Build/")[0]` which splits on
the first occurrence of "/Build/". This fails when usernames or project
paths contain "Build" (e.g., /Users/Build/Projects/App/Build/...).
Now uses `.range(of: "/Build/", options: .backwards)` to find the last
occurrence, matching the behavior of the shell `${x%/Build/*}` pattern.
Also updates the README run script to use the more robust `%/Build/*`
parameter expansion and proper quoting.
Closes #37
3 tasks
Owner
|
Closing in favor of #40 which applies the core path detection fix cleanly on the current main branch (post-SwiftArgumentParser migration from #31). This PR had the right idea but was based on stale code and included significant scope creep (diagnostic scripts, test scripts, CI workflows). The essential fix (using |
MartinP7r
added a commit
that referenced
this pull request
Mar 8, 2026
The old code used `components(separatedBy: "/Build/")[0]` which splits on
the first occurrence of "/Build/". This fails when usernames or project
paths contain "Build" (e.g., /Users/Build/Projects/App/Build/...).
Now uses `.range(of: "/Build/", options: .backwards)` to find the last
occurrence, matching the behavior of the shell `${x%/Build/*}` pattern.
Also updates the README run script to use the more robust `%/Build/*`
parameter expansion and proper quoting.
Closes #37
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AckGen's path detection fails when usernames or project paths contain "Build" (e.g.,
/Users/Build/Projects/App/Build/Intermediates). The original implementation split on the first/Build/occurrence instead of removing from the last occurrence, producing incorrect base paths.Changes
Core Fix
AckGen.swift): Changed fromcomponents(separatedBy: "/Build/")[0]to.range(of: "/Build/", options: .backwards)awk -F'/Build/' '{print $1}'to${PROJECT_TEMP_DIR%/Build/*}Testing
IntegrationTests.swiftwithcalculateBasePath()helper matching production logictest_path_calculation.shDiagnostic Tools
diagnose_path.swift- Swift diagnostic tool with environment analysisdiagnose_path.sh- Shell equivalent for quick checksDocumentation
Example Edge Case
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.