I am trying to use the Swift Package Manager to build a macOS command line tool to play with the SwiftSyntax library. But currently I am running into a runtime error "dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib". I am using Xcode 11.2.1 and pointing SPM at the master branch of SwiftSyntax and tag "0.50100.0" as per the readme.
I see from this thread and others that the dyld error appears to be a known problem. One suggestion is to "put a symlink to lib_InternalSwiftSyntaxParser.dylib
in the same directory as the executable" but I am not sure where to find lib_InternalSwiftSyntaxParser.dylib
, is that part of the main Swift branch?
Some other comments in this thread indicate that the dyld issue has been fixed in the swift-5.1-branch
branch but that branch is now a couple of months old and has not been merged into master
. If I point SPM at swift-5.1-branch
there are build errors which seem to stem from the fact that the .gyp
files have not been processed. Is there a way to add this step as part of my build process?
I apologize in advance if I have missed something obvious and thanks for the help.
1 Like