I tried the workaround suggested by @serge-iv
sudo zsh -c 'grep -v "xcode.lang.comment.recursive" /Applications/Xcode.app/Contents/SharedFrameworks/SourceModel.framework/Versions/A/Resources/LanguageSpecifications/Swift.xclangspec > /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/Swift.xclangspec'
But the OS does not allow me to write to the Xcode.app directory. I have a brand new Mac Mini m2 with Sonoma 14 and Xcode 15.0.1 and FileMerge 2.11. Should I be using something other than FileMerge?
Post
Replies
Boosts
Views
Activity
I disabled SIP and was able to run the "workaround" suggested by @serge-iv and while FileMerge doesn't show the error any longer it crashes immediately with a crash report in Console. So on a hunch, since this doesn't seem to be a hot topic, I removed the file /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/Swift.xclangspec and launched FileMerge from the command line via
opendiff 'r3922 ViewController.swift' ~/Documents/Davelopment/ChatClient/ChatClient/ViewController.swift
and was indeed able to open FileMerge. I must conclude that FileMerge is not being called with the correct parameters rather than there being an issue with FileMerge and Swift files. Why this only seems to be an issue with Swift files I have yet to figure out. ObjC .h and .m files are fine as is the .plist file. Actually every other file type I have tried seems to open fine via FileMerge just fine when called from FileMerge. I will provide an update if I ever figure it out.
[EDIT] So I have figured out a workaround but it isn't the greatest. If SIP is disabled FileMerge works just fine with Swift file. When it is enabled it either crashes, if FileMerge is not already running, OR it displays the base file as blank which is equally as useless. If I disable SIP, which I had to do to run @serge-iv's solution, I discovered it works fine. So I'm not sure where this sits, but for now I will run with SIP disabled.
[UPDATE] I have figured out a workaround but it isn't the greatest. If SIP (System Integrity Protection) is disabled FileMerge works with Swift file from the command line but only from the SnailSVN interface if FileMerge is already running in the background.
When SIP is enabled it either crashes, if FileMerge is not already running, OR it displays the base file as blank which is equally as useless.
So I'm not sure where this sits, but for now I will run with SIP disabled.
Why are swift files are treated differently from every other file? How has this been an issue for 5 years with no resolution? Apple, can you please comment on this.
I have uploaded a simple app that recreates the issue to Dropbox. Here is the link:
https://www.dropbox.com/scl/fi/yb1b3zh3tzubx0oze6lc4/QLPreviewControllerTest2.zip?rlkey=3m9hiaw06550r5xs4xluoc5gz&st=i3x8obq0&dl=0
The app loads a ViewController with a single button that when pressed creates an object that generates and displays a CSV file via QLPreviewController. When the QLPreviewController is loaded the above flurry of warnings ensue.
Hello. Have you had a chance to look at the code I uploaded? And while I have your attention, the QLPreviewController doesn't seem to honor dark mode. I posted a query about this back in 2020 and never got a response.
https://developer.apple.com/forums/thread/129886