Support SwiftDriver output file maps from Xcode 16.3+#7
Conversation
|
Does adding build setting EMIT_FRONTEND_COMMAND_LINES=YES in the project work to get the old format? |
|
I believe so. With This PR is useful for the default Xcode 16.3+ behavior, where those frontend command lines are not emitted unless the project opts into that setting. In that case, |
|
Rather than practically rewriting the script which is risky, couldn't we just add EMIT_FRONTEND_COMMAND_LINES=YES to the xcodebuild invocation? |
|
Yes, I think that would probably work and would be a much smaller patch. I see the tradeoff as short-term compatibility vs supporting the new default format: Happy to switch to the smaller approach if you prefer. |
|
At this stage I'll opt for the smaller incremental approach please. You never know what Xcode 27 will have in store. It's good you pointed this out though. I wonder how many people gave up? |
|
Okay, I'll check later to make a simpler approach, not sure how much people gave up, on my side it's somehow working with or without that change using recent version of Xcode. I took inspiration on that fork which is from the main maintainer of XcodeBuildMCP just to use modern technologies and make it useful for most people |
|
Man, everybody's coding Perl now! I'd still opt for the smaller change since that option resurfaces the old behaviour. The trick is going to be working out where on the command line to insert the build setting. |
|
I've invited you as a collaborator as your knowledge of this script as just overtaken mine though I'd still like to review PRs before they are merged for now as "I know some things about Apple build systems". BTW, another user is vibing up an InjectionMCP server if you're interested: johnno1962/InjectionNext#133. |
|
Sure, will check 😁 |
Summary
Make
xcodemakeunderstand the Swift build output produced by Xcode 16.3+.Newer Xcode versions often describe Swift compilation through
SwiftDriverand an-output-file-mapJSON file, rather than only through the olderSwiftCompilelines. Without parsing this format,xcodemakecan miss Swift files when generating the Makefile.This adds support for that format, so editing a Swift file is more likely to trigger the right incremental
makerebuild instead of requiringxcodebuildto recapture the project.Details
SwiftDrivercompiler entries.-output-file-mapJSON withJSON::PP.SwiftDriverand legacySwiftCompile.SwiftCompilelog entries that do not include a compiler invocation.Validation
perl -c xcodemake/usr/bin/make -n -f .xcodemake/Makefilereported no overriding-target or missing-target diagnostics.touchcommands.