[Bug]: [xcodemake] Parsing error in swift-collections
Bug Description
While testing out the incremental build feature, I got the following error related to the swift-collections package:
❌ [stderr] make: *** No rule to make target /Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by /Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'.
o3 diagnosed the issue as a space parsing error and offered the following patch (with extraneous formatting and comments):
@@
-# regex for file path argument (handles spaces escaped with backslash)
-my $notSpace = "[^\\\\\\s]";
-$fileArg = "$notSpace+(?:\\\\.$notSpace*)*";
+# regex for file path argument
+# – matches EITHER a quoted path ("... with spaces.swift")
+# OR the traditional token where any spaces are backslash-escaped.
+my $notSpace = "[^\\\\\\s\"]";
+$fileArg = "(?:\"[^\"]+\"|$notSpace+(?:\\\\.$notSpace*)*)";
@@
unescape("{}()", $make_target_object);
escape("\$& ", $make_target_object);
dollarEscape($make_dep_source);
unescape("'", $make_dep_source);
+ # -- NEW: normalise prerequisite path --------------------
+ # • drop surrounding double-quotes if present
+ # • escape any literal spaces ('$' and '&' already covered)
+ $make_dep_source =~ s/^"(.*)"$/$1/;
+ escape("\$& ", $make_dep_source);
@@ # identical block appears three times (Swift, Clang, and Obj-C loops)
unescape("{}()", $make_target_object);
escape("\$& ", $make_target_object);
dollarEscape($make_dep_source);
unescape("'", $make_dep_source);
+ $make_dep_source =~ s/^"(.*)"$/$1/;
+ escape("\$& ", $make_dep_source);
@@
unescape("{}()", $make_target_object);
escape("\$& ", $make_target_object);
dollarEscape($make_dep_source);
unescape("'", $make_dep_source);
+ $make_dep_source =~ s/^"(.*)"$/$1/;
+ escape("\$& ", $make_dep_source);
I applied the patch and tested it with the existing build output .log file and it resolved the issue.
I compared against this version of cameroncooke/xcodemake.
Debug Output
N/A
Editor/Client
Cursor 1.0.0
MCP Server Version
1.8.0
LLM
N/A
MCP Configuration
Steps to Reproduce
- Create a template iOS app project in Xcode
- Add the swift-collections
- Open the project in Cursor with XcodeBuildMCP configured with
INCREMENTAL_BUILDS_ENABLEDenv var. - Ask Cursor to build the project with XcodeBuildMCP
- Verify a
Makefileand.logfile are generated in the project root directory - Add a print statement somewhere in the project
- Ask Cursor to build the project with XcodeBuildMCP incrementally
- Verify tool call says
ℹ️ Using make for incremental build - Verify error message is shown related to
OrderedDictionary+Partial
Expected Behavior
Tool call result should include:
✅ iOS Simulator Build build succeeded for scheme my-app-name.
Actual Behavior
Tool call includes error messages and falls back to a clean build:
❌ [stderr] make: *** No rule to make target `/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by `/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'. Stop.
❌ iOS Simulator Build build failed for scheme my-app-name.
Error Messages
❌ [stderr] make: *** No rule to make target `/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by `/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'. Stop.
❌ iOS Simulator Build build failed for scheme my-app-name.
Thanks for the report and the investigation!
Would you mind opening this issue on my fork of xcodemake repo https://github.com/cameroncooke/xcodemake and then linking back to here?
Cameron.
On Mon, 9 Jun 2025 at 10:07, Chris Trott @.***> wrote:
twocentstudios created an issue (cameroncooke/XcodeBuildMCP#61) https://github.com/cameroncooke/XcodeBuildMCP/issues/61 Bug Description
While testing out the incremental build feature, I got the following error related to the swift-collections https://github.com/apple/swift-collections package:
❌ [stderr] make: *** No rule to make target /Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by /Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'.
o3 diagnosed the issue https://chatgpt.com/share/68469fa5-2e8c-8009-bdac-ce379449717b as a space parsing error and offered the following patch (with extraneous formatting and comments):
@@-# regex for file path argument (handles spaces escaped with backslash)-my $notSpace = "[^\\\s]";-$fileArg = "$notSpace+(?:\\.$notSpace*)";+# regex for file path argument+# – matches EITHER a quoted path ("... with spaces.swift")+# OR the traditional token where any spaces are backslash-escaped.+my $notSpace = "[^\\\s"]";+$fileArg = "(?:"[^"]+"|$notSpace+(?:\\.$notSpace))"; @@ unescape("{}()", $make_target_object); escape("$& ", $make_target_object); dollarEscape($make_dep_source); unescape("'", $make_dep_source);+ # -- NEW: normalise prerequisite path --------------------+ # • drop surrounding double-quotes if present+ # • escape any literal spaces ('$' and '&' already covered)+ $make_dep_source =~ s/^"(.)"$/$1/;+ escape("$& ", $make_dep_source); @@ # identical block appears three times (Swift, Clang, and Obj-C loops) unescape("{}()", $make_target_object); escape("$& ", $make_target_object); dollarEscape($make_dep_source); unescape("'", $make_dep_source);+ $make_dep_source =~ s/^"(.)"$/$1/;+ escape("$& ", $make_dep_source); @@ unescape("{}()", $make_target_object); escape("$& ", $make_target_object); dollarEscape($make_dep_source); unescape("'", $make_dep_source);+ $make_dep_source =~ s/^"(.)"$/$1/;+ escape("$& ", $make_dep_source);
I applied the patch and tested it with the existing build output .log file and it resolved the issue.
I compared against this version of cameroncooke/xcodemake https://github.com/cameroncooke/xcodemake/blob/1749682a99794edc257010b3eaa35c39f0f91c50/xcodemake . Debug Output
N/A Editor/Client
Cursor 1.0.0 MCP Server Version
1.8.0 LLM
N/A MCP Configuration
Steps to Reproduce
- Create a template iOS app project in Xcode
- Add the swift-collections https://github.com/apple/swift-collections
- Open the project in Cursor with XcodeBuildMCP configured with INCREMENTAL_BUILDS_ENABLED env var.
- Ask Cursor to build the project with XcodeBuildMCP
- Verify a Makefile and .log file are generated in the project root directory
- Add a print statement somewhere in the project
- Ask Cursor to build the project with XcodeBuildMCP incrementally
- Verify tool call says ℹ️ Using make for incremental build
- Verify error message is shown related to OrderedDictionary+Partial
Expected Behavior
Tool call result should include:
✅ iOS Simulator Build build succeeded for scheme my-app-name.
Actual Behavior
Tool call includes error messages and falls back to a clean build:
❌ [stderr] make: *** No rule to make target
/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'. Stop.❌ iOS Simulator Build build failed for scheme my-app-name.
Error Messages
❌ [stderr] make: *** No rule to make target
/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/SourcePackages/checkouts/swift-collections/Sources/OrderedCollections/OrderedDictionary/OrderedDictionary+Partial', needed by/Users/c/Library/Developer/Xcode/DerivedData/my-app-name-hdhpknjobkgfcxerwaixgtsphmfo/Build/Intermediates.noindex/swift-collections.build/Debug-iphonesimulator/OrderedCollections.build/Objects-normal/arm64/OrderedDictionary+Partial MutableCollection.o'. Stop.❌ iOS Simulator Build build failed for scheme my-app-name.— Reply to this email directly, view it on GitHub https://github.com/cameroncooke/XcodeBuildMCP/issues/61, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAEZ6SM72UYEJX7XT6MR6KL3CVFE5AVCNFSM6AAAAAB64NDBFOVHI2DSMVQWIX3LMV43ASLTON2WKOZTGEZDSNRXGIZTGMA . You are receiving this because you are subscribed to this thread.Message ID: @.***>
That repo doesn't have public Issues yet (only PRs), but happy to once that happens.
Apologies! I've enabled Issues!
Done! 🚢 Feel free to close.