Description
Error: Path to shell executable "/usr/lib/usr/bin/swift" does not exist.
which also prevents my vscode terminal from working.
I saw #218
My binaries are at /usr/lib/swift/bin
which I added to $PATH
and started code
via :
env PATH=/usr/lib/swift/bin:$PATH code ./
but I continue to get the error The terminal process failed to launch: Path to shell executable "/usr/lib/usr/bin/swift" does not exist.
as well as SourceKit error Launching server using command /usr/lib/usr/bin/sourcekit-lsp failed. Error: spawn /usr/lib/usr/bin/sourcekit-lsp ENOENT
If I manually set Swift: Path extension setting to /usr/lib/swift/bin
I get the same error.
When swift was installed, it linked /usr/lib/swift/bin/swift
to /bin/swift
. I deleted the link while trying to resolve this issue.
λ ls -hal /usr/lib/swift/bin
Permissions Size User Date Modified Name
drwxr-xr-x - root 28 Jul 08:37 .
drwxr-xr-x - root 28 Jul 08:37 ..
drwxr-xr-x - root 28 Jul 08:37 sdk-module-lists
lrwxrwxrwx 8 root 28 Jul 08:36 clang -> clang-13
lrwxrwxrwx 5 root 28 Jul 08:36 clang++ -> clang
.rwxr-xr-x 121M root 28 Jul 08:36 clang-13
lrwxrwxrwx 5 root 28 Jul 08:36 clang-cache -> clang
lrwxrwxrwx 5 root 28 Jul 08:36 clang-cl -> clang
lrwxrwxrwx 5 root 28 Jul 08:36 clang-cpp -> clang
.rwxr-xr-x 49M root 28 Jul 08:36 clangd
.rwxr-xr-x 50M root 28 Jul 08:36 docc
lrwxrwxrwx 3 root 28 Jul 08:36 ld.lld -> lld
lrwxrwxrwx 3 root 28 Jul 08:36 ld64.lld -> lld
.rwxr-xr-x 74M root 28 Jul 08:36 lld
lrwxrwxrwx 3 root 28 Jul 08:36 lld-link -> lld
.rwxr-xr-x 255k root 28 Jul 08:36 lldb
.rwxr-xr-x 88k root 28 Jul 08:36 lldb-argdumper
.rwxr-xr-x 99M root 28 Jul 08:36 lldb-server
.rwxr-xr-x 14M root 28 Jul 08:36 llvm-ar
.rwxr-xr-x 5.2M root 28 Jul 08:36 llvm-cov
.rwxr-xr-x 5.8M root 28 Jul 08:36 llvm-profdata
.rwxr-xr-x 8.6M root 28 Jul 08:36 plutil
.rwxr-xr-x 8.1k root 28 Jul 08:36 repl_swift
.rwxr-xr-x 127M root 28 Jul 08:36 sourcekit-lsp
lrwxrwxrwx 14 root 28 Jul 08:36 swift -> swift-frontend
.rwxr-xr-x 12k root 28 Jul 08:36 swift-api-checker.py
lrwxrwxrwx 14 root 28 Jul 08:36 swift-api-digester -> swift-frontend
lrwxrwxrwx 14 root 28 Jul 08:36 swift-api-extract -> swift-frontend
lrwxrwxrwx 14 root 28 Jul 08:36 swift-autolink-extract -> swift-frontend
lrwxrwxrwx 13 root 28 Jul 08:36 swift-build -> swift-package
.rwxr-xr-x 36M root 28 Jul 08:36 swift-build-sdk-interfaces
.rwxr-xr-x 1.4M root 28 Jul 08:36 swift-build-tool
.rwxr-xr-x 1.6M root 28 Jul 08:36 swift-demangle
.rwxr-xr-x 36M root 28 Jul 08:36 swift-driver
lrwxrwxrwx 13 root 28 Jul 08:36 swift-experimental-destination -> swift-package
.rwxr-xr-x 147M root 28 Jul 08:36 swift-frontend
.rwxr-xr-x 11M root 28 Jul 08:36 swift-help
.rwxr-xr-x 93M root 28 Jul 08:36 swift-package
lrwxrwxrwx 13 root 28 Jul 08:36 swift-package-collection -> swift-package
lrwxrwxrwx 13 root 28 Jul 08:36 swift-package-registry -> swift-package
lrwxrwxrwx 13 root 28 Jul 08:36 swift-run -> swift-package
lrwxrwxrwx 14 root 28 Jul 08:36 swift-symbolgraph-extract -> swift-frontend
lrwxrwxrwx 13 root 28 Jul 08:36 swift-test -> swift-package
lrwxrwxrwx 14 root 28 Jul 08:36 swiftc -> swift-frontend
lrwxrwxrwx 3 root 28 Jul 08:36 wasm-ld -> lld
Environment
- OS: Garuda Linux (Arch)
- Swift version: 5.8.1
- Visual Studio Code version: 1.8.1.1
- vscode-swift version: v1.5.1
Additional context
The package: http://aur.archlinux.org/packages/swift-bin
executing sudo ln -s /usr/lib/swift/bin /usr/lib/usr/bin
temporarily fixed the issue, though this is obviously not great.