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
$ 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)
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
---
excluded:
- Carthage
- docs
- MasKitTests
xcode-select -p)? 10.1/Applications/Xcode.app -> /Applications/Xcode-10.1.appI 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.
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.appresolves this issue on 10.14.0-.3, but I haven't verified this.
Another workarounds for homebrew distribution other than installing Xcode 10.2:
brew install swiftlint --build-from-source with Xcode 10 or 10.1Ah, 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?
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.
Thanks for the explanation. The compiler version is what's important.
Can we close this?
I'm adding something to the readme about this, then will close.
Most helpful comment
I'm adding something to the readme about this, then will close.