swiftly icon indicating copy to clipboard operation
swiftly copied to clipboard

`swift repl` fails under swiftly

Open heckj opened this issue 7 months ago • 1 comments

I have swiftly (1.0.1) installed, and tried to invoke swift repl. It immediately fails with a dyld error trying to locate the LLDB framework:

dyld[11468]: Library not loaded: @rpath/Python3.framework/Versions/3.9/Python3
  Referenced from: <9E37CB76-6346-3B15-9356-DEA26D289DD8> /Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/LLDB

The extended error shows all the various places it hoped and tried to find it:

  Reason: tried: '/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/usr/lib/swift/Python3.framework/Versions/3.9/Python3' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../../../../../../Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../../../Developer/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../../Developer/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../../Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../Python3.framework/Versions/3.9/Python3' (no such file), '/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/System/Library/PrivateFrameworks/LLDB.framework/Versions/A/../../../../../../usr/lib/swift/host/compiler/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../../SharedFrameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../System/Library/PrivateFrameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../Library/PrivateFrameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../../SharedFrameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../System/Library/PrivateFrameworks/Python3.framework/Versions/3.9/Python3' (no such file), '/Users/joeheck/Library/Developer/Toolchains/swift-6.1-RELEASE.xctoolchain/usr/bin/../../Library/PrivateFrameworks/Python3.framework/Versions/3.9/Python3' (no such file)

I don't have /Application/Xcode.app at all - having renamed my Xcodes by version to have multiple of them more easily.

If I disable swiftly, the built-in toolchain correctly finds and links the libraries and swift repl launches as expected.

heckj avatar May 19 '25 01:05 heckj

A simple (but not ideal) workaround is to simply create a symlink in /Applications to the Xcode.app you have installed:

cd /Applications
ln -s MyFavoriteXcode.app ./Xcode.app

I was experiencing the same Python3.framework dynamic linking error you were, and this fixed it for me. Obviously, if you're swapping Xcode versions a lot, this will be kind of a pain to have to update this symlink.

pcbeard avatar Jun 13 '25 15:06 pcbeard