Closed Panajev closed 5 years ago
Here is the same. The issue started right after the update to 10.14.4.
Wonder if it related to this thread too: https://forums.swift.org/t/command-line-applications-crashes-with-xcode-10-2/22192/24
It would seem that SwiftLint is statically linking the Swift Standard Library which is not supported any longer in macOS 10.14.4 (looking at the Makefile):
[...]
SWIFT_BUILD_FLAGS=--configuration release
UNAME=(shell uname) ifeq ((UNAME), Darwin)
SWIFT_BUILD_FLAGS+= -Xswiftc -static-stdlib
endif
[...]
https://forums.swift.org/t/command-line-applications-crashes-with-xcode-10-2/22192/28?u=panajev
As you can read there, I asked if it could happen with the Swift 4 standard library being statically linked in swiftlint (seeing the Swift5 branch I thought we had yet to build the swiftlink package, I got it from homebrew @mdima ), but I got this reply:
No, it can't happen with Swift 4.2. :-/ That error message specifically comes from the Swift 5 standard library detecting an unsafe environment. (Note that this is about the compiler and stdlib version, not about the language version provided to -swift-version.)
Also, the project does not compile with Xcode 10.2, I am trying to remove the "-Xswiftc -static-stdlib" flag... Edit: it does compile this way... and it runs :D.
Could you please post result of otool -L $(which swiftlint)
?
My results with homebrew installation are following:
$ brew uninstall swiftlint
Uninstalling /usr/local/Cellar/swiftlint/0.31.0... (6 files, 16.6MB)
$ brew install swiftlint
==> Downloading https://homebrew.bintray.com/bottles/swiftlint-0.31.0.mojave.bottle.tar.gz
Already downloaded: /Users/norio/Library/Caches/Homebrew/downloads/27d0f98ed0ea3c1592aecbaa7fd410c14b6245b636ca397250e7800ba77d6982--swiftlint-0.31.0.mojave.bottle.tar.gz
==> Pouring swiftlint-0.31.0.mojave.bottle.tar.gz
🍺 /usr/local/Cellar/swiftlint/0.31.0: 6 files, 16.6MB
brew install swiftlint 3.70s user 1.98s system 83% cpu 6.809 total
$ otool -L $(which swiftlint)
/usr/local/bin/swiftlint:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1560.12.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1247.4.1)
/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 62.1.0)
$ swiftlint version
0.31.0
$ sw_vers -productVersion
10.14.4
FYI, workaround for using -Xswiftc -static-stdlib
are already opened: https://github.com/realm/SwiftLint/pull/2682
hello @norio-nomura uninstalling and re-installing swiftlint fixed the issue. This is the result of otool post install:
$ swiftlint version
0.31.0
$ otool -L $(which swiftlint)
/usr/local/bin/swiftlint:
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 1560.12.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1252.200.5)
/usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 400.9.4)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 1560.12.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1247.4.1)
/usr/lib/libicucore.A.dylib (compatibility version 1.0.0, current version 62.1.0)
New Issue Checklist
Describe the bug
Swiftlint crashes after being launched on macos 10.14.4.
Complete output when running SwiftLint, including the stack trace and command used
Environment
swiftlint version
to be sure)? 0.31.0, but I got this from homebrew info as theswiftlint version
command crashes too.xcode-select -p
)? Xcode 10.2 (/Applications/Xcode.app/Contents/Developer)