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

Nix expression: Tests fail with `Exception: haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)` #172

Closed GuillaumeDesforges closed 4 years ago

GuillaumeDesforges commented 4 years ago

While working on https://github.com/NixOS/nixpkgs/pull/91279

Linking dist/build/func-test/func-test ...
running tests
Running 1 test suites...
Test suite func-test: RUNNING...
haskell-language-server
  commands
    are prefixed:                                                         FAIL
      Exception: haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
deferred responses
    instantly respond to failed modules with no cache:                    FAIL
      Exception: haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
format document
    works:                                                                FAIL
      haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
    works with custom tab size:                                           FAIL
      haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
    format range
      works:                                                              FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
      works with custom tab size:                                         FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
    formatting provider
      respects none:                                                      FAIL
    stylish-haskell
      formats a document:                                                 FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
      formats a range:                                                    FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
    brittany
      formats a document with LF endings:                                 FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
      formats a document with CRLF endings:                               FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
      formats a range with LF endings:                                    FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
      formats a range with CRLF endings:                                  FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
    ormolu
      formats correctly:                                                  FAIL
        haskell-language-server: createProcess: runInteractiveProcess: exec: does not exist (No such file or directory)
GuillaumeDesforges commented 4 years ago

Is there a way to see what's the thing that does not exist ?

fendor commented 4 years ago

I think you need to put the haskell-language-server executable on the path. IIRC, cabal test and stack test should put the executable on the path, are you running them differently? Relevant line: https://github.com/haskell/haskell-language-server/blob/master/test/utils/Test/Hls/Util.hs#L182

EDIT: the test-setup is kind of brittle/underdocumented

GuillaumeDesforges commented 4 years ago

Do you mean that the test suite tries to run the whole executable, and as such it needs it in the path ? I will try a fix in that direction asap, thanks

fendor commented 4 years ago

Yeah, we are running integration tests via lsp-test

GuillaumeDesforges commented 4 years ago

Added a preCheck script

https://github.com/NixOS/nixpkgs/blob/f6fe619c0de469ad02cfb7bfde27a1f81845174e/pkgs/development/tools/haskell/haskell-language-server/default.nix#L57-L60

to add executable to path for the tests.

Seems to work, thanks a lot!