Closed Jeehut closed 5 years ago
I just found that Mattt already covered the reason why this isn't working in his great post about how to install SwiftPM tools via Homebrew where he also has an example which is dependent on SwiftSyntax:
The install command copies the executable to /usr/local/bin, but because swift-syntax-highlighter links to libSwiftSyntax.dylib, we need to install that to /usr/local/lib and use the install_name_tool command to modify the executable and update its path to the dynamic library. If your project only links to system dynamic libraries (like @rpath/libswiftCore.dylib) then you won’t have to do any of this.
Maybe this helps to fix this more quickly?
Seems like the issue was the directory the build was run from. I updated my Makefile contents to the non-simplified version on NSHipster (this time properly, last time I seem to have had cached data) and it works now.
Okay, it actually only worked in some of my tests during development, but doesn't seem to work for the released version. Opening this again ...
This should not be an issue any more, now that Swift 5 already includes SwiftSyntax.
Currently I'm working on a new version of BartyCrouch and I'd like to release a first beta soon. But before doing that I need to test the tool, including it's installation process. I first tried
swift build -c release
to make sure everything works and it does. It produces a command line tool at the relative path./.build/release/bartycrouch
.But when I try to install the same commit using Mint by running
Then I get no installation errors and on re-run I get
so everything seems to be fine. But when I try to use the command line tool (e.g. by simply running
bartycrouch
) I get this error:Note that I'm including the [SwiftSyntax]() library from Apple exactly like documented in their README with this entry:
It seems this is failing somehow, my first guess was that it has something to do with relative vs. absolute paths and that the directory of the
bartycrouch
executable is the issue. Actually when I replace my local./.build/release/bartycrouch
command with the executable installed by Mint from/usr/local/bin/bartycrouch
it still fails though. When I copy the file built withswift build -c release
locally to the/usr/loca/bin/bartycrouch
path though, it works the other way around. So I'm not sure if that's the issue.Any ideas what might be the issue and how to fix it? I'd like to make Mint the recommended installation option, but it doesn't seem to work right now ...