Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib after homebrew install #197

Closed
MattKiazyk opened this issue Oct 2, 2020 · 7 comments
Labels
bug Something isn't working

Comments

@MattKiazyk
Copy link
Contributor

While related to #60 I'm just simply trying to run generate on the command line after install, so I thought I'd create a new ticket.

Steps:

  • Xcode 12.0.1 or 12.0
  • Installed beta-5 via homebrew brew install swiftdocorg/formulae/swift-doc
  • ran swift doc generate -f html ... via command line

received:

dyld: Library not loaded: @rpath/lib_InternalSwiftSyntaxParser.dylib
  Referenced from: /usr/local/bin/swift-doc
  Reason: image not found

I did not receive this on beta-4 or earlier, granted I had been building it locally when I was making changes, so perhaps that stopped it from happening.

The workaround is to make sure I have my Xcode 12 named Xcode.app. and not Xcode-12.0.1. Once that occurs, and I set my command tools to that - it does not receive that error (albeit getting the #196 issue)

@MaxDesiatov
Copy link
Contributor

+1 here, also fails for me swift-doc --version

@MaxDesiatov MaxDesiatov added the bug Something isn't working label Oct 4, 2020
@MaxDesiatov
Copy link
Contributor

My Xcode path is /Applications/Xcode-12.0.0-gm-seed.app.

@MaxDesiatov
Copy link
Contributor

The underlying issue is SR-9038 I guess. Ideally, we want to link all Swift Syntax components statically so that we don't have a dependency on a specific Xcode version.

@MaxDesiatov
Copy link
Contributor

I was pointed to this guide in README.md of Swift Syntax. We may also need to use install_name_tool to update @rpath.

@mattt
Copy link
Contributor

mattt commented Oct 7, 2020

This should be fixed by SwiftDocOrg/homebrew-formulae@af4cd47.

@MattKiazyk Could you please try reinstalling to verify this?

$ brew uninstall swift-doc
$ brew untap swiftdocorg/formulae # in case you tapped our formula repo
$ brew install swiftdocorg/formulae/swift-doc

@MattKiazyk
Copy link
Contributor Author

I tried yesterday and it didn't work. Today It did work.

Although got an error when running brew install swiftdocorg/formulae/swift-doc

Error: No available formula or cask with the name "swiftdocorg/formulae/swift-doc".

but running again found it and installed it correctly. Thanks @mattt

@mattt
Copy link
Contributor

mattt commented Oct 7, 2020

@MattKiazyk So glad to hear it! For posterity, here are updated commands to run for anyone else who may be getting that error message:

$ brew uninstall swift-doc
$ brew untap swiftdocorg/formulae # in case you tapped our formula repo
$ brew tap swiftdocorg/formulae
$ brew install swift-doc

You may have also noticed that installation is now much faster thanks to the formula now having a bottle (e.g. pre-built binary).

Again, apologies for any inconvenience I may have caused by botching the distribution of this release. I've learned a lot more about Homebrew, and have taken this as an opportunity to improve the process going forward. Hoping to write up what I've learned in a blog post soon.

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

No branches or pull requests

4 participants