Closed ryandesign closed 4 years ago
The auto update feature is handled by Sparkle. It could be a bug with it.
Well the same happens if I download the zip from the GitHub releases tab.
I updated all the packages to the new versions in the new release that just came out. I have never seen an error like this but I'm guessing its because you have an older version of xcode installed and its trying to reference the swift library but since yours is older it is breaking somewhere.
Can you try this version? It includes the standard swift libraries in the app.
Hmm, it still says:
$ ~/Downloads/gSwitch.app/Contents/MacOS/gSwitch
dyld: Symbol not found: __T0SbMa
Referenced from: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftDarwin.dylib
Expected in: /Users/rschmidt/Downloads/gSwitch.app/Contents/MacOS/../Frameworks/libswiftCore.dylib
in /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftDarwin.dylib
Abort trap: 6
I would recommend updating your xcode and macos to more recent versions.
I'm not going to do that at this time, and I don't think that's a satisfactory resolution to this issue.
You're welcome to fork the project yourself. If you make a PR and it tests fine then I will merge.
I believe this Apple developer forum thread describes the problem and the solution:
It’s very likely that you have rpath problems
It looks like the problem is in the copy of SwiftyBeaver.framework in gSwitch.app 1.9.6:
$ otool -l gSwitch.app/Contents/Frameworks/SwiftyBeaver.framework/Versions/A/SwiftyBeaver | grep -B 1 -A 2 LC_RPATH
Load command 18
cmd LC_RPATH
cmdsize 32
path /usr/lib/swift (offset 12)
--
--
Load command 19
cmd LC_RPATH
cmdsize 112
path /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx (offset 12)
If I fix that rpath with:
install_name_tool -rpath /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx @executable_path/../Frameworks gSwitch.app/Contents/Frameworks/SwiftyBeaver.framework/Versions/A/SwiftyBeaver
then it launches and works correctly, but it shouldn't need to be fixed manually; there should be a way to build it correctly in the first place following the instructions in that thread.
For comparison, the copy of SwiftyBeaver.framework in gSwitch.app 1.9.5 had these rpaths:
$ otool -l /Applications/gSwitch.app/Contents/Frameworks/SwiftyBeaver.framework/Versions/A/SwiftyBeaver | grep -B 1 -A 2 LC_RPATH
Load command 22
cmd LC_RPATH
cmdsize 32
path /usr/lib/swift (offset 12)
--
--
Load command 23
cmd LC_RPATH
cmdsize 40
path @executable_path/Frameworks (offset 12)
--
--
Load command 24
cmd LC_RPATH
cmdsize 40
path @loader_path/Frameworks (offset 12)
@ryandesign That makes sense. I updated swiftbeaver from 1.7 to 1.9 in the latest release.
I rebuilt the swiftybeaver framework with that line removed.
Can you test this version? gSwitch.zip
That version does seem to work for me, thanks!
Nice! So you were right, that 1 line was the issue. Hopefully swiftybeaver can update their framework. I'll include this fix in the next version of gswitch.
gSwitch just updated itself from 1.9.5 to 1.9.6 and now it doesn't launch anymore. If I launch it from the Terminal we see what the problem is:
I am running macOS High Sierra 10.13.6 with Xcode 9.4.1.
It seems like gSwitch should be self-contained and should not be referencing anything inside the Xcode app bundle.