Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to use haskell-language-server on itself #121

Closed
sir4ur0n opened this issue May 21, 2020 · 41 comments · Fixed by #147
Closed

Failing to use haskell-language-server on itself #121

sir4ur0n opened this issue May 21, 2020 · 41 comments · Fixed by #147
Labels
can-workaround CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..

Comments

@sir4ur0n
Copy link
Collaborator

sir4ur0n commented May 21, 2020

Hi,

I searched in the previous issues but couldn't find any related issue.

I do not manage to use haskell-language-server on itself 🤔 Basically I wanted to start hacking/looking at the code, and noticed in VSCode that all hovers get stuck on "Loading...".

Steps to reproduce:

  1. git clone https://github.com/haskell/haskell-language-server --recurse-submodules
  2. cd haskell-language-server
  3. stack ./install.hs hls-8.6.5 (8.6.5 because stack.yaml uses lts-14.27 which relies on GHC 8.6.5)
  4. cp hie.yaml.stack hie.yaml
  5. haskell-language-server

I get 3 errors and haskell-language-server: <command line>: cannot satisfy -package z-haskell-language-server-z-hls-test-utils.

In VSCode, surprisingly, I don't get the 3 compiler errors, only the last haskell-language-server: <command line>: cannot satisfy -package z-haskell-language-server-z-hls-test-utils bit 🤔 Maybe this is related to the fact that VS Code runs it in LSP mode though.

Below the full logs (second run, the first is the same but with a lot of using precompiled language):

ghcide version: 0.1.0.0 (GHC: 8.6.5) (PATH: /home/sir4ur0n/.local/bin/haskell-language-server) (GIT hash: 6c58c2d2147b14a4fd21f6d95183125d46141f3d)
(haskell-language-server)Ghcide setup tester in /home/sir4ur0n/code/haskell-language-server.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/6: Finding files to test in /home/sir4ur0n/code/haskell-language-server
Found 201 files

Step 2/6: Looking for hie.yaml files that control setup
Found 2 cradles

Step 3/6: Initializing the IDE

Step 4/6: Type checking the files
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs"
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:     /home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs"
File:     /home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:     /home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath: /home/sir4ur0n/code/haskell-language-server/install/src/Stack.hs
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs"
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
> Cloning into '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-cfd5b37729d07439'...
> HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.
> Resolving dependencies...
> cabal: Could not resolve dependencies:
> [__0] trying: ghcide-0.1.0 (user goal)
> [__1] trying: ghcide:-ghc-lib
> [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
> [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
> [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
> [__5] next goal: pretty (dependency of template-haskell)
> [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
> deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
> [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
> pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
> pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
> pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
> pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
> pretty==1.1.3.3/installed-1.1...)
> [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
> After searching the rest of the dependency tree exhaustively, these were the
> goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
> yaml, ghcide, ghcide:ghc-lib
> Try running with --minimize-conflict-set to improve the error message.
>
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","Resolving dependencies...\n","Cloning into '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-cfd5b37729d07439'...\nHEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.\ncabal: Could not resolve dependencies:\n[__0] trying: ghcide-0.1.0 (user goal)\n[__1] trying: ghcide:-ghc-lib\n[__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)\n[__3] trying: yaml-0.11.4.0 (dependency of hie-bios)\n[__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)\n[__5] next goal: pretty (dependency of template-haskell)\n[__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>\ndeepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)\n[__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,\npretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,\npretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,\npretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,\npretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>\npretty==1.1.3.3/installed-1.1...)\n[__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)\nAfter searching the rest of the dependency tree exhaustively, these were the\ngoals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,\nyaml, ghcide, ghcide:ghc-lib\nTry running with --minimize-conflict-set to improve the error message.\n\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal
  Resolving dependencies...

  Cloning into
  '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-cfd5b37729d07439'...
  HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to
  guide scheduling of short actions on a single core.
  cabal: Could not resolve dependencies:
  [__0] trying: ghcide-0.1.0 (user goal)
  [__1] trying: ghcide:-ghc-lib
  [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
  [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
  [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
  [__5] next goal: pretty (dependency of template-haskell)
  [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
  deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
  [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
  pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
  pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
  pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
  pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
  pretty==1.1.3.3/installed-1.1...)
  [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
  After searching the rest of the dependency tree exhaustively, these were the
  goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
  yaml, ghcide, ghcide:ghc-lib
  Try running with --minimize-conflict-set to improve the error message.



> HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.
> Resolving dependencies...
> cabal: Could not resolve dependencies:
> [__0] trying: ghcide-0.1.0 (user goal)
> [__1] trying: ghcide:-ghc-lib
> [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
> [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
> [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
> [__5] next goal: pretty (dependency of template-haskell)
> [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
> deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
> [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
> pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
> pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
> pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
> pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
> pretty==1.1.3.3/installed-1.1...)
> [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
> After searching the rest of the dependency tree exhaustively, these were the
> goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
> yaml, ghcide, ghcide:ghc-lib
> Try running with --minimize-conflict-set to improve the error message.
>
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","Resolving dependencies...\n","HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.\ncabal: Could not resolve dependencies:\n[__0] trying: ghcide-0.1.0 (user goal)\n[__1] trying: ghcide:-ghc-lib\n[__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)\n[__3] trying: yaml-0.11.4.0 (dependency of hie-bios)\n[__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)\n[__5] next goal: pretty (dependency of template-haskell)\n[__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>\ndeepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)\n[__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,\npretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,\npretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,\npretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,\npretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>\npretty==1.1.3.3/installed-1.1...)\n[__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)\nAfter searching the rest of the dependency tree exhaustively, these were the\ngoals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,\nyaml, ghcide, ghcide:ghc-lib\nTry running with --minimize-conflict-set to improve the error message.\n\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/src/Ide/Logger.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal
  Resolving dependencies...

  HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to
  guide scheduling of short actions on a single core.
  cabal: Could not resolve dependencies:
  [__0] trying: ghcide-0.1.0 (user goal)
  [__1] trying: ghcide:-ghc-lib
  [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
  [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
  [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
  [__5] next goal: pretty (dependency of template-haskell)
  [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
  deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
  [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
  pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
  pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
  pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
  pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
  pretty==1.1.3.3/installed-1.1...)
  [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
  After searching the rest of the dependency tree exhaustively, these were the
  goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
  yaml, ghcide, ghcide:ghc-lib
  Try running with --minimize-conflict-set to improve the error message.



> haskell-language-server> configure (lib + internal-lib + exe)
> Configuring haskell-language-server-0.1.0.0...
> haskell-language-server> initial-build-steps (lib + internal-lib + exe)
> Configuring GHCi with the following packages: haskell-language-server
> /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d
Right (ComponentOptions {componentOptions = ["-i","-odir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hidir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hide-all-packages","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build","-i/home/sir4ur0n/code/haskell-language-server/src","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/global-autogen","-stubdir=/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build","-package=z-haskell-language-server-z-hls-test-utils","-package-id=base-4.12.0.0","-package-id=aeson-1.4.6.0-4uBfdXbzscjDeNqrTRfhWo","-package-id=binary-0.8.6.0","-package-id=bytestring-0.10.8.2","-package-id=Cabal-3.0.2.0-3jfu38O1DeD8P2u1zPtBbC","-package-id=cabal-helper-1.1.0.0-DrGwajU6uQBJXzpeDNViCO","-package-id=containers-0.6.0.1","-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8","-package-id=deepseq-1.4.4.0","-package-id=Diff-0.3.4-C6Bl1un4oiiBWGaHLlh5bu","-package-id=directory-1.3.3.0","-package-id=extra-1.7.1-DnfiWqwxEy2OHWHxdHnCT","-package-id=filepath-1.4.2.1","-package-id=floskell-0.10.2-EMrS0imTu9T9A3ifnigzE2","-package-id=ghc-8.6.5","-package-id=ghcide-0.1.0-BeX44vabl7jLy1E9mAxkI9","-package-id=gitrev-1.3.1-8kiHdfyRMvw1nWlvJj9ecZ","-package-id=hashable-1.2.7.0-2SI038axTEd7AEZJ275kpi","-package-id=haskell-lsp-0.22.0.0-Dm3Y5tmF7yh4ECsA5etaU6","-package-id=hie-bios-0.5.0-FSBb2ut8sK4IXHsh2geoHJ","-package-id=hslogger-1.2.12-EOh2s68fQfBFyuAt5sDs18","-package-id=lens-4.18-HbPjKqYp8F3CoEHux0jQ2","-package-id=ormolu-0.0.5.0-KfthQtMuKHrDkm8OPx7ZH2","-package-id=optparse-simple-0.1.1.2-HSIl6Lj5MIz5lTvuDIhitS","-package-id=process-1.6.5.0","-package-id=regex-tdfa-1.3.1.0-LDROcq679OH5OnpszsUxo","-package-id=shake-0.19-Cn9Fh99JVyzEo9h0pJqFaB","-package-id=text-1.2.3.1","-package-id=transformers-0.5.6.2","-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4","-package-id=unix-2.7.2.2","-package-id=brittany-0.12.1.1-4VsYnoWOShhGsdS0XyT3CY","-Wall","-Wredundant-constraints","-Wno-name-shadowing","-DAGPL","-optP-include","-optP/home/sir4ur0n/code/haskell-language-server/.stack-work/ghci/73152f3c/cabal_macros.h","-ghci-script=/tmp/haskell-stack-ghci/85f25946/ghci-script","-package-db","/home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d"], componentRoot = "/home/sir4ur0n/code/haskell-language-server", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]})
haskell-language-server: <command line>: cannot satisfy -package z-haskell-language-server-z-hls-test-utils
    (use -v for more information)

For what it's worth:

  • Windows WSL (Ubuntu 18.04 LTS)
  • I have correctly run sudo apt install libicu-dev libtinfo-dev libgmp-dev
  • Stack version Version 2.3.1, Git revision de2a7b694f07de7e6cf17f8c92338c16286b2878 (8103 commits) x86_64 hpack-0.33.0
  • VS Code (using the WSL plugin) 1.45.1
  • In the Language Server Haskell (VS Code) plugin, I have changed the following:
    • Formatting provider: ormolu
    • Hie variant: haskell-language-server
@Avi-D-coder
Copy link
Collaborator

If I recall run stack build, and try again

@fendor
Copy link
Collaborator

fendor commented May 21, 2020

Thank you for your bug report!
I think stack repl hls-test-utils doesnt work, that is why it crashes.

EDIT: misclicked, didnt intend to close

@fendor fendor closed this as completed May 21, 2020
@fendor fendor reopened this May 21, 2020
@sir4ur0n
Copy link
Collaborator Author

I tried stack build between steps 2 and 3 and there are still many errors (though there are more of them), see the new log below:

ghcide version: 0.1.0.0 (GHC: 8.6.5) (PATH: /home/sir4ur0n/.local/bin/haskell-language-server) (GIT hash: 6c58c2d2147b14a4fd21f6d95183125d46141f3d)
(haskell-language-server)Ghcide setup tester in /home/sir4ur0n/code/haskell-language-server.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/6: Finding files to test in /home/sir4ur0n/code/haskell-language-server
Found 201 files

Step 2/6: Looking for hie.yaml files that control setup
Found 2 cradles

Step 3/6: Initializing the IDE

Step 4/6: Type checking the files
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs"
> Resolving dependencies...
> cabal: Could not resolve dependencies:
> [__0] trying: ghcide-0.1.0 (user goal)
> [__1] trying: ghcide:-ghc-lib
> [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
> [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
> [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
> [__5] next goal: pretty (dependency of template-haskell)
> [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
> deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
> [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
> pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
> pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
> pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
> pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
> pretty==1.1.3.3/installed-1.1...)
> [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
> After searching the rest of the dependency tree exhaustively, these were the
> goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
> yaml, ghcide, ghcide:ghc-lib
> Try running with --minimize-conflict-set to improve the error message.
>
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","Resolving dependencies...\n","cabal: Could not resolve dependencies:\n[__0] trying: ghcide-0.1.0 (user goal)\n[__1] trying: ghcide:-ghc-lib\n[__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)\n[__3] trying: yaml-0.11.4.0 (dependency of hie-bios)\n[__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)\n[__5] next goal: pretty (dependency of template-haskell)\n[__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>\ndeepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)\n[__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,\npretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,\npretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,\npretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,\npretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>\npretty==1.1.3.3/installed-1.1...)\n[__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)\nAfter searching the rest of the dependency tree exhaustively, these were the\ngoals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,\nyaml, ghcide, ghcide:ghc-lib\nTry running with --minimize-conflict-set to improve the error message.\n\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/FileWithWarning.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/FileWithWarning.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal
  Resolving dependencies...

  cabal: Could not resolve dependencies:
  [__0] trying: ghcide-0.1.0 (user goal)
  [__1] trying: ghcide:-ghc-lib
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs"
  [__2] trying: hie-bios-0.5.0 (dependency of ghcide -ghc-lib)
  [__3] trying: yaml-0.11.4.0 (dependency of hie-bios)
  [__4] trying: template-haskell-2.11.1.0/installed-2.1... (dependency of yaml)
  [__5] next goal: pretty (dependency of template-haskell)
  [__5] rejecting: pretty-1.1.3.3/installed-1.1... (conflict: hie-bios =>
  deepseq>=1.4.3 && <1.5, pretty => deepseq==1.4.2.0/installed-1.4...)
  [__5] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
  pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
  pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
  pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
  pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
  pretty==1.1.3.3/installed-1.1...)
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
  [__5] fail (backjumping, conflict set: hie-bios, pretty, template-haskell)
  After searching the rest of the dependency tree exhaustively, these were the
  goals I've had most trouble fulfilling: template-haskell, pretty, hie-bios,
  yaml, ghcide, ghcide:ghc-lib
  Try running with --minimize-conflict-set to improve the error message.



File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/FileWithWarning.hs
Hidden:   no
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/implicit-exe/src/Lib.hs"
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/FileWithWarning.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/implicit-exe/src/Lib.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/src/Ide/Plugin/Example2.hs"
File:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
File:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/implicit-exe/src/Lib.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/implicit-exe/src/Lib.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
> haskell-language-server> configure (lib + internal-lib + exe)
> Configuring haskell-language-server-0.1.0.0...
> haskell-language-server> initial-build-steps (lib + internal-lib + exe)
> Configuring GHCi with the following packages: haskell-language-server
> /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d
Right (ComponentOptions {componentOptions = ["-i","-odir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hidir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hide-all-packages","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build","-i/home/sir4ur0n/code/haskell-language-server/src","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/global-autogen","-stubdir=/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build","-package-id=haskell-language-server-0.1.0.0-KwWIUCpOSrv1UBEUeue5Rw-hls-test-utils","-package-id=base-4.12.0.0","-package-id=aeson-1.4.6.0-4uBfdXbzscjDeNqrTRfhWo","-package-id=binary-0.8.6.0","-package-id=bytestring-0.10.8.2","-package-id=Cabal-3.0.2.0-3jfu38O1DeD8P2u1zPtBbC","-package-id=cabal-helper-1.1.0.0-DrGwajU6uQBJXzpeDNViCO","-package-id=containers-0.6.0.1","-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8","-package-id=deepseq-1.4.4.0","-package-id=Diff-0.3.4-C6Bl1un4oiiBWGaHLlh5bu","-package-id=directory-1.3.3.0","-package-id=extra-1.7.1-DnfiWqwxEy2OHWHxdHnCT","-package-id=filepath-1.4.2.1","-package-id=floskell-0.10.2-EMrS0imTu9T9A3ifnigzE2","-package-id=ghc-8.6.5","-package-id=ghcide-0.1.0-BeX44vabl7jLy1E9mAxkI9","-package-id=gitrev-1.3.1-8kiHdfyRMvw1nWlvJj9ecZ","-package-id=hashable-1.2.7.0-2SI038axTEd7AEZJ275kpi","-package-id=haskell-lsp-0.22.0.0-Dm3Y5tmF7yh4ECsA5etaU6","-package-id=hie-bios-0.5.0-FSBb2ut8sK4IXHsh2geoHJ","-package-id=hslogger-1.2.12-EOh2s68fQfBFyuAt5sDs18","-package-id=lens-4.18-HbPjKqYp8F3CoEHux0jQ2","-package-id=ormolu-0.0.5.0-KfthQtMuKHrDkm8OPx7ZH2","-package-id=optparse-simple-0.1.1.2-HSIl6Lj5MIz5lTvuDIhitS","-package-id=process-1.6.5.0","-package-id=regex-tdfa-1.3.1.0-LDROcq679OH5OnpszsUxo","-package-id=shake-0.19-Cn9Fh99JVyzEo9h0pJqFaB","-package-id=text-1.2.3.1","-package-id=transformers-0.5.6.2","-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4","-package-id=unix-2.7.2.2","-package-id=brittany-0.12.1.1-4VsYnoWOShhGsdS0XyT3CY","-Wall","-Wredundant-constraints","-Wno-name-shadowing","-DAGPL","-optP-include","-optP/home/sir4ur0n/code/haskell-language-server/.stack-work/ghci/73152f3c/cabal_macros.h","-ghci-script=/tmp/haskell-stack-ghci/85f25946/ghci-script","-package-db","/home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d"], componentRoot = "/home/sir4ur0n/code/haskell-language-server", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]})
"Making new HscEnv[main]"
(([],Just HscEnvEq 203),fromList [("haskell-language-server.cabal",Just 2020-05-21 19:12:51.7776626 UTC),("package.yaml",Nothing),("stack.yaml",Just 2020-05-21 19:12:51.7962174 UTC)])
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs"
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/src/\",Stack {component = Just \"haskell-language-server:tasty\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs
Hidden:   no
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/functional/Diagnostic.hs"
File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/A/Main.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/src/",Stack {component = Just "haskell-language-server:tasty"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
> Using main module: 1. Package `haskell-language-server' component haskell-language-server:test:func-test with main-is file: /home/sir4ur0n/code/haskell-language-server/test/functional/Main.hs
> haskell-language-server> configure (lib + internal-lib + exe)
> Configuring haskell-language-server-0.1.0.0...
> haskell-language-server> initial-build-steps (lib + internal-lib + exe)
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: haskell-language-server
>
> Warning: Didn't find expected autogen file:
>          /home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/func-test/autogen/cabal_macros.h
> /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb:/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d
Right (ComponentOptions {componentOptions = ["-i","-odir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hidir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hide-all-packages","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/func-test","-i/home/sir4ur0n/code/haskell-language-server/test/functional","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/func-test/autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/global-autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build/func-test/func-test-tmp","-stubdir=/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux/Cabal-2.4.0.1/build","-package-id=haskell-language-server-0.1.0.0-KwWIUCpOSrv1UBEUeue5Rw-hls-test-utils","-package-id=base-4.12.0.0","-package-id=aeson-1.4.6.0-4uBfdXbzscjDeNqrTRfhWo","-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8","-package-id=directory-1.3.3.0","-package-id=filepath-1.4.2.1","-package-id=haskell-language-server-0.1.0.0-3MzaxwWY0dx6ll0dU7WICN","-package-id=haskell-lsp-0.22.0.0-Dm3Y5tmF7yh4ECsA5etaU6","-package-id=haskell-lsp-types-0.22.0.0-EqCdNjFLrl1H6FLGsAPz20","-package-id=hspec-expectations-0.8.2-xEhsaJyqHC4OUn6v2CIJJ","-package-id=lens-4.18-HbPjKqYp8F3CoEHux0jQ2","-package-id=lsp-test-0.10.3.0-8UmPD9MvFJRH3G2kYk9Unq","-package-id=tasty-1.2.3-GiudK7yenNPC8Gtev28Pwr","-package=tasty-ant-xml-1.1.6","-package=tasty-expected-failure-0.11.1.2","-package-id=tasty-hunit-0.10.0.2-FgUrIbgCsUcDDS8XJ0iyJm","-package=tasty-rerun-1.1.17","-package-id=text-1.2.3.1","-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4","-Wall","-Wno-name-shadowing","-rtsopts","-with-rtsopts=-N","-DAGPL","-ghci-script=/tmp/haskell-stack-ghci/2ed80c41/ghci-script","-package-db","/home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/snapshots/x86_64-linux/4242af1e5fb216b0d2a47f3b5a44999e35ce098c7a4033235b9253d656a0b839/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-8.6.5/lib/ghc-8.6.5/package.conf.d"], componentRoot = "/home/sir4ur0n/code/haskell-language-server", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]})
haskell-language-server: <command line>: cannot satisfy -package tasty-ant-xml-1.1.6
    (use -v for more information)

@Avi-D-coder
Copy link
Collaborator

Avi-D-coder commented May 21, 2020

Is it working when you open files in vscode?
If not what files are you opening.
Running it from the command line is expected to produce many Multi Cradle: No prefixes matched errors.

@sir4ur0n
Copy link
Collaborator Author

You are right! This seems to work now in VS Code: at least I have hover types and GHC warnings correctly displayed.

I propose we use this issue to add in the README that one must run stack build before running stack ./install.hs XXX? Unless you want this to be fixed some other way?

@Avi-D-coder
Copy link
Collaborator

We should probably should just invoke stack build in a side process with progress indicators, at the start if we see that error. I don't believe cabal has that issue.

The same error happens on other repos besides hls if you don't run stack build first.

A PR containing either a note in the readme about that error, or detecting the error and invoking stack build automatically is welcome.

@sir4ur0n sir4ur0n reopened this May 21, 2020
@sir4ur0n
Copy link
Collaborator Author

Accidental closing too 😅

I think the surprising/weird bit is that stack install is actually a shortcut for stack build --copy-bins, but the command we run stack ./install.hs hls-8.6.5 doesn't do the same thing. It's pretty confusing in my opinion.

I am unsure if this is feasible, but I think the ideal would be for this command to take care of building

@Avi-D-coder
Copy link
Collaborator

It would be useful to change ./install.hs, but the problem still exists for other repos.

@jneira is this possible?

@Anrock
Copy link
Contributor

Anrock commented May 21, 2020

haskell-language-server: : cannot satisfy -package z-haskell-language-server-z-hls-test-utils.

one must run stack build before running stack ./install.hs XXX

Didn't read the issue entirely but these pieces look awfully lot like #114

@Avi-D-coder
Copy link
Collaborator

@Anrock When stack fails it always looks similar, but I have seen it on other more basic repos and stack build does not fix 114.

@Anrock
Copy link
Contributor

Anrock commented May 22, 2020

Sorry, I was probably thinking of commercialhaskell/stack#4148, which had a workaround of stack build and was somehow related to upstream of #114.

@Avi-D-coder
Copy link
Collaborator

@Anrock That does look like the cause.

@jneira
Copy link
Member

jneira commented May 22, 2020

Hi, well, stack install.hs hls-xxx do several things, but one of them is stack install --stack-yaml stack-xxx.yaml for sure:

execStackWithGhc_ vn $ ["install"] ++ args

So whatever would do stack install, it should do too. You dont mention the stack yaml config file, the script always uses one of them, maybe the difference is related with that.

@jneira
Copy link
Member

jneira commented May 22, 2020

You dont mention the stack yaml config file, the script always uses one of them, maybe the difference is related with that.

Indeed, i have a hypothesis: hls picks stack.yaml by default but stack install.hs always choose one with the version suffix. So you have to execute a stack install.hs hie-xxx with the same ghc version than the raw stack.yaml. Now it is ghc-8.6.5 cause newer ghc versions has a bug for windows.

Or replace the stack.yaml with one of the installed ones. If it is the cause it should be mentioned in the README.

@sir4ur0n
Copy link
Collaborator Author

Indeed, i have a hypothesis: hls picks stack.yaml by default but stack install.hs always choose one with the version suffix. So you have to execute a stack install.hs hie-xxx with the same ghc version than the raw stack.yaml. Now it is ghc-8.6.5 cause newer ghc versions has a bug for windows.

But that's exactly what I did in my first post, right? I did stack ./install.hs hls-8.6.5 so it should work according to your comment, but it doesn't according to my tests :(

@jneira
Copy link
Member

jneira commented May 22, 2020

Oh, sorry i missed that one, so maybe stack build does something that stack build --copy-bins does not? it would be really strange but we can compare the artefacts generated in .stack-work for both.
In that case we could add a stack build in the install script with a comment cause it seems pretty useless without context.

Otoh if stack is messing with the private lib here too we could replace it with common stanzas in .cabal and fix both issues

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented May 22, 2020

I just did some tests and the content of .stack-work is exactly the same with and without --copy-bins:

$ stack build
$ find .stack-work -type f -print0 | xargs -0 md5sum >> ~/sandbox/without-copy.txt
$ rm -rf .stack-work
$ stack build --copy-bins
$ find .stack-work -type f -print0 | xargs -0 md5sum >> ~/sandbox/with-copy.txt
$ diff ~/sandbox/without-copy.txt ~/sandbox/with-copy.txt
# empty line

There is no difference: there are exactly the same files and they have the same checksum.

However there is a HUGE diff if I compare stack build to stack ./install.hs hls-8.6.5 (which I guess is expected, as not all targets are built, and there are additional args passed by the installer).

I think it revolves to either of these:

  • The script (./install/src/Stack.hs) builds the haskell-language-server-wrapper and haskell-language-server targets (and probably their dependencies), while stack build builds ghcide and haskell-language-server (which relies on ghcide). This difference of targets may explain the problem.
  • the arguments passed in Stack.hs are problematic.

Related:
Since ./install/ is not a package configured in stack.yaml, all code in it is anyway not supported by the hie.yaml (and simply adding it doesn't work because of dependencies on Cabal, shake, etc.).
How do you guys succeed to use HLS on this folder please?

Thank you for the help 🙏

By the way, could someone reproduce my issue? To ensure it's a real problem, and not just mine 😄

@jneira jneira added CI Continuous integration can-workaround status: needs repro type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc.. labels May 23, 2020
@jneira
Copy link
Member

jneira commented May 23, 2020

I am trying to reproduce and while i was doing it i checked the script code that installs hls:

case mbVersionNumber of
Nothing -> do
execStackWithCfgFile_ "stack.yaml" $
["install"
, "haskell-language-server-wrapper"
, "haskell-language-server"] ++ args
getGhcVersionOfCfgFile "stack.yaml" args
Just vn -> do
execStackWithGhc_ vn $ ["install"] ++ args

stack install.hs hls-8.6.5 takes the Just vn path and invokes stack install --stack-yaml stack-8.6.5.yaml so i think the problem is not there, although other steps in the script could be involved.

In fact stack install haskell-language-server-wrapper fails so the stack dev target, that takes the Nothing path is broken (i will fix it asap).

@jneira
Copy link
Member

jneira commented May 23, 2020

Unfortunately i cant build hls for 8.6.5 in my windows machine due to #90, so i have to fix that before reproducing this one 😄

@jneira
Copy link
Member

jneira commented May 24, 2020

Hi, i've got to install hls with stack install.hs hls-8.6.5 after deleting .stack-work and i reproduced the error. However, i've no got the error message directly but i had to collect the ghc options computed by the cradle and call it in a terminal to see the error message:

PS D:\dev\ws\haskell\hls> ghc "-i" "-odir=D:\dev\ws\haskell\hls\.stack-work\odir" "-hidir=D:\dev\ws\haskell\hls\.stack-work\odir" "-hide-all-packages" "-iD:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build\haskell-language-server" "-iD:\dev\ws\haskell\hls\exe" "-iD:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build\haskell-language-server\autogen" "-iD:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build\global-autogen" "-iD:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build\haskell-language-server\haskell-language-server-tmp" "-stubdir=D:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build" "-ID:\bin\stack\x86_64-windows\msys2-20180531\mingw64\include" "-LD:\bin\stack\x86_64-windows\msys2-20180531\mingw64\lib" "-LD:\bin\stack\x86_64-windows\msys2-20180531\mingw64\bin" "-package=z-haskell-language-server-z-hls-test-utils" "-package-id=base-4.12.0.0" "-package-id=aeson-1.4.6.0-DsrnuPFXLAlILCFBQ2AzgE" "-package-id=async-2.2.2-EbxQ7tk0OFk9dJNMtaidSf" "-package-id=base16-bytestring-0.1.1.6-17atVnUhDnM13pAkKbwL6I" "-package-id=binary-0.8.6.0" "-package-id=bytestring-0.10.8.2" "-package-id=cryptohash-sha1-0.11.100.1-FedZHhK3zTs7eOQXIrPeso" "-package-id=containers-0.6.0.1" "-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8" "-package-id=deepseq-1.4.4.0" "-package-id=directory-1.3.3.0" "-package-id=extra-1.7.1-PSuBSigoW23dwesYtnXfZ" "-package-id=filepath-1.4.2.1" "-package-id=ghc-8.6.5" "-package-id=ghc-check-0.3.0.1-4A801B9g1biEE5sFqd62dN" "-package-id=ghc-paths-0.1.0.12-8MhNqRZlSJXAzmVO0F6ybT" "-package-id=ghcide-0.1.0-KhREzo7jDNU4tRViaOnMFo" "-package-id=gitrev-1.3.1-7TThbNd1bbyEHouSCbophD" "-package-id=hashable-1.2.7.0-2SI038axTEd7AEZJ275kpi" "-package-id=haskell-lsp-0.22.0.0-3piifcNOUrW3byFYhRQLQo" "-package-id=hie-bios-0.5.0-5VZcc8LU1z2GHE3wORzrDN" "-package=haskell-language-server-0.1.0.0" "-package-id=hslogger-1.2.12-IV3VyzKmB3vIKqKHt4daAX" "-package-id=optparse-applicative-0.15.1.0-FihWsyor2QQHorNvaQqP8c" "-package-id=shake-0.19-F4KIhMxli1gEdS9eVwdqx3" "-package-id=text-1.2.3.1" "-package-id=time-1.8.0.2" "-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4" "-Wall" "-Wno-name-shadowing" "-Wredundant-constraints" "-rtsopts" "-with-rtsopts=-I0 -qg -A128M" "-DAGPL" "-optP-include" "-optPD:\dev\ws\haskell\hls\.stack-work\ghci\3c86ed7a\cabal_macros.h" "-ghci-script=C:\TEMP\haskell-stack-ghci\556c9616\ghci-script" "-package-db" "D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\pkgdb" "-package-db" "C:\sr\snapshots\5abeca39\pkgdb" "-package-db" "D:\bin\stack\x86_64-windows\ghc-8.6.5\lib\package.conf.d" .\exe\Main.hs
<command line>: cannot satisfy -package z-haskell-language-server-z-hls-test-utils
    (use -v for more information)

I guess the lack of final error message would be one of the advantages of work in windows. 😝

So it seems stack translates the private lib to a virtual package z-haskell-language-server-z-hls-test-utils, so it makes required to build the private lib for open every file of the project, even if it does not depend on the private library (sigh)
A weird thing is the build triggered by stack includes the private lib: https://gist.github.com/jneira/3931346b8bf412a53341d884ab546f73#file-vscode-out but it can't be resolved in any package-db (or another source of packages info) with those compiler arguments. So maybe some environment variable will be involved.

I dont think add stack build to install.hs would be the correct workaround, if you make a stack clean after the installation or you remove .stack-work the error will be reproduced and does not make sense rerun the install (it is simply run stack.build and it could be added to the readme).
I tried to do a stack install.hs --stack-yaml stack-8.6.5.yaml after remove .stack-work and i've got the same error.

But another one could be remove the private lib, given it causes issues in both cabal and stack and remove it with a common stanza to avoid duplicate the modules in several components.

@sir4ur0n
Copy link
Collaborator Author

But shouldn't the global hie.yaml provide support for this too? AFAIU it's possible, and would provide a more consistent developing/hacking experience for everyone.

With your solution, I need to open 2 editors, 1 for the main code and 1 for the install/ code... 🤔

@Avi-D-coder
Copy link
Collaborator

Install is not a component of hls.
As far as I know it's a separate package, so that building the install script does not require all the dependencies of hls.

@sir4ur0n
Copy link
Collaborator Author

I agree regarding building/packaging (hence not being present as a Stack or Cabal module), however hie-bios is also about how the project should be understood by tools. And the install folder also contains Haskell code so it would make sense to also support this. The hie.yaml could be a multi type with stack/cabal for other modules and another one for the install folder...

@jneira
Copy link
Member

jneira commented May 28, 2020

Yeah, @Avi-D-coder way is the more straightforward one. The install program doesn't belong to main hls project on purpose and hie.yaml requires it, afaik.
A note in the readme could be useful, yeah.

@Ailrun
Copy link
Member

Ailrun commented Jun 4, 2020

Hi, I tried to use HLS (of the latest commit) on exe/Main.hs and exe/Wrapper.hs (also from the latest commit), and failed with the following message

Consulting the cradle for "<project directory>/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/autogen/Paths_haskell_language_server.hs"
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: <project directory>","filepath: <project directory>/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/autogen/Paths_haskell_language_server.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/utils/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]

Is this related with this issue, or better to be a separate issue?

@jneira
Copy link
Member

jneira commented Jun 4, 2020

@Ailrun no, sorry, that is a general issue with stack and the use of the autogenerated Paths_<package>.hs module, see https://github.com/digital-asset/ghcide/issues/574 (as hls use ghcide underneath)

@jneira
Copy link
Member

jneira commented Jun 4, 2020

@sir4ur0n i think the main issue (private lib) has been avoided, do you think we could close this one and open other more specific issues, if needed?

@Ailrun
Copy link
Member

Ailrun commented Jun 4, 2020

@jneira Then should I file an issue on the stack repo? You meant it's a problem of stack, right?

@jneira
Copy link
Member

jneira commented Jun 4, 2020

@Ailrun not totally sure, although stack handling could be the origin of the issue, it seems it does no cause any direct problem in stack itself, so the fix would be specifically for our use case.

I think before filling an issue it will be great try to find an actual problem in stack itself caused by that.
If there is no one, we could open it anyways, for sure.
Anyway i think we should center the topic in the linked issue: https://github.com/digital-asset/ghcide/issues/574

@jneira
Copy link
Member

jneira commented Jun 4, 2020

So the issues commented in this issue has been included in a more specific one (#145) or solved, i think we can close it
@sir4ur0n feel free to reopen in it is not the case

@jneira jneira closed this as completed Jun 4, 2020
@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 4, 2020

I just tested again and the problem seems to persist 🤔 I started again from a fresh clone as stated in my OP.

First run

Errors

  • fdLock: invalid argument (Invalid argument) for /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
  • fdLock: invalid argument (Invalid argument) for /home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs
  • haskell-language-server: <command line>: cannot satisfy -package haskell-language-server-0.1.0.0 though this seems to be a warning? I'm not sure

Full logs

ghcide version: 0.1.0.0 (GHC: 8.6.5) (PATH: /home/sir4ur0n/.local/bin/haskell-language-server) (GIT hash: 2310e1039c90d9bccaffd688a0d1ec79a9360bf4)
(haskell-language-server)Ghcide setup tester in /home/sir4ur0n/code/haskell-language-server.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/6: Finding files to test in /home/sir4ur0n/code/haskell-language-server
Found 201 files

Step 2/6: Looking for hie.yaml files that control setup
Found 2 cradles

Step 3/6: Initializing the IDE

Step 4/6: Type checking the files
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs"
> Cloning into '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-5f144bd86bc7c753'...
> HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.
> fdLock: invalid argument (Invalid argument)
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","","Cloning into '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-5f144bd86bc7c753'...\nHEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.\nfdLock: invalid argument (Invalid argument)\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal

  Cloning into
  '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-5f144bd86bc7c753'...
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/test/exe/Main.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal

  Cloning into
  '/home/sir4ur0n/code/haskell-language-server/ghcide/dist-newstyle/src/shake-5f144bd86bc7c753'...
  HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to
  guide scheduling of short actions on a single core.
  fdLock: invalid argument (Invalid argument)


> HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.
> fdLock: invalid argument (Invalid argument)
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","","HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to guide scheduling of short actions on a single core.\nfdLock: invalid argument (Invalid argument)\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs
Hidden:   no
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/functional/Diagnostic.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src-ghc88/Development/IDE/GHC/HieBin.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Failed to parse result of calling cabal

  HEAD is now at fb3859dc Remove shake scheduler, and use previous action run times as estimates to
  guide scheduling of short actions on a single core.
  fdLock: invalid argument (Invalid argument)


> Using main module: 1. Package `haskell-language-server' component haskell-language-server:test:func-test with main-is file: /home/sir4ur0n/code/haskell-language-server/test/functional/Main.hs
> ghcide                 > configure (lib + exe)
> ghcide                 > Configuring ghcide-0.1.0...
> ghcide                 > build (lib + exe)
> ghcide                 > Preprocessing executable 'ghcide-test-preprocessor' for ghcide-0.1.0..
> ghcide                 > Building executable 'ghcide-test-preprocessor' for ghcide-0.1.0..
> ghcide                 > Preprocessing library for ghcide-0.1.0..
> ghcide                 > Building library for ghcide-0.1.0..
> ghcide                 > Preprocessing executable 'ghcide' for ghcide-0.1.0..
> ghcide                 > Building executable 'ghcide' for ghcide-0.1.0..
> ghcide                 > [3 of 4] Compiling Paths_ghcide
> ghcide                 > [4 of 4] Compiling Main [TH]
> ghcide                 >
> ghcide                 > /home/sir4ur0n/code/haskell-language-server/ghcide/exe/Main.hs:56:1: warning: [-Wunused-imports]
> ghcide                 >     The import of ‘Development.GitRev’ is redundant
> ghcide                 >       except perhaps to import instances from ‘Development.GitRev’
> ghcide                 >     To import instances alone, use: import Development.GitRev()
> ghcide                 >    |
> ghcide                 > 56 | import Development.GitRev
> ghcide                 >    | ^^^^^^^^^^^^^^^^^^^^^^^^^
> ghcide                 >
> ghcide                 > /home/sir4ur0n/code/haskell-language-server/ghcide/exe/Main.hs:57:1: warning: [-Wunused-imports]
> ghcide                 >     The import of ‘action’ from module ‘Development.Shake’ is redundant
> ghcide                 >    |
> ghcide                 > 57 | import Development.Shake (Action,  action)
> ghcide                 >    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> ghcide                 >
> ghcide                 > /home/sir4ur0n/code/haskell-language-server/ghcide/exe/Main.hs:83:1: warning: [-Wunused-imports]
> ghcide                 >     The import of ‘Debug.Trace’ is redundant
> ghcide                 >       except perhaps to import instances from ‘Debug.Trace’
> ghcide                 >     To import instances alone, use: import Debug.Trace()
> ghcide                 >    |
> ghcide                 > 83 | import Debug.Trace
> ghcide                 >    | ^^^^^^^^^^^^^^^^^^
> ghcide                 > Linking .stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/ghcide/ghcide ...
> ghcide                 > copy/register
> ghcide                 > Installing executable ghcide-test-preprocessor in /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/bin
> ghcide                 > Installing library in /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/lib/x86_64-linux-ghc-8.6.5/ghcide-0.1.0-BeX44vabl7jLy1E9mAxkI9
> ghcide                 > Installing executable ghcide in /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/bin
> ghcide                 > Registering library for ghcide-0.1.0..
> haskell-language-server> configure (lib + exe)
> Configuring haskell-language-server-0.1.0.0...
> haskell-language-server> initial-build-steps (lib + exe)
> Completed 2 action(s).
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: haskell-language-server
>
> Warning: Didn't find expected autogen file:
>          /home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/autogen/cabal_macros.h
> /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb:/home/sir4ur0n/.stack/snapshots/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb:/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/package.conf.d
Right (ComponentOptions {componentOptions = ["-i","-odir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hidir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hide-all-packages","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test","-i/home/sir4ur0n/code/haskell-language-server/test/utils","-i/home/sir4ur0n/code/haskell-language-server/test/functional","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/global-autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/func-test-tmp","-stubdir=/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build","-package-id=base-4.12.0.0","-package=haskell-language-server-0.1.0.0","-package-id=haskell-lsp-0.22.0.0-Dm3Y5tmF7yh4ECsA5etaU6","-package-id=hie-bios-0.5.0-FSBb2ut8sK4IXHsh2geoHJ","-package-id=aeson-1.4.6.0-4uBfdXbzscjDeNqrTRfhWo","-package-id=blaze-markup-0.8.2.3-ATcS0IRQcDMCxhB8vW9N1d","-package-id=containers-0.6.0.1","-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8","-package-id=directory-1.3.3.0","-package-id=filepath-1.4.2.1","-package-id=hslogger-1.2.12-EOh2s68fQfBFyuAt5sDs18","-package-id=hspec-2.7.1-28Bzukly5w86FpiwMyuAYC","-package-id=hspec-core-2.7.1-IbyPArxIL6526nHHCZLmW2","-package-id=lsp-test-0.10.3.0-8UmPD9MvFJRH3G2kYk9Unq","-package-id=stm-2.5.0.0","-package-id=tasty-hunit-0.10.0.2-FgUrIbgCsUcDDS8XJ0iyJm","-package-id=text-1.2.3.1","-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4","-package-id=yaml-0.11.2.0-8COcGy2e3i5ABQkqGF0U1e","-package-id=haskell-lsp-types-0.22.0.0-EqCdNjFLrl1H6FLGsAPz20","-package-id=hspec-expectations-0.8.2-xEhsaJyqHC4OUn6v2CIJJ","-package-id=lens-4.18-HbPjKqYp8F3CoEHux0jQ2","-package-id=tasty-1.2.3-GiudK7yenNPC8Gtev28Pwr","-package=tasty-ant-xml-1.1.6","-package=tasty-expected-failure-0.11.1.2","-package=tasty-rerun-1.1.17","-Wall","-Wredundant-constraints","-Wall","-Wno-name-shadowing","-rtsopts","-with-rtsopts=-N","-DAGPL","-DAGPL","-ghci-script=/tmp/haskell-stack-ghci/e65fba7d/ghci-script","-package-db","/home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/snapshots/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/package.conf.d"], componentRoot = "/home/sir4ur0n/code/haskell-language-server", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]})
haskell-language-server: <command line>: cannot satisfy -package haskell-language-server-0.1.0.0
    (use -v for more information)

Second run

Errors

  • Multi Cradle: No prefixes matched for /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
  • Multi Cradle: No prefixes matched for /home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs
  • haskell-language-server: <command line>: cannot satisfy -package haskell-language-server-0.1.0.0

Full logs

ghcide version: 0.1.0.0 (GHC: 8.6.5) (PATH: /home/sir4ur0n/.local/bin/haskell-language-server) (GIT hash: 2310e1039c90d9bccaffd688a0d1ec79a9360bf4)
(haskell-language-server)Ghcide setup tester in /home/sir4ur0n/code/haskell-language-server.
Report bugs at https://github.com/haskell/haskell-language-server/issues

Step 1/6: Finding files to test in /home/sir4ur0n/code/haskell-language-server
Found 201 files

Step 2/6: Looking for hie.yaml files that control setup
Found 2 cradles

Step 3/6: Initializing the IDE

Step 4/6: Type checking the files
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs"
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/utils/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
Hidden:   no
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/ghcide/src/Development/IDE/Core/OfInterest.hs"
File:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath:
  /home/sir4ur0n/code/haskell-language-server/test/testdata/cabal-helper/mono-repo/B/MyLib.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/utils/",Stack {component = Just "haskell-language-server:func-test"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
> fdLock: invalid argument (Invalid argument)
Left [CradleError (ExitFailure 1) ["Failed to parse result of calling cabal","","fdLock: invalid argument (Invalid argument)\n",""]]
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src/Development/IDE/Core/OfInterest.hs
Hidden:   no
Range:    1:0-100001:0
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs"
File:     /home/sir4ur0n/code/haskell-language-server/ghcide/src/Development/IDE/Core/OfInterest.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:  Failed to parse result of calling cabalfdLock: invalid argument (Invalid argument)
Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: /home/sir4ur0n/code/haskell-language-server","filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs","prefixes:","(\"./test/functional/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./test/utils/\",Stack {component = Just \"haskell-language-server:func-test\"})","(\"./exe/Main.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server\"})","(\"./exe/Wrapper.hs\",Stack {component = Just \"haskell-language-server:exe:haskell-language-server-wrapper\"})","(\"./src\",Stack {component = Just \"haskell-language-server:lib\"})","(\"./ghcide/src\",Stack {component = Just \"ghcide:lib:ghcide\"})","(\"./ghcide/exe\",Stack {component = Just \"ghcide:exe:ghcide\"})"]]
File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs
Hidden:   no
Range:    1:0-100001:0
Consulting the cradle for "/home/sir4ur0n/code/haskell-language-server/test/functional/Diagnostic.hs"
File:     /home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs
Hidden:   no
Range:    1:0-100001:0
Source:   compiler
Severity: DsError
Message:
  Multi Cradle: No prefixes matched
  pwd: /home/sir4ur0n/code/haskell-language-server
  filepath: /home/sir4ur0n/code/haskell-language-server/test/testdata/HaReRename.hs
  prefixes:
  ("./test/functional/",Stack {component = Just "haskell-language-server:func-test"})
  ("./test/utils/",Stack {component = Just "haskell-language-server:func-test"})
  ("./exe/Main.hs",Stack {component = Just "haskell-language-server:exe:haskell-language-server"})
  ("./exe/Wrapper.hs",Stack {component = Just
  "haskell-language-server:exe:haskell-language-server-wrapper"})
  ("./src",Stack {component = Just "haskell-language-server:lib"})
  ("./ghcide/src",Stack {component = Just "ghcide:lib:ghcide"})
  ("./ghcide/exe",Stack {component = Just "ghcide:exe:ghcide"})
> Using main module: 1. Package `haskell-language-server' component haskell-language-server:test:func-test with main-is file: /home/sir4ur0n/code/haskell-language-server/test/functional/Main.hs
> haskell-language-server> configure (lib + exe)
> Configuring haskell-language-server-0.1.0.0...
> haskell-language-server> initial-build-steps (lib + exe)
> The following GHC options are incompatible with GHCi and have not been passed to it: -threaded
> Configuring GHCi with the following packages: haskell-language-server
>
> Warning: Didn't find expected autogen file:
>          /home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/autogen/cabal_macros.h
> /home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb:/home/sir4ur0n/.stack/snapshots/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb:/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/package.conf.d
Right (ComponentOptions {componentOptions = ["-i","-odir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hidir=/home/sir4ur0n/code/haskell-language-server/.stack-work/odir","-hide-all-packages","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test","-i/home/sir4ur0n/code/haskell-language-server/test/utils","-i/home/sir4ur0n/code/haskell-language-server/test/functional","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/global-autogen","-i/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build/func-test/func-test-tmp","-stubdir=/home/sir4ur0n/code/haskell-language-server/.stack-work/dist/x86_64-linux-tinfo6/Cabal-2.4.0.1/build","-package-id=base-4.12.0.0","-package=haskell-language-server-0.1.0.0","-package-id=haskell-lsp-0.22.0.0-Dm3Y5tmF7yh4ECsA5etaU6","-package-id=hie-bios-0.5.0-FSBb2ut8sK4IXHsh2geoHJ","-package-id=aeson-1.4.6.0-4uBfdXbzscjDeNqrTRfhWo","-package-id=blaze-markup-0.8.2.3-ATcS0IRQcDMCxhB8vW9N1d","-package-id=containers-0.6.0.1","-package-id=data-default-0.7.1.1-COovZVyOTYqEavTGLlfqy8","-package-id=directory-1.3.3.0","-package-id=filepath-1.4.2.1","-package-id=hslogger-1.2.12-EOh2s68fQfBFyuAt5sDs18","-package-id=hspec-2.7.1-28Bzukly5w86FpiwMyuAYC","-package-id=hspec-core-2.7.1-IbyPArxIL6526nHHCZLmW2","-package-id=lsp-test-0.10.3.0-8UmPD9MvFJRH3G2kYk9Unq","-package-id=stm-2.5.0.0","-package-id=tasty-hunit-0.10.0.2-FgUrIbgCsUcDDS8XJ0iyJm","-package-id=text-1.2.3.1","-package-id=unordered-containers-0.2.10.0-LgoTL3wbBEY5bZIDJiyxW4","-package-id=yaml-0.11.2.0-8COcGy2e3i5ABQkqGF0U1e","-package-id=haskell-lsp-types-0.22.0.0-EqCdNjFLrl1H6FLGsAPz20","-package-id=hspec-expectations-0.8.2-xEhsaJyqHC4OUn6v2CIJJ","-package-id=lens-4.18-HbPjKqYp8F3CoEHux0jQ2","-package-id=tasty-1.2.3-GiudK7yenNPC8Gtev28Pwr","-package=tasty-ant-xml-1.1.6","-package=tasty-expected-failure-0.11.1.2","-package=tasty-rerun-1.1.17","-Wall","-Wredundant-constraints","-Wall","-Wno-name-shadowing","-rtsopts","-with-rtsopts=-N","-DAGPL","-DAGPL","-ghci-script=/tmp/haskell-stack-ghci/e65fba7d/ghci-script","-package-db","/home/sir4ur0n/code/haskell-language-server/.stack-work/install/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/snapshots/x86_64-linux-tinfo6/ad782cb2674a8c9bca215819570aaed13a825613b404f3308cb64df7b909b5f5/8.6.5/pkgdb","-package-db","/home/sir4ur0n/.stack/programs/x86_64-linux/ghc-tinfo6-8.6.5/lib/ghc-8.6.5/package.conf.d"], componentRoot = "/home/sir4ur0n/code/haskell-language-server", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]})
haskell-language-server: <command line>: cannot satisfy -package haskell-language-server-0.1.0.0
    (use -v for more information)

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 4, 2020

Note: It seems to work in an IDE (VS Code) outside of the install folder, but even in VS Code I get the multi-cradle error for Path_...

@jneira
Copy link
Member

jneira commented Jun 4, 2020

  • It is somewhat expected that some files cant be loaded, like all under testdata, Setup.hs and others; we can avoid it adding a none cradle for that path
  • The error about Paths_project.hs comes from ghcide and it is reported here. The workaround for now is add:
path: .stack-work/
component: myproject:lib

in the hie.yaml (i would add it to the hie.yaml.stacktemplate)

  • fdLock: invalid argument (Invalid argument): i've not seen it before, seems to be a warning though

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 4, 2020

As for the fdLock invalid argument, this seems to be tied to WSL 1 + Cabal, as per haskell/cabal#6551

I guess we can ignore it, as WSL 2 is to be released soon?

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 4, 2020

FYI I'm testing a multi-cradle syntax in hie.yaml. If it works fine, I'll open a PR to update the templates.

I think we should reopen this issue (I can't)

@jneira jneira reopened this Jun 4, 2020
sir4ur0n pushed a commit to sir4ur0n/haskell-language-server that referenced this issue Jun 4, 2020
sir4ur0n pushed a commit to sir4ur0n/haskell-language-server that referenced this issue Jun 4, 2020
@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 4, 2020

Besides the PR I just opened, I still need to run stack test in order to have a working HLS. Otherwise I still get haskell-language-server: <command line>: cannot satisfy -package haskell-language-server-0.1.0.0 and hovering remains stuck on Loading....

So there is another issue to fix.

Once I run stack test (or just stack build but then HLS doesn't work for test components) it works much better.

Note, I still get 3 errors in 2 test/functional modules, which seem related to the parser breaking on -- $ chain of characters. I will open another issue to track this.

/home/sir4ur0n/code/haskell-language-server/test/functional/Deferred.hs:162:9: error:
    parse error on input ‘-- $ runSession hieCommand fullCaps "test/testdata" $ do’parser

@jneira
Copy link
Member

jneira commented Jun 5, 2020

Besides the PR I just opened, I still need to run stack test in order to have a working HLS. Otherwise I still get haskell-language-server: : cannot satisfy -package haskell-language-server-0.1.0.0 and hovering remains stuck on Loading....

This one is related with haskell/haskell-ide-engine#1564 and tracked upstream in commercialhaskell/stack#5213. It even has an ongoing pr

If you want to open test modules you could do a stack build --test --no-run.tests if you dont want to run them or activate tests by default adding tests: true to stack.yaml

Many thanks to create pr's and specific issues to tacke this.

@sir4ur0n
Copy link
Collaborator Author

sir4ur0n commented Jun 5, 2020

Hi @jneira , I just pushed a second commit to #147 + added comments explaining the content.

I think it solves the last bits of this issue. As you will see, I added documentation in the README to explain the current shortcomings (like running stack build ...).

Hope we're getting close! 😄

Thanks for your help and patience

jneira pushed a commit to jneira/haskell-language-server that referenced this issue Jun 12, 2020
jneira pushed a commit to jneira/haskell-language-server that referenced this issue Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can-workaround CI Continuous integration type: bug Something isn't right: doesn't work as intended, documentation is missing/outdated, etc..
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants