Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Still getting "Library not loaded: '@rpath/lib_InternalSwiftSyntaxParser.dylib'" error after upgrading tool to 0.50700.1 #884

Closed
Jeehut opened this issue Oct 6, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Jeehut
Copy link
Contributor

Jeehut commented Oct 6, 2022

Description

I upgraded BartyCrouch to the latest swift-syntax release but it's still failing with dyld[15423]: Library not loaded: '@rpath/lib_InternalSwiftSyntaxParser.dylib' – how do we need to link it?

I followed all instructions in the release, but it doesn't work ... help would be appreciated! @ahoppen
Either something is wrong with the release, or instructions of how to depend on SwiftSyntax properly should be updated.

Steps to Reproduce

As you can see on my Homebrew PR's CI fail here, running my tool which includes the latest release, e.g. via bartycrouch update results in this error. You should be able to simply build my BartyCrouch app locally via make install, then run /path/to/bartycrouch update inside a folder with a .swift and a .strings file to reproduce (see also the test function).

@Jeehut Jeehut added the bug Something isn't working label Oct 6, 2022
@ahoppen
Copy link
Member

ahoppen commented Oct 6, 2022

rdar://100842452

@ahoppen
Copy link
Member

ahoppen commented Oct 7, 2022

The problem is that bartycrouch links against lib_InternalSwiftSyntaxParser.dylib dynamically but you aren’t vendoring that library as part of barycrouch. If you copy lib_InternalSwiftSyntaxParser.dylib next to bartycrouch, the issue disappears. If you don’t want to put the library into a different directory (e.g. lib instead of bin), you could try adding an rpath to the binary that points to the directory that contains lib_InternalSwiftSyntaxParser.dylib.

You might also find https://github.com/keith/StaticInternalSwiftSyntaxParser/ interesting, which contains a static version of that parser library, maintained by @keith.

@ahoppen
Copy link
Member

ahoppen commented Oct 7, 2022

If this continues to be an issue for you, feel free to re-open the issue.

@ahoppen ahoppen closed this as completed Oct 7, 2022
@Jeehut
Copy link
Contributor Author

Jeehut commented Oct 7, 2022

@ahoppen Thank you very much for your help. I am now trying to use the static parser provided by @keith and already made a new release with the appropriate changes. Hope it goes through this time. If not, I might have more questions. I'm not particularly fond of linking topics, so what you said before that, I didn't quite know what to do.

But here's the PR, let's see if things work already: Homebrew/homebrew-core#112557

@Jeehut
Copy link
Contributor Author

Jeehut commented Oct 8, 2022

Update: It worked, the Homebrew PR went through without problems this time. Thank you again @ahoppen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants