You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am unable to build a fully static / standalone executable of SwiftLint for Linux. SwiftLint works fine on Linux for me as long as Swift is installed, but I need a version that works on Linux even if Swift is not installed.
There are previously opened issues that pertain to standalone versions of SwiftLint (#302 and #731), but they are quite old at this point. This comment mentions that the blocker to supporting this was having SourceKit included in Linux versions of Swift - which is now resolved according to this ticket: swiftlang/swift#8189.
Yet I still get an error every time I try to build a statically executable binary. The below output shows me using swift build on a Linux machine with the standard build flags --configuration release -Xlinker -dead_strip, adding -Xswiftc -static-executable to ensure it's a static binary. The error shows up at the bottom. I'm using the latest versions of Swift and SwiftLint - see environment details at the bottom.
Is some additional step needed to get this to work or is it simply not possible as things currently are? Thanks in advance.
~/SwiftLint$ swift build --configuration release -Xlinker -dead_strip -Xswiftc -static-executable
Fetching https://github.com/jpsim/Yams.git
Fetching https://github.com/apple/swift-syntax.git
Fetching https://github.com/jpsim/SourceKitten.git
[28924/28924] Fetching objects
Fetched https://github.com/apple/swift-syntax.git (0.90s)
Fetching https://github.com/apple/swift-argument-parser.git
Fetched https://github.com/jpsim/SourceKitten.git (0.91s)
Fetching https://github.com/scottrhoyt/SwiftyTextTable.git
Fetched https://github.com/jpsim/Yams.git (0.92s)
Fetching https://github.com/drmohundro/SWXMLHash.git
[2903/3567] Fetching objectsFetched https://github.com/scottrhoyt/SwiftyTextTable.git (0.18s)
[2957/3567] Fetching objectsFetching https://github.com/krzyzanowskim/CryptoSwift.git
[3567/3567] Fetching objects
Fetched https://github.com/drmohundro/SWXMLHash.git (0.25s)
[11878/19984] Fetching objectsFetched https://github.com/apple/swift-argument-parser.git (0.60s)
[19984/19984] Fetching objects
Fetched https://github.com/krzyzanowskim/CryptoSwift.git (0.96s)
Computing version for https://github.com/krzyzanowskim/CryptoSwift.git
Computed https://github.com/krzyzanowskim/CryptoSwift.git at 1.4.3 (0.17s)
Computing version for https://github.com/scottrhoyt/SwiftyTextTable.git
Computed https://github.com/scottrhoyt/SwiftyTextTable.git at 0.9.0 (0.57s)
Computing version for https://github.com/jpsim/Yams.git
Computed https://github.com/jpsim/Yams.git at 4.0.6 (0.16s)
Computing version for https://github.com/jpsim/SourceKitten.git
Computed https://github.com/jpsim/SourceKitten.git at 0.32.0 (0.17s)
Computing version for https://github.com/apple/swift-syntax.git
Computed https://github.com/apple/swift-syntax.git at 0.50600.1 (0.36s)
Computing version for https://github.com/apple/swift-argument-parser.git
Computed https://github.com/apple/swift-argument-parser.git at 1.0.3 (0.17s)
Computing version for https://github.com/drmohundro/SWXMLHash.git
Computed https://github.com/drmohundro/SWXMLHash.git at 6.0.0 (0.16s)
Creating working copy for https://github.com/scottrhoyt/SwiftyTextTable.git
Working copy of https://github.com/scottrhoyt/SwiftyTextTable.git resolved at 0.9.0
Creating working copy for https://github.com/drmohundro/SWXMLHash.git
Working copy of https://github.com/drmohundro/SWXMLHash.git resolved at 6.0.0
Creating working copy for https://github.com/apple/swift-syntax.git
Working copy of https://github.com/apple/swift-syntax.git resolved at 0.50600.1
Creating working copy for https://github.com/jpsim/Yams.git
Working copy of https://github.com/jpsim/Yams.git resolved at 4.0.6
Creating working copy for https://github.com/jpsim/SourceKitten.git
Working copy of https://github.com/jpsim/SourceKitten.git resolved at 0.32.0
Creating working copy for https://github.com/krzyzanowskim/CryptoSwift.git
Working copy of https://github.com/krzyzanowskim/CryptoSwift.git resolved at 1.4.3
Creating working copy for https://github.com/apple/swift-argument-parser.git
Working copy of https://github.com/apple/swift-argument-parser.git resolved at 1.0.3
Building for production...
/home/ubuntu/SwiftLint/.build/checkouts/swift-syntax/Sources/SwiftSyntaxParser/CNodes.swift:13:29: error: no such module '_InternalSwiftSyntaxParser'
@_implementationOnly import _InternalSwiftSyntaxParser
^
[27/29] Archiving libSwiftSyntax.a
Environment
SwiftLint version - Current (0.47.1)
Installation method used - build from source
Swift version - Current (5.6.1)
Ubuntu version - 20.04
Architecture - x86
The text was updated successfully, but these errors were encountered:
New Issue Checklist
Describe the bug
I am unable to build a fully static / standalone executable of SwiftLint for Linux. SwiftLint works fine on Linux for me as long as Swift is installed, but I need a version that works on Linux even if Swift is not installed.
There are previously opened issues that pertain to standalone versions of SwiftLint (#302 and #731), but they are quite old at this point. This comment mentions that the blocker to supporting this was having SourceKit included in Linux versions of Swift - which is now resolved according to this ticket: swiftlang/swift#8189.
Yet I still get an error every time I try to build a statically executable binary. The below output shows me using
swift build
on a Linux machine with the standard build flags--configuration release -Xlinker -dead_strip
, adding-Xswiftc -static-executable
to ensure it's a static binary. The error shows up at the bottom. I'm using the latest versions of Swift and SwiftLint - see environment details at the bottom.Is some additional step needed to get this to work or is it simply not possible as things currently are? Thanks in advance.
Environment
The text was updated successfully, but these errors were encountered: