mpickering / ghcide

A library for building Haskell IDE tooling
Apache License 2.0
4 stars 2 forks source link

Error using stack explicit cradle: No prefixes matched for Paths_haskell_language_server.hs #50

Closed jneira closed 4 years ago

jneira commented 4 years ago
Multi Cradle: No prefixes matched
pwd: D:\dev\ws\haskell\hls
filepath: D:\dev\ws\haskell\hls\.stack-work\dist\e626a42b\build\haskell-language-server\autogen\Paths_haskell_language_server.hs
prefixes:
("./test/functional/",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"})
Log ``` [client] run command = "ghcide --lsp" [client] debug command = "ghcide --lsp" ghcide version: 0.1.0 (GHC: 8.8.3) (PATH: D:\bin\ghcide.exe) (GIT hash: ) Starting LSP server... If you are seeing this in a terminal, you probably should have run ghcide WITHOUT the --lsp option! Started LSP server in 0.01s [INFO] Opened text document: file:///d%3A/dev/ws/haskell/hls/exe/Main.hs Consulting the cradle for "D:\\dev\\ws\\haskell\\hls\\exe\\Main.hs" > Using main module: 1. Package `haskell-language-server' component haskell-language-server:exe:haskell-language-server with main-is file: D:\dev\ws\haskell\hls\exe\Main.hs > ghcide-0.1.0: unregistering (local file changes: ghcide.cabal src\Development\IDE\Core\FileStore.hs src\Development\IDE\Core\Rules.hs src\Developm...) > 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 > [27 of 48] Compiling Development.IDE.Import.FindImports > ghcide > [28 of 48] Compiling Development.IDE.Import.DependencyInformation [Development.IDE.Import.FindImports changed] > ghcide > [29 of 48] Compiling Development.IDE.Core.RuleTypes [Development.IDE.Import.DependencyInformation changed] > ghcide > [30 of 48] Compiling Development.IDE.Core.Shake > ghcide > [31 of 48] Compiling Development.IDE.Core.OfInterest [Development.IDE.Core.Shake changed] > ghcide > [32 of 48] Compiling Development.IDE.Core.IdeConfiguration [Development.IDE.Core.Shake changed] > ghcide > [33 of 48] Compiling Development.IDE.Core.FileStore > ghcide > [34 of 48] Compiling Development.IDE.Core.FileExists [Development.IDE.Core.Shake changed] > ghcide > [35 of 48] Compiling Development.IDE.Core.Service [Development.IDE.Core.Shake changed] > ghcide > [37 of 48] Compiling Development.IDE.LSP.Notifications > ghcide > [38 of 48] Compiling Development.IDE.Core.Compile [Development.IDE.Core.Shake changed] > ghcide >  > ghcide > src\Development\IDE\Core\Compile.hs:64:1: warning: [-Wunused-imports] > ghcide > The import of `NameCache' is redundant > ghcide > except perhaps to import instances from `NameCache' > ghcide > To import instances alone, use: import NameCache() > ghcide >  | > ghcide > 64 | import NameCache > ghcide >  | ^^^^^^^^^^^^^^^^^^^^^^^^^^ > ghcide > [41 of 48] Compiling Development.IDE.Core.Rules > ghcide >  > ghcide > src\Development\IDE\Core\Rules.hs:35:1: warning: [-Wunused-imports] > ghcide > The import of `Data.Bifunctor' is redundant > ghcide > except perhaps to import instances from `Data.Bifunctor' > ghcide > To import instances alone, use: import Data.Bifunctor() > ghcide >  | > ghcide > 35 | import Data.Bifunctor (second) > ghcide >  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ghcide >  > ghcide > src\Development\IDE\Core\Rules.hs:37:1: warning: [-Wunused-imports] > ghcide > The import of `Control.Applicative' is redundant > ghcide > except perhaps to import instances from `Control.Applicative' > ghcide > To import instances alone, use: import Control.Applicative() > ghcide >  | > ghcide > 37 | import Control.Applicative > ghcide >  | ^^^^^^^^^^^^^^^^^^^^^^^^^^ > ghcide >  > ghcide > src\Development\IDE\Core\Rules.hs:54:1: warning: [-Wunused-imports] > ghcide > The qualified import of `Development.IDE.Types.Logger' is redundant > ghcide > except perhaps to import instances from `Development.IDE.Types.Logger' > ghcide > To import instances alone, use: import Development.IDE.Types.Logger() > ghcide >  | > ghcide > 54 | import qualified Development.IDE.Types.Logger as L > ghcide >  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ > ghcide > [42 of 48] Compiling Development.IDE.Plugin.CodeAction.Rules [Development.IDE.Core.Rules changed] > ghcide > [43 of 48] Compiling Development.IDE.Plugin [Development.IDE.Core.Rules changed] > ghcide > [44 of 48] Compiling Development.IDE.Plugin.Completions [Development.IDE.Core.Shake changed] > ghcide > [45 of 48] Compiling Development.IDE.Plugin.CodeAction [Development.IDE.Core.Rules changed] > ghcide > [46 of 48] Compiling Development.IDE.LSP.Outline [Development.IDE.Core.Rules changed] > ghcide > [47 of 48] Compiling Development.IDE.LSP.HoverDefinition [Development.IDE.Core.Rules changed] > ghcide > [48 of 48] Compiling Development.IDE.LSP.LanguageServer [Development.IDE.Core.Shake changed] > ghcide > Preprocessing executable 'ghcide' for ghcide-0.1.0.. > ghcide > Building executable 'ghcide' for ghcide-0.1.0.. > ghcide > [4 of 4] Compiling Main [Development.IDE.Core.FileStore changed] > ghcide >  > 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 > 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 > 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\e626a42b\build\ghcide\ghcide.exe ... > ghcide >  > ghcide > copy/register > ghcide > Installing executable ghcide-test-preprocessor in D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\bin > ghcide > Installing library in D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\lib\x86_64-windows-ghc-8.6.5\ghcide-0.1.0-KhREzo7jDNU4tRViaOnMFo > ghcide > Installing executable ghcide in D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\bin > ghcide > Registering library for ghcide-0.1.0.. > 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) > 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 > D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\pkgdb;C:\sr\snapshots\5abeca39\pkgdb;D:\bin\stack\x86_64-windows\ghc-8.6.5\lib\package.conf.d Right (ComponentOptions {componentOptions = ["-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-id=haskell-language-server-0.1.0.0-6JSj9p8L1gBAnseU8jhOh9-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-id=haskell-language-server-0.1.0.0-ICCqwzjKs3aCsXolUe8wdE","-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"], componentRoot = "D:\\dev\\ws\\haskell\\hls", componentDependencies = ["haskell-language-server.cabal","package.yaml","stack.yaml"]}) "Making new HscEnv[main]" Error while checking GHC version: "D:\\\\bin\\\\stack\\\\x86_64-windows\\\\ghc-8.8.3\\\\lib\\bin\\ghc: readCreateProcess: does not exist (No such file or directory)" (([],Just HscEnvEq 4),fromList [("haskell-language-server.cabal",Just 2020-05-25 05:45:02.6526252 UTC),("package.yaml",Nothing),("stack.yaml",Just 2020-05-25 05:45:03.0206265 UTC)]) Consulting the cradle for "D:\\dev\\ws\\haskell\\hls\\.stack-work\\dist\\e626a42b\\build\\haskell-language-server\\autogen\\Paths_haskell_language_server.hs" Left [CradleError ExitSuccess ["Multi Cradle: No prefixes matched","pwd: D:\\dev\\ws\\haskell\\hls","filepath: D:\\dev\\ws\\haskell\\hls\\.stack-work\\dist\\e626a42b\\build\\haskell-language-server\\autogen\\Paths_haskell_language_server.hs","prefixes:","(\"./test/functional/\",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\"})"]] [INFO] finish: FileStoreTC (took 4m08s) [INFO] finish: CodeAction (took 0.01s) [INFO] finish: InitialLoad (took 0.01s) [INFO] finish: InitialLoad (took 0.31s) [INFO] finish: CodeAction:PackageExports (took 1.30s) [INFO] Hover request at position 472:8 in file: d:\dev\ws\haskell\hls\exe\Main.hs ```
Avi-D-coder commented 4 years ago

Can you post the hie.yaml? Is it the stack one from hls repo?

jneira commented 4 years ago

It is the one printed in the error message as prefixes, from the repo with haskell-language-server:tasty removed, cause it does not exist:

# This is a sample hie.yaml file for opening haskell-language-server
# in hie, using stack as the build system.  To use is, copy it to a
# file called 'hie.yaml'
cradle:
  stack:
    - path: "./test/functional/"
      component: "haskell-language-server:func-test"

    # This target does not currently work (stack 2.1.3)
    # - path: "./test/utils"
    #   component: "haskell-language-server:lib:hls-test-utils"

    - path: "./exe/Main.hs"
      component: "haskell-language-server:exe:haskell-language-server"

    - path: "./exe/Wrapper.hs"
      component: "haskell-language-server:exe:haskell-language-server-wrapper"

    - path: "./src"
      component: "haskell-language-server:lib"

    - path: "./ghcide/src"
      component: "ghcide:lib:ghcide"

    - path: "./ghcide/exe"
      component: "ghcide:exe:ghcide"
ilyakooo0 commented 4 years ago

I am getting the same error on this commit: https://github.com/mpickering/ghcide/commit/5e4e87822e6905465fce32258375baefc249ed1e

The project I am getting this on is the https://github.com/idris-lang/Idris-dev/commit/07056439160e8be6425b1cc7049b0f3d4a38bdce commit of the Idris 1 compiler.

This is the hie.yaml I am using.

cradle:
  stack:
    # - path: "././"
    #   component: "idris:bench:s/*.pl"

    - path: "./src"
      component: "idris:lib"

    - path: "./main/Main.hs"
      component: "idris:exe:idris"

    - path: "./test"
      component: "idris:test:regression-and-feature-tests"

    - path: "./codegen/idris-codegen-c/Main.hs"
      component: "idris:exe:idris-codegen-c"

    - path: "./codegen/idris-codegen-javascript/Main.hs"
      component: "idris:exe:idris-codegen-javascript"

    - path: "./codegen/idris-codegen-node/Main.hs"
      component: "idris:exe:idris-codegen-node"

I was using the commit from wip/multi-rebase branch from around a week ago and I wasn't encountering any issues.

jneira commented 4 years ago

I've got the same error with a cabal explicit cradle, in hls. I did not get at first, even opening andseveral files but when i opened .exe/Arguments.hs (i cant reproduce it again so maybe it is indefferent):

Multi Cradle: No prefixes matched
pwd: D:\dev\ws\haskell\hls
filepath: D:\dev\ws\haskell\hls\dist-newstyle\build\x86_64-windows\ghc-8.8.3\haskell-language-server-0.1.0.0\t\func-test\build\func-test\autogen\Paths_haskell_language_server.hs
prefixes:
("./test/functional/",Cabal {component = Just "haskell-language-server:func-test"})
("./test/utils/",Cabal {component = Just "haskell-language-server:func-test"})
("./exe/Main.hs",Cabal {component = Just "haskell-language-server:exe:haskell-language-server"})
("./exe/Wrapper.hs",Cabal {component = Just "haskell-language-server:exe:haskell-language-server-wrapper"})
("./src",Cabal {component = Just "lib:haskell-language-server"})
("./ghcide/src",Cabal {component = Just "ghcide:lib:ghcide"})
("./ghcide/exe",Cabal {component = Just "ghcide:exe:ghcide"})
jneira commented 4 years ago

already in hls/ghcide