Skip to content

swift lint installed with brew install swiftlint on Ubuntu 22.04 crashes #6080

Closed

Description

@valeriyvan

New Issue Checklist

Bug Description

brew install swiftlint
==> Auto-updating Homebrew...
Adjust how often this is run with HOMEBREW_AUTO_UPDATE_SECS or disable with
HOMEBREW_NO_AUTO_UPDATE. Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).

You have 11 outdated formulae installed.

==> Downloading https://ghcr.io/v2/homebrew/core/swiftlint/manifests/0.59.1
############################################################################################## 100.0%
==> Fetching swiftlint
==> Downloading https://ghcr.io/v2/homebrew/core/swiftlint/blobs/sha256:64bfd1f18fd38050c83d117ef116c
############################################################################################## 100.0%
==> Pouring swiftlint--0.59.1.x86_64_linux.bottle.tar.gz
==> Caveats
Bash completion has been installed to:
  /home/linuxbrew/.linuxbrew/etc/bash_completion.d
==> Summary
🍺  /home/linuxbrew/.linuxbrew/Cellar/swiftlint/0.59.1: 10 files, 166.4MB
==> Running `brew cleanup swiftlint`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).
swiftlint
SourceKittenFramework/library_wrapper.swift:58: Fatal error: Loading libsourcekitdInProc.so failed
Illegal instruction (core dumped)

Environment

  • Ubuntu 22.04
  • swiftlint was successfully installed with brew install swiftlint

Activity

  1. SimplyDanny commented on Jun 15, 2025

    @SimplyDanny
    Collaborator

    On Linux, SwiftLint is not self-contained and requires libsourcekitdInProc.so as a runtime dependency. It's contained in all Swift toolchains. Citing from the README:

    On Linux, SourceKit is expected to be located in /usr/lib/libsourcekitdInProc.so or specified by the LINUX_SOURCEKIT_LIB_PATH environment variable.

  2. added
    help
    integration
    on Jun 15, 2025
  3. DetachHead commented on Mar 15, 2026

    @DetachHead

    that environment variable doesn't seem to work when using the build tool plugin:

    $ swift build
    error: failed: PrebuildCommand(configuration: SPMBuildCore.BuildToolPluginInvocationResult.CommandConfiguration(displayName: Optional("SwiftLint"), executable: <AbsolutePath:"/mnt/projects/foo/swift-executable/.build/artifacts/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/linux/amd64/swiftlint">, arguments: ["lint", "--quiet", "--force-exclude", "--cache-path", "/mnt/projects/foo/swift-executable/.build/plugins/outputs/swift-executable/swift-executable/destination/SwiftLintBuildToolPlugin/Cache", "/mnt/projects/foo/swift-executable/Sources/swift-executable/swift_executable.swift"], environment: ["BUILD_WORKSPACE_DIRECTORY=/mnt/projects/foo/swift-executable"], workingDirectory: nil), outputFilesDirectory: <AbsolutePath:"/mnt/projects/foo/swift-executable/.build/plugins/outputs/swift-executable/swift-executable/destination/SwiftLintBuildToolPlugin/Output">)
    
    [0/1] Planning buildInProc.so failed
    
    error: failed: PrebuildCommand(configuration: SPMBuildCore.BuildToolPluginInvocationResult.CommandConfiguration(displayName: Optional("SwiftLint"), executable: <AbsolutePath:"/mnt/projects/foo/swift-executable/.build/artifacts/swiftlintplugins/SwiftLintBinary/SwiftLintBinary.artifactbundle/linux/amd64/swiftlint">, arguments: ["lint", "--quiet", "--force-exclude", "--cache-path", "/mnt/projects/foo/swift-executable/.build/plugins/outputs/swift-executable/swift-executable/destination/SwiftLintBuildToolPlugin/Cache", "/mnt/projects/foo/swift-executable/Sources/swift-executable/swift_executable.swift"], environment: ["BUILD_WORKSPACE_DIRECTORY=/mnt/projects/foo/swift-executable"], workingDirectory: nil), outputFilesDirectory: <AbsolutePath:"/mnt/projects/foo/swift-executable/.build/plugins/outputs/swift-executable/swift-executable/destination/SwiftLintBuildToolPlugin/Output">)
    
    SourceKittenFramework/library_wrapper.swift:58: Fatal error: Loading libsourcekitdInProc.so failed
    
    me@pc:/mnt/projects/foo/swift-executable$ ls $LINUX_SOURCEKIT_LIB_PATH
    clang             libclang.so.17.0.0     liblldb.so         libLTO.so               libswiftDemangle.so               swift
    libclang.so       libIndexStore.so       liblldb.so.17.0    libLTO.so.17.0          libSwiftSourceKitClientPlugin.so  swift_static
    libclang.so.17.0  libIndexStore.so.17.0  liblldb.so.17.0.0  libsourcekitdInProc.so  libSwiftSourceKitPlugin.so
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    helpintegration

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions