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

dyld: Symbol not found error on 10.14.3 from bottled 0.32.0 #2736

Closed
2 tasks done
phatblat opened this issue Apr 30, 2019 · 8 comments
Closed
2 tasks done

dyld: Symbol not found error on 10.14.3 from bottled 0.32.0 #2736

phatblat opened this issue Apr 30, 2019 · 8 comments

Comments

@phatblat
Copy link

phatblat commented Apr 30, 2019

New Issue Checklist

Describe the bug

Simply running swiftlint 0.32.0 on macOS 10.14.3 when installed via the Homebrew bottle.

$ brew install swiftlint
==> Downloading https://homebrew.bintray.com/bottles/swiftlint-0.32.0.mojave.bottle.tar.gz
Already downloaded: /Users/chatelain/Library/Caches/Homebrew/downloads/4f9559ebeb4944bcaee86154b8822d5522813e7de93da3f2e947292b934176c6--swiftlint-0.32.0.mojave.bottle.tar.gz
==> Pouring swiftlint-0.32.0.mojave.bottle.tar.gz
🍺  /usr/local/Cellar/swiftlint/0.32.0: 6 files, 7.5MB
Complete output when running SwiftLint, including the stack trace and command used
$ swiftlint
dyld: Symbol not found: _$s11SubSequenceSlTl
  Referenced from: /usr/local/bin/swiftlint
  Expected in: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/macosx/libswiftCore.dylib
 in /usr/local/bin/swiftlint
fish: 'swiftlint' terminated by signal SIGABRT (Abort)

Workaround

This appears to be an issue with the Homebrew bottle for Mojave. Building from source using Xcode 10.1 is sufficient to resolve the issue.

$ brew install swiftlint --build-from-source
...

Warning: Your Xcode (10.1) is outdated.
Please update to Xcode 10.2.1 (or delete it).
...
==> Checking out tag 0.32.0
HEAD is now at 6534946 release 0.32.0
...
==> make prefix_install PREFIX=/usr/local/Cellar/swiftlint/0.32.0 TEMPORARY_FOLDER=/private/tmp/swiftlint-20190429-85939-1ycfurt/SwiftLint.dst
🍺  /usr/local/Cellar/swiftlint/0.32.0: 6 files, 16.9MB, built in 3 minutes 46 seconds

$ swiftlint version
0.32.0

Environment

---
excluded:
- Carthage
- docs
- MasKitTests
  • Are you using nested configurations? no
    If so, paste their relative paths and respective contents.
  • Which Xcode version are you using (check xcode-select -p)? 10.1
    • Note: Xcode is symlinked to /Applications/Xcode.app -> /Applications/Xcode-10.1.app
    • Xcode 10.2 is not installed on this box.
  • macOS version: 10.14.3 (18D109)
  • Do you have a sample that shows the issue? n/a

Related

I noticed that Carthage 0.33.0 ran into this same issue last month. It sounds like having 10.2 installed at /Applications/Xcode.app resolves this issue on 10.14.0-.3, but I haven't verified this.

I'm interested in the solution to this as packaging macOS CLI commands is now more complicated with Swift 5 and I'm waiting to update mas until we figure out how to deal with this issue.

@phatblat phatblat changed the title dyld: Symbol not found error on 10.14.3 from bottled 0.23.0 dyld: Symbol not found error on 10.14.3 from bottled 0.32.0 Apr 30, 2019
@norio-nomura
Copy link
Collaborator

norio-nomura commented Apr 30, 2019

This issue is expected to homebrew distribution on macOS Mojave 10.14.0-.3 with Xcode 10.1 or earlier.

It sounds like having 10.2 installed at /Applications/Xcode.app resolves this issue on 10.14.0-.3, but I haven't verified this.

Another workarounds for homebrew distribution other than installing Xcode 10.2:

@phatblat
Copy link
Author

phatblat commented Apr 30, 2019

Ah, so this is a case where the box doesn't have the Swift 5 runtime and the bottle was built without the runtime embedded (on 10.14.4). I wish there was a way to require (at least with better messaging) the Swift 5 Runtime Support for Command Line Tools (public link).

One thing I'm confused about, I thought this behavior was only when an app is built with Swift 5, but SwiftLint is configured to build using Swift 4.2. So, it appears that even Swift 4 CLI executables built with Xcode 10.2 require the Swift 5 runtime to be installed?

@norio-nomura
Copy link
Collaborator

SwiftLint's Homebrew bottle for macOS Mojave is created using Swift 5 compiler with -swift-version 4 flags that specified in Package.swift.
The Swift compiler in Xcode 10.2 is only version 5 and the -swift-version flag specifies the language version, not the compiler version. Swift 5 compiler links executables to the same Swift Runtime Libraries, regardless of whether -swift-version is4, 4.2, or 5.

@phatblat
Copy link
Author

Thanks for the explanation. The compiler version is what's important.

@marcelofabri
Copy link
Collaborator

Can we close this?

@jpsim
Copy link
Collaborator

jpsim commented Apr 30, 2019

I'm adding something to the readme about this, then will close.

@jpsim
Copy link
Collaborator

jpsim commented Apr 30, 2019

#2738

@jpsim jpsim closed this as completed Apr 30, 2019
norio-nomura added a commit to norio-nomura/homebrew-core that referenced this issue May 1, 2019
Workaround to realm/SwiftLint#2736

Following message will be printed on macOS Mojave 10.14.0-.3 without Swift 5 Runtime Support.
```terminal.sh-session
$ brew install swiftlint
Warning: Building swiftlint from source:
  The bottle needs the [Swift 5 Runtime Support for Command Line Tools](https://support.apple.com/kb/DL1998) to be installed on macOS Mojave 10.14.3 or earlier.
  Alternatively, you can:
  * Update to macOS 10.14.4 or later
  * Install Xcode 10.2 or later at `/Applications/Xcode.app`

```
@norio-nomura
Copy link
Collaborator

opened: Homebrew/homebrew-core#39446

norio-nomura added a commit to norio-nomura/homebrew-core that referenced this issue May 1, 2019
Workaround to realm/SwiftLint#2736 same with Homebrew#39446

Following message will be printed on macOS Mojave 10.14.0-.3 without Swift 5 Runtime Support.
```terminal.sh-session
$ brew install sourcekitten
Warning: Building sourcekitten from source:
  The bottle needs the [Swift 5 Runtime Support for Command Line Tools](https://support.apple.com/kb/DL1998) to be installed on macOS Mojave 10.14.3 or earlier.
  Alternatively, you can:
  * Update to macOS 10.14.4 or later
  * Install Xcode 10.2 or later at `/Applications/Xcode.app`

```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants