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

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

Closed
jneira opened this issue May 25, 2020 · 5 comments

Comments

@jneira
Copy link
Collaborator

jneira commented May 25, 2020

  • Opening hls (./exe/Main.hs) with a corrected stack based hie.yaml
  • With the cabal based hie.yaml, it works
  • Message
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"
> �[0mUsing 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�[0m
> �[0mghcide-0.1.0: unregistering (local file changes: ghcide.cabal src\Development\IDE\Core\FileStore.hs src\Development\IDE\Core\Rules.hs src\Developm...)�[0m
> �[0mghcide                 > configure (lib + exe)�[0m
> �[0mghcide                 > Configuring ghcide-0.1.0...�[0m
> �[0mghcide                 > build (lib + exe)�[0m
> �[0mghcide                 > Preprocessing executable 'ghcide-test-preprocessor' for ghcide-0.1.0..�[0m
> �[0mghcide                 > Building executable 'ghcide-test-preprocessor' for ghcide-0.1.0..�[0m
> �[0mghcide                 > Preprocessing library for ghcide-0.1.0..�[0m
> �[0mghcide                 > Building library for ghcide-0.1.0..�[0m
> �[0mghcide                 > [27 of 48] Compiling Development.IDE.Import.FindImports�[0m
> �[0mghcide                 > [28 of 48] Compiling Development.IDE.Import.DependencyInformation [Development.IDE.Import.FindImports changed]�[0m
> �[0mghcide                 > [29 of 48] Compiling Development.IDE.Core.RuleTypes [Development.IDE.Import.DependencyInformation changed]�[0m
> �[0mghcide                 > [30 of 48] Compiling Development.IDE.Core.Shake�[0m
> �[0mghcide                 > [31 of 48] Compiling Development.IDE.Core.OfInterest [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > [32 of 48] Compiling Development.IDE.Core.IdeConfiguration [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > [33 of 48] Compiling Development.IDE.Core.FileStore�[0m
> �[0mghcide                 > [34 of 48] Compiling Development.IDE.Core.FileExists [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > [35 of 48] Compiling Development.IDE.Core.Service [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > [37 of 48] Compiling Development.IDE.LSP.Notifications�[0m
> �[0mghcide                 > [38 of 48] Compiling Development.IDE.Core.Compile [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > �[0m
> �[0mghcide                 > �[;1msrc\Development\IDE\Core\Compile.hs:64:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `NameCache' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `NameCache'�[0m
> �[0mghcide                 >     To import instances alone, use: import NameCache()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m64 |�[0m�[0m �[;1m�[35mimport           NameCache�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > [41 of 48] Compiling Development.IDE.Core.Rules�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1msrc\Development\IDE\Core\Rules.hs:35:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `Data.Bifunctor' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `Data.Bifunctor'�[0m
> �[0mghcide                 >     To import instances alone, use: import Data.Bifunctor()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m35 |�[0m�[0m �[;1m�[35mimport Data.Bifunctor (second)�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1msrc\Development\IDE\Core\Rules.hs:37:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `Control.Applicative' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `Control.Applicative'�[0m
> �[0mghcide                 >     To import instances alone, use: import Control.Applicative()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m37 |�[0m�[0m �[;1m�[35mimport Control.Applicative�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1msrc\Development\IDE\Core\Rules.hs:54:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The qualified import of `Development.IDE.Types.Logger' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `Development.IDE.Types.Logger'�[0m
> �[0mghcide                 >     To import instances alone, use: import Development.IDE.Types.Logger()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m54 |�[0m�[0m �[;1m�[35mimport qualified Development.IDE.Types.Logger as L�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > [42 of 48] Compiling Development.IDE.Plugin.CodeAction.Rules [Development.IDE.Core.Rules changed]�[0m
> �[0mghcide                 > [43 of 48] Compiling Development.IDE.Plugin [Development.IDE.Core.Rules changed]�[0m
> �[0mghcide                 > [44 of 48] Compiling Development.IDE.Plugin.Completions [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > [45 of 48] Compiling Development.IDE.Plugin.CodeAction [Development.IDE.Core.Rules changed]�[0m
> �[0mghcide                 > [46 of 48] Compiling Development.IDE.LSP.Outline [Development.IDE.Core.Rules changed]�[0m
> �[0mghcide                 > [47 of 48] Compiling Development.IDE.LSP.HoverDefinition [Development.IDE.Core.Rules changed]�[0m
> �[0mghcide                 > [48 of 48] Compiling Development.IDE.LSP.LanguageServer [Development.IDE.Core.Shake changed]�[0m
> �[0mghcide                 > Preprocessing executable 'ghcide' for ghcide-0.1.0..�[0m
> �[0mghcide                 > Building executable 'ghcide' for ghcide-0.1.0..�[0m
> �[0mghcide                 > [4 of 4] Compiling Main [Development.IDE.Core.FileStore changed]�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1mexe\Main.hs:56:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `Development.GitRev' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `Development.GitRev'�[0m
> �[0mghcide                 >     To import instances alone, use: import Development.GitRev()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m56 |�[0m�[0m �[;1m�[35mimport Development.GitRev�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1mexe\Main.hs:57:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `action' from module `Development.Shake' is redundant�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m57 |�[0m�[0m �[;1m�[35mimport Development.Shake (Action,  action)�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > �[;1mexe\Main.hs:83:1: �[;1m�[35mwarning:�[0m�[0m�[;1m [�[;1m�[35m-Wunused-imports�[0m�[0m�[;1m]�[0m�[0m�[;1m�[0m
> �[0mghcide                 >     The import of `Debug.Trace' is redundant�[0m
> �[0mghcide                 >       except perhaps to import instances from `Debug.Trace'�[0m
> �[0mghcide                 >     To import instances alone, use: import Debug.Trace()�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m83 |�[0m�[0m �[;1m�[35mimport Debug.Trace�[0m�[0m�[0m
> �[0mghcide                 > �[;1m�[34m   |�[0m�[0m�[;1m�[35m ^^^^^^^^^^^^^^^^^^�[0m�[0m�[0m
> �[0mghcide                 > Linking .stack-work\dist\e626a42b\build\ghcide\ghcide.exe ...�[0m
> �[0mghcide                 > �[0m�[0m�[0m�[0m
> �[0mghcide                 > copy/register�[0m
> �[0mghcide                 > Installing executable ghcide-test-preprocessor in D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\bin�[0m
> �[0mghcide                 > 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�[0m
> �[0mghcide                 > Installing executable ghcide in D:\dev\ws\haskell\hls\.stack-work\install\15d153f3\bin�[0m
> �[0mghcide                 > Registering library for ghcide-0.1.0..�[0m
> �[0mhaskell-language-server> configure (lib + internal-lib + exe)�[0m
> �[0mConfiguring haskell-language-server-0.1.0.0...�[0m
> �[0mhaskell-language-server> initial-build-steps (lib + internal-lib + exe)�[0m
> �[0mCompleted 2 action(s).�[0m
> �[0mThe following GHC options are incompatible with GHCi and have not been passed to it: -threaded�[0m
> �[0mConfiguring GHCi with the following packages: haskell-language-server�[0m
> 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
Copy link

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

@jneira
Copy link
Collaborator Author

jneira commented May 26, 2020

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"

@jneira jneira changed the title Error using stack explicit cradle: Error using stack explicit cradle: No prefixes matched for Paths_haskell_language_server.hs May 26, 2020
@ilyakooo0
Copy link

I am getting the same error on this commit: 5e4e878

The project I am getting this on is the idris-lang/Idris-dev@0705643 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
Copy link
Collaborator Author

jneira commented May 28, 2020

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
Copy link
Collaborator Author

jneira commented Sep 24, 2020

already in hls/ghcide

@jneira jneira closed this as completed Sep 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants