Open thomaseizinger opened 2 months ago
Same error.
Aug 3
Do you find any way to fix it?
shell.nix
of project
{
pkgs ? import <nixpkgs> { },
}:
with pkgs;
mkShell.override { inherit (swiftPackages) stdenv; } rec {
vscode-settings = writeText "settings.json" (
builtins.toJSON {
"swift.path" = "${swiftPackages.swift-unwrapped}/bin";
"swift.sourcekit-lsp.serverPath" = "${sourcekit-lsp}/bin/sourcekit-lsp";
"lldb.library" = "${swiftPackages.swift-unwrapped}/lib/liblldb.so";
"lldb.launch.expressions" = "native";
}
);
packages = [
swift
swiftpm
swift-corelibs-libdispatch
swiftPackages.Foundation
swiftPackages.Dispatch
];
shellHook = ''
LD_LIBRARY_PATH+=":${swift-corelibs-libdispatch}/lib";
mkdir .vscode &>/dev/null
cp --force ${vscode-settings} .vscode/settings.json
'';
}
SourceKit Language Server logs from sswg.swift-lang VSCode extension (I use Codium)
2024-10-07 12:51:30.019 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.019 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.019 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.020 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.021 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.021 sourcekit-lsp[9338:3e0006c0] Could not determine host OS. Falling back to using '.so' as dynamic library extension
2024-10-07 12:51:30.193 sourcekit-lsp[9338:3e0006c0] [error]: Invalid manifest (compiled with: ["/nix/store/rh4jimyaclrhh04j0656a8gkxqsgk2k1-swift-5.8/bin/swiftc", "-vfsoverlay", "/tmp/TemporaryDirectory.SLww15/vfs.yaml", "-L", "/nix/store/rh4jimyaclrhh04j0656a8gkxqsgk2k1-swift-5.8/lib/swift/pm/ManifestAPI", "-lPackageDescription", "-Xlinker", "-rpath", "-Xlinker", "/nix/store/rh4jimyaclrhh04j0656a8gkxqsgk2k1-swift-5.8/lib/swift/pm/ManifestAPI", "-swift-version", "5", "-I", "/nix/store/rh4jimyaclrhh04j0656a8gkxqsgk2k1-swift-5.8/lib/swift/pm/ManifestAPI", "-package-description-version", "5.8.0", "/home/nadevko/example/Package.swift", "-o", "/tmp/TemporaryDirectory.uYSWUf/example-manifest"])
<unknown>:0: warning: glibc not found for 'x86_64-pc-linux-gnu'; C stdlib may be unavailable
<unknown>:0: error: could not find module '_Concurrency' for target 'x86_64-pc-linux-gnu'; found: x86_64-unknown-linux-gnu, at: /nix/store/szbmx8gzg6fi977jbr5v3lg12b4j2x4v-swift-5.8-lib/lib/swift/linux/_Concurrency.swiftmodule
2024-10-07 12:51:30.194 sourcekit-lsp[9338:3e0006c0] failed to create SwiftPMWorkspace at /home/nadevko/example: the package does not contain a buildable target
2024-10-07 12:51:49.904 sourcekit-lsp[9338:360006c0] failed to start language service open("/nix/store/rh4jimyaclrhh04j0656a8gkxqsgk2k1-swift-5.8/lib/libsourcekitdInProc.so: undefined symbol: _Z13OStream_write14BridgedOStreamN4llvm9StringRefE")
[Info - 12:59:32 PM] Connection to server got closed. Server will restart.
true
[Error - 12:59:32 PM] Server process exited with signal SIGILL.
Describe the bug
sourcekit-lsp
crashes when opening.swift
files with:Steps To Reproduce
.swift
file in an editorExpected behavior
Auto-complete and code analysis from the language server.
Additional context
A related bug is open on the Swift repository: https://github.com/swiftlang/swift/issues/67975
It hints that there might be a problem in how
sourcekit-lsp
gets built so I am opening this here. The suggestion there is thatsourcekit-lsp
should statically link against the above symbol.The original issue I opened was: https://github.com/swiftlang/vscode-swift/issues/988. There the
vscode-swift
people are wondering whysourcekit-lsp
is in a different package to begin with.Notify maintainers
@dtzWill @trepetti @dduan @trundle @stephank
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.Add a :+1: reaction to issues you find important.