haskell / haskell-language-server

Official haskell ide support via language server (LSP). Successor of ghcide & haskell-ide-engine.
Apache License 2.0
2.71k stars 368 forks source link

cabal: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory) #502

Closed Vic-M closed 4 years ago

Vic-M commented 4 years ago

Subject of the issue

2020-10-13 22:48:29.666412716 [ThreadId 7] - <--2--{"jsonrpc":"2.0","params":{"uri":"file:///home/basic/haskell/test.hs","diagnostics":[{"severity":1,"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"source":"compiler","message":"cabal: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)"}]},"method":"textDocument/publishDiagnostics"}

image

Your environment

haskell.cabal:

cabal-version:       >=1.10
-- Initial package description 'haskell.cabal' generated by 'cabal init'.
-- For further documentation, see http://haskell.org/cabal/users-guide/

name:                haskell
version:             0.1.0.0
-- synopsis:
-- description:
-- bug-reports:
-- license:
license-file:        LICENSE
author:              xxxxxx
-- maintainer:
-- copyright:
-- category:
build-type:          Simple
extra-source-files:  CHANGELOG.md

executable haskell
  main-is:             test.hs
  -- other-modules:
  -- other-extensions:
  build-depends:       base >=4.14 && <4.15
  -- hs-source-dirs:
  default-language:    Haskell2010

hie.yaml:

cradle:
  cabal:
    - path: "./"
      component: "haskell:exe:haskell"

test.hs:


someFunc x = x + 1

main :: IO ()
main = do
    let x = someFunc 3

    print x

Steps to reproduce

Open test.hs in VSCode

Expected behaviour

HLS should start working.

Actual behaviour

The error message appears and the extension never starts working

image

Include debug information

Execute in the root of your project the command haskell-language-server --debug . and paste the logs here:

Debug output: ``` haskell-language-server version: 0.5.1.0 (GHC: 8.10.2) (PATH: /home/basic/.ghcup/bin/haskell-language-server-8.10.2~0.5.1) (GIT hash: e3fe0e7546aa91e44cc56cfe8ec078a026cf533a) (haskell-language-server)Ghcide setup tester in /home/basic/haskell. Report bugs at https://github.com/haskell/haskell-language-server/issues Tool versions found on the $PATH cabal: 3.2.0.0 stack: Not found ghc: 8.10.2 Step 1/4: Finding files to test in /home/basic/haskell Found 1 files Step 2/4: Looking for hie.yaml files that control setup Found 1 cradle Step 3/4: Initializing the IDE Step 4/4: Type checking the files [INFO] Consulting the cradle for "test.hs" Output from setting up the cradle Cradle {cradleRootDir = "/home/basic/haskell", cradleOptsProg = CradleAction: Cabal} > Resolving dependencies... > Build profile: -w ghc-8.10.2 -O1 > In order, the following will be built (use -v for more details): > - haskell-0.1.0.0 (exe:haskell) (first run) > Configuring executable 'haskell' for haskell-0.1.0.0.. > Warning: The 'license-file' field refers to the file 'LICENSE' which does not > exist. > Preprocessing executable 'haskell' for haskell-0.1.0.0.. [INFO] Using interface files cache dir: /home/basic/.cache/ghcide/main-904ea37875e6e2c26cf6313777f77feeb2779ebb [INFO] Making new HscEnv[main] [INFO] finish: User TypeCheck (took 0.04s) Completed (1 file worked, 0 files failed) ```

Paste the logs from the lsp-client, e.g. for VS Code

LSP logs: ``` [client] run command: "/home/basic/.ghcup/bin/haskell-language-server-8.10.2 --lsp -d" [client] debug command: "/home/basic/.ghcup/bin/haskell-language-server-8.10.2 --lsp -d" [client] server cwd: undefined haskell-language-server version: 0.5.1.0 (GHC: 8.10.2) (PATH: /home/basic/.ghcup/bin/haskell-language-server-8.10.2~0.5.1) (GIT hash: e3fe0e7546aa91e44cc56cfe8ec078a026cf533a) Starting (haskell-language-server)LSP server... with arguments: LspArguments {argLSP = True, argsCwd = Nothing, argFiles = [], argsShakeProfiling = Nothing, argsTesting = False, argsExamplePlugin = False, argsDebugOn = True, argsLogFile = Nothing, argsThreads = 0, argsProjectGhcVersion = False} with plugins: [PluginId "brittany",PluginId "eval",PluginId "floskell",PluginId "fourmolu",PluginId "ghcide",PluginId "importLens",PluginId "ormolu",PluginId "pragmas",PluginId "retrie",PluginId "stylish-haskell",PluginId "tactic"] in directory: /home/basic/haskell If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option! 2020-10-13 23:41:33.306948568 [ThreadId 5] - haskell-lsp:Starting up server ... 2020-10-13 23:41:33.307864234 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":135144,"clientInfo":{"name":"vscode","version":"1.50.0"},"rootPath":"/home/basic/haskell","rootUri":"file:///home/basic/haskell","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"versionSupport":false,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true},"semanticTokens":{"dynamicRegistration":true,"tokenTypes":["comment","keyword","number","regexp","operator","namespace","type","struct","class","interface","enum","typeParameter","function","member","macro","variable","parameter","property","label"],"tokenModifiers":["declaration","documentation","static","abstract","deprecated","async","readonly"]}},"window":{"workDoneProgress":true}},"trace":"off","workspaceFolders":[{"uri":"file:///home/basic/haskell","name":"haskell"}]}} 2020-10-13 23:41:33.316821705 [ThreadId 5] - haskell-lsp:initializeRequestHandler: setting current dir to project root:/home/basic/haskell Started LSP server in 0.08s 2020-10-13 23:41:33.319782126 [ThreadId 15] - Registering ide configuration: IdeConfiguration {workspaceFolders = fromList [NormalizedUri 2891311396802828010 "file:///home/basic/haskell"], clientSettings = hashed Nothing} 2020-10-13 23:41:33.320330412 [ThreadId 7] - <--2--{"result":{"capabilities":{"typeDefinitionProvider":true,"foldingRangeProvider":false,"textDocumentSync":{"openClose":true,"change":2,"save":{}},"workspace":{"workspaceFolders":{"supported":true,"changeNotifications":true}},"implementationProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"executeCommandProvider":{"commands":["135178:eval:evalCommand","135178:ghcide:typesignature.add","135178:importLens:ImportLensCommand","135178:pragmas:addPragma","135178:retrie:retrieCommand","135178:tactic:tacticsAutoCommand","135178:tactic:tacticsIntrosCommand","135178:tactic:tacticsDestructCommand","135178:tactic:tacticsHomomorphismCommand","135178:tactic:tacticsDestructLambdaCaseCommand","135178:tactic:tacticsHomomorphismLambdaCaseCommand"]},"renameProvider":false,"colorProvider":false,"definitionProvider":true,"hoverProvider":true,"codeActionProvider":true,"completionProvider":{"triggerCharacters":["."],"resolveProvider":false},"codeLensProvider":{},"documentSymbolProvider":true,"documentFormattingProvider":true}},"jsonrpc":"2.0","id":0} 2020-10-13 23:41:33.322795673 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"initialized","params":{}} 2020-10-13 23:41:33.329460823 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"haskell":{"hlintOn":true,"maxNumberOfProblems":100,"diagnosticsOnChange":true,"liquidOn":false,"completionSnippetsOn":true,"formatOnImportOn":true,"formattingProvider":"ormolu","trace":{"server":"messages"},"logFile":"","languageServerVariant":"haskell-language-server","serverExecutablePath":"~/.ghcup/bin/haskell-language-server-8.10.2","updateBehavior":"keep-up-to-date","indentationRules":{"enabled":true}}}}} 2020-10-13 23:41:33.329645264 [ThreadId 5] - ---> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs","languageId":"haskell","version":1,"text":"\nsomeFunc x = x + 1\n\nmain :: IO ()\nmain = do\n let x = someFunc 3\n\n print x"}}} 2020-10-13 23:41:33.329877324 [ThreadId 15] - Configuration changed: Object (fromList [("haskell",Object (fromList [("logFile",String ""),("updateBehavior",String "keep-up-to-date"),("hlintOn",Bool True),("formatOnImportOn",Bool True),("indentationRules",Object (fromList [("enabled",Bool True)])),("liquidOn",Bool False),("languageServerVariant",String "haskell-language-server"),("serverExecutablePath",String "~/.ghcup/bin/haskell-language-server-8.10.2"),("diagnosticsOnChange",Bool True),("completionSnippetsOn",Bool True),("maxNumberOfProblems",Number 100.0),("formattingProvider",String "ormolu"),("trace",Object (fromList [("server",String "messages")]))]))]) 2020-10-13 23:41:33.330247162 [ThreadId 7] - <--2--{"jsonrpc":"2.0","params":{"registrations":[{"registerOptions":{"watchers":[{"kind":5,"globPattern":"**/*.hs"},{"kind":5,"globPattern":"**/*.hs-boot"},{"kind":5,"globPattern":"**/*.lhs"},{"kind":5,"globPattern":"**/*.lhs-boot"}]},"method":"workspace/didChangeWatchedFiles","id":"globalFileWatches"}]},"method":"client/registerCapability","id":0} 2020-10-13 23:41:33.330546266 [ThreadId 15] - Restarting build session (aborting the previous one took 0.00s) 2020-10-13 23:41:33.330758247 [ThreadId 14] - Finishing build session(exception: AsyncCancelled) 2020-10-13 23:41:33.331586235 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":0,"result":null} 2020-10-13 23:41:33.332174139 [ThreadId 15] - Set files of interest to: [(NormalizedFilePath "/home/basic/haskell/test.hs",Modified)] 2020-10-13 23:41:33.332423382 [ThreadId 5] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":null}" 2020-10-13 23:41:33.332545809 [ThreadId 24] - Finishing build session(exception: AsyncCancelled) 2020-10-13 23:41:33.33281748 [ThreadId 15] - Restarting build session (aborting the previous one took 0.00s) 2020-10-13 23:41:33.333102707 [ThreadId 15] - Opened text document: file:///home/basic/haskell/test.hs 2020-10-13 23:41:33.334221738 [ThreadId 38] - Consulting the cradle for "test.hs" Output from setting up the cradle Cradle {cradleRootDir = "/home/basic/haskell", cradleOptsProg = CradleAction: Cabal} 2020-10-13 23:41:33.334586133 [ThreadId 7] - <--2--{"jsonrpc":"2.0","params":{"token":0},"method":"window/workDoneProgress/create","id":1} 2020-10-13 23:41:33.334720025 [ThreadId 7] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"begin","cancellable":false,"title":"Setting up haskell (for test.hs)"},"token":0},"method":"$/progress"} 2020-10-13 23:41:33.336016548 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":1,"result":null} 2020-10-13 23:41:33.336156498 [ThreadId 5] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":null}" 2020-10-13 23:41:33.337190496 [ThreadId 33] - finish: kick (took 0.00s) 2020-10-13 23:41:33.337463575 [ThreadId 7] - <--2--{"jsonrpc":"2.0","params":{"uri":"file:///home/basic/haskell/test.hs","diagnostics":[{"severity":1,"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"source":"compiler","message":"cabal: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)"}]},"method":"textDocument/publishDiagnostics"} 2020-10-13 23:41:33.340160243 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"}}} 2020-10-13 23:41:33.340571749 [ThreadId 44] - finish: C:GetParsedModule (took 0.00s) 2020-10-13 23:41:33.340707124 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":1} 2020-10-13 23:41:33.341159492 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":2,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"},"range":{"start":{"line":7,"character":11},"end":{"line":7,"character":11}},"context":{"diagnostics":[]}}} 2020-10-13 23:41:33.341451814 [ThreadId 49] - finish: CodeAction (took 0.00s) 2020-10-13 23:41:33.341545594 [ThreadId 50] - finish: CodeAction:PackageExports (took 0.00s) 2020-10-13 23:41:33.341741544 [ThreadId 51] - finish: importLens (took 0.00s) 2020-10-13 23:41:33.341922446 [ThreadId 52] - finish: retrie (took 0.00s) 2020-10-13 23:41:33.342206306 [ThreadId 51] - finish: tactic (took 0.00s) 2020-10-13 23:41:33.342412764 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":2} 2020-10-13 23:41:33.560948437 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":3,"method":"textDocument/codeLens","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"}}} 2020-10-13 23:41:33.561183623 [ThreadId 57] - Plugin.makeCodeLens (ideLogger) 2020-10-13 23:41:33.561392539 [ThreadId 58] - finish: codeLens (took 0.00s) 2020-10-13 23:41:33.561933883 [ThreadId 60] - finish: (took 0.00s) 2020-10-13 23:41:33.563060524 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":3} 2020-10-13 23:41:33.573043451 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":4,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"},"range":{"start":{"line":7,"character":11},"end":{"line":7,"character":11}},"context":{"diagnostics":[]}}} 2020-10-13 23:41:33.573572266 [ThreadId 65] - finish: CodeAction (took 0.00s) 2020-10-13 23:41:33.573724206 [ThreadId 66] - finish: CodeAction:PackageExports (took 0.00s) 2020-10-13 23:41:33.573933435 [ThreadId 67] - finish: importLens (took 0.00s) 2020-10-13 23:41:33.574182642 [ThreadId 68] - finish: retrie (took 0.00s) 2020-10-13 23:41:33.574422949 [ThreadId 69] - finish: tactic (took 0.00s) 2020-10-13 23:41:33.574560773 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":4} 2020-10-13 23:41:34.259375036 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":5,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"},"range":{"start":{"line":7,"character":11},"end":{"line":7,"character":11}},"context":{"diagnostics":[]}}} 2020-10-13 23:41:34.259805315 [ThreadId 74] - finish: CodeAction (took 0.00s) 2020-10-13 23:41:34.260091721 [ThreadId 75] - finish: CodeAction:PackageExports (took 0.00s) 2020-10-13 23:41:34.260654892 [ThreadId 76] - finish: importLens (took 0.00s) 2020-10-13 23:41:34.260873306 [ThreadId 76] - finish: retrie (took 0.00s) 2020-10-13 23:41:34.261298528 [ThreadId 77] - finish: tactic (took 0.00s) 2020-10-13 23:41:34.261690799 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":5} 2020-10-13 23:41:34.40526284 [ThreadId 5] - ---> {"jsonrpc":"2.0","id":6,"method":"textDocument/codeAction","params":{"textDocument":{"uri":"file:///home/basic/haskell/test.hs"},"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"context":{"diagnostics":[{"range":{"start":{"line":0,"character":0},"end":{"line":1,"character":0}},"message":"cabal: streamingProcess: runInteractiveProcess: exec: does not exist (No such file or directory)","severity":1,"source":"compiler"}],"only":["quickfix"]}}} 2020-10-13 23:41:34.405749754 [ThreadId 82] - finish: CodeAction (took 0.00s) 2020-10-13 23:41:34.405915779 [ThreadId 83] - finish: CodeAction:PackageExports (took 0.00s) 2020-10-13 23:41:34.406150358 [ThreadId 84] - finish: importLens (took 0.00s) 2020-10-13 23:41:34.406406016 [ThreadId 85] - finish: retrie (took 0.00s) 2020-10-13 23:41:34.406635198 [ThreadId 86] - finish: tactic (took 0.00s) 2020-10-13 23:41:34.410842388 [ThreadId 7] - <--2--{"result":[],"jsonrpc":"2.0","id":6} ```
Vic-M commented 4 years ago

Putting the computer to sleep and re-opening VSCode fixed the issue (despite having previously restarted VSCode)...