Skip to content

cabal test fails in a nix-shell #2312

@sir4ur0n

Description

@sir4ur0n

Your environment

Which OS do you use:
NixOS 21.11 (build ID: 21.11pre322215.9bf75dd50b7)
Which lsp-client do you use:
N/A
Describe your project (alternative: link to the project):
https://github.com/haskell/haskell-language-server
Contents of hie.yaml:
N/A

Steps to reproduce

Follow the instructions for Nix and Cabal:

$ git clone https://github.com/haskell/haskell-language-server
$ cd haskell-language-server
$ nix-shell
$ cabal update
$ cabal build
$ cabal test

Expected behaviour

Tests succeed

Actual behaviour

Several tests fail in:

  • test:wrapper-test
  • test:func-test

Include debug information

$ cabal test
Build profile: -w ghc-8.10.7 -O1
In order, the following will be built (use -v for more details):
 - haskell-language-server-1.4.0.0 (test:func-test) (ephemeral targets)
 - haskell-language-server-1.4.0.0 (test:wrapper-test) (ephemeral targets)
Preprocessing test suite 'wrapper-test' for haskell-language-server-1.4.0.0..
Preprocessing test suite 'func-test' for haskell-language-server-1.4.0.0..
Building test suite 'wrapper-test' for haskell-language-server-1.4.0.0..
Building test suite 'func-test' for haskell-language-server-1.4.0.0..
Running 1 test suites...
Test suite wrapper-test: RUNNING...
haskell-language-server-wrapper
  --project-ghc-version
    stack with ghc 8.10.7:                    No 'hie.yaml' found. Try to discover the project type!
Running 1 test suites...
Test suite func-test: RUNNING...
haskell-language-server
  commands
    are prefixed:                                                          OK (0.12s)
    get de-prefixed:                                                       OK (0.19s)
  completions
    works:                                                                 FAIL
      Exception: IO exception:
      fd:48: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    itemCompletion/resolve works:                                          IGNORED
      no support for itemCompletion/resolve requests
    completes imports:                                                     FAIL
      Exception: IO exception:
      fd:40: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    completes qualified imports:                                           OK (9.61s)
    completes with no prefix:                                              FAIL
      Exception: IO exception:
      fd:51: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    strips compiler generated stuff from completions:                      FAIL
      Exception: IO exception:
      fd:57: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    have implicit foralls on basic polymorphic types:                      FAIL
      Exception: IO exception:
      fd:54: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    have implicit foralls with multiple type variables:                    OK (11.88s)
    maxCompletions:                                                        OK (12.00s)
    import function completions:                                           OK (11.50s)
    import second function completion:                                     OK (10.64s)
    contexts
      only provides type suggestions:                                      OK (11.89s)
      only provides value suggestions:                                     OK (11.96s)
      completes qualified type suggestions:                                OK (10.88s)
    snippets
      work for argumentless constructors:                                  OK (16.55s)
    stack with ghc 8.8.3:                     No 'hie.yaml' found. Try to discover the project type!
Failed to get project GHC version:CradleError {cradleErrorDependencies = [], cradleErrorExitCode = ExitFailure 1, cradleErrorStderr = ["Error when calling stack exec --silent ghc -- --numeric-version","","error: attribute 'ghc883' missing\n\n       at \171string\187:1:43:\n\n            1| with (import <nixpkgs> {}); let inputs = [haskell.compiler.ghc883 git gcc gmp]; libPath = lib.makeLibraryPath inputs; stackExtraArgs = lib.concatMap (pkg: [ ''--extra-lib-dirs=${lib.getLib pkg}/lib''   ''--extra-include-dirs=${lib.getDev pkg}/include'' ]) inputs; in runCommand ''myEnv'' { buildInputs = lib.optional stdenv.isLinux glibcLocales ++ inputs; STACK_PLATFORM_VARIANT=''nix''; STACK_IN_NIX_SHELL=1; LD_LIBRARY_PATH = libPath;STACK_IN_NIX_EXTRA_ARGS = stackExtraArgs; LANG=\"en_US.UTF-8\";} \"\"\n             |                                           ^\n(use '--show-trace' to show detailed location information)\n"]}
FAIL
      Exception: readCreateProcess: haskell-language-server-wrapper "--project-ghc-version" (exit 1): failed
    cabal with global ghc:                    No 'hie.yaml' found. Try to discover the project type!
OK (9.13s)
    stack with existing cabal build artifact: No 'hie.yaml' found. Try to discover the project type!
OK (15.75s)
      work for polymorphic types:                                          OK (14.36s)
      work for complex types:                                              OK (13.90s)
      work for infix functions:                                            OK (13.70s)
      work for infix functions in backticks:                               OK (13.20s)
OK (0.09s)

1 out of 4 tests failed (26.36s)
Test suite wrapper-test: FAIL
Test suite logged to:
/home/sir4ur0n/sandbox/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/haskell-language-server-1.4.0.0/t/wrapper-test/test/haskell-language-server-1.4.0.0-wrapper-test.log
0 of 1 test suites (0 of 1 test cases) passed.
      work for qualified infix functions:                                  OK (13.45s)
      work for qualified infix functions in backticks:                     OK (13.07s)
      respects lsp configuration:                                          OK (13.16s)
      respects client capabilities:                                        OK (13.08s)
  plugin config
    config parsing
      empty object as user configuration should not send error logMessage: OK (0.16s)
  deferred responses
    instantly respond to failed modules with no cache:                     OK (0.92s)
    multiple main modules
      Can load one file at a time, when more than one Main module exists:  IGNORED
        Broken: Unexpected ConduitParser.empty
  definitions
    goto's symbols:                                                        IGNORED
      Broken: file:///Users/jwindsor/src/haskell-language-server/test/testdata/References.hs
    goto's imported modules:                                               IGNORED
      Broken: file:///Users/jwindsor/src/haskell-language-server/test/testdata/Bar.hs
    goto's exported modules:                                               IGNORED
      Broken: file:///Users/jwindsor/src/haskell-language-server/test/testdata/Bar.hs
    goto's imported modules that are loaded:                               IGNORED
      Broken: file:///Users/jwindsor/src/haskell-language-server/test/testdata/Bar.hs
    goto's imported modules that are loaded, and then closed:              IGNORED
      Broken: file:///Users/jwindsor/src/haskell-language-server/test/testdata/Bar.hs
  diagnostics providers
    Diagnostics work
      example plugin produces diagnostics:                                 OK (1.02s)
    only diagnostics on save
      Respects diagnosticsOnChange setting:                                IGNORED
        diagnosticsOnChange parameter is not supported right now
    Warnings are warnings
      Overrides -Werror:                                                   OK (14.22s)
  format document
    works:                                                                 OK (0.99s)
    works with custom tab size:                                            FAIL (0.11s)
      IO exception:
      fd:52: hPutBuf: resource vanished (Broken pipe)
      arose while trying to send message:
      {
          "jsonrpc": "2.0",
          "params": null,
          "method": "shutdown",
          "id": 0
      }
    format range
      works:                                                               OK (0.89s)
      works with custom tab size:                                          OK (1.07s)
    formatting provider
      respects none:                                                       OK (0.21s)
      can change on the fly:                                               OK (1.54s)
      supports both new and old configuration sections:                    OK (0.94s)
  behaviour on malformed projects
    no test executed:                                                      OK
  code actions
    import suggestions
      works with 3.8 code action kinds:                                    OK (11.69s)
    add package suggestions
      adds to .cabal files:                                                IGNORED
        no support for adding dependent packages via code action
      adds to hpack package.yaml files:                                    IGNORED
        no support for adding dependent packages via code action
    redundant import code actions
      remove solitary redundant imports:                                   OK (10.07s)
      doesn't touch other imports:                                         OK (10.06s)
    rename suggestions
      works:                                                               OK (10.95s)
      doesn't give both documentChanges and changes:                       OK (11.19s)
    missing top level signature code actions
      Adds top level signature:                                            OK (9.42s)
    typed hole code actions
      works:                                                               OK (10.53s)
      doesn't work when wingman is active:                                 OK (9.99s)
      shows more suggestions:                                              OK (10.32s)
      doesnt show more suggestions when wingman is active:                 OK (9.53s)
    unused term code actions
      Prefixes with '_':                                                   IGNORED
        no support for prefixing unused names with _
      respect 'only' parameter:                                            OK (9.37s)
  liquid haskell diagnostics
    liquid haskell generates diagnostics:                                  IGNORED
      no liquid haskell
  hie-bios
    loads modules inside main-is:                                          OK (1.05s)
    reports errors in hie.yaml:                                            OK (0.40s)
  highlight
    works:                                                                 OK (1.24s)
  window/workDoneProgress
    sends indefinite progress notifications:                               OK (1.26s)
    eval plugin sends progress reports:                                    OK (12.25s)
    ormolu plugin sends progress notifications:                            OK (1.04s)
    fourmolu plugin sends progress notifications:                          OK (1.35s)
    liquid haskell plugin sends progress notifications:                    IGNORED
      no liquid Haskell support
  references
    works with definitions:                                                IGNORED
      Broken
  document symbols
    pre 3.10 symbol information
      provides nested data types and constructors:                         OK (0.65s)
      provides nested where functions:                                     IGNORED
        extracting symbols from nested wheres not supported
      provides pattern synonyms:                                           IGNORED
        extracting pattern synonym symbols not supported
      provides imports:                                                    OK (1.29s)
    3.10 hierarchical document symbols
      provides nested data types and constructors:                         OK (0.92s)
      provides nested where functions:                                     IGNORED
        extracting symbols from nested wheres not supported
      provides pattern synonyms:                                           IGNORED
        extracting pattern synonym symbols not supported
      provides imports:                                                    OK (0.74s)
  type definitions
    finds local definition of record variable:                             OK (0.81s)
    finds local definition of newtype variable:                            OK (1.14s)
    finds local definition of sum type variable:                           OK (0.98s)
    finds local definition of sum type constructor:                        OK (0.94s)
    finds non-local definition of type def:                                OK (1.01s)
    find local definition of type def:                                     OK (0.76s)
    find type-definition of type def in component:                         OK (0.95s)
    find definition of parameterized data type:                            OK (0.55s)

6 out of 84 tests failed (51.72s)
Test suite func-test: FAIL
Test suite logged to:
/home/sir4ur0n/sandbox/haskell-language-server/dist-newstyle/build/x86_64-linux/ghc-8.10.7/haskell-language-server-1.4.0.0/t/func-test/test/haskell-language-server-1.4.0.0-func-test.log
0 of 1 test suites (0 of 1 test cases) passed.
cabal: Tests failed for test:func-test from haskell-language-server-1.4.0.0.
Tests failed for test:wrapper-test from haskell-language-server-1.4.0.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    os: nixostype: bugSomething isn't right: doesn't work as intended, documentation is missing/outdated, etc..

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions