haskell / haskell-ide-engine

The engine for haskell ide-integration. Not an IDE
BSD 3-Clause "New" or "Revised" License
2.38k stars 210 forks source link

HIE doesn't work after build. "haskell-lsp: Failed to parse message header" error #1499

Open mingcenwei opened 4 years ago

mingcenwei commented 4 years ago

I attempted to build HIE with stack from source on my macOS Catalina. The executables were successfully installed to ~/.local/bin. However, whenever I run hie (or hie-wrapper), the program will block after displaying the line 2019-12-XX XX:XX:XX.XXXXXX [ThreadId 4] - args:[]. Then if I press any key, the program will crash (and print hie-wrapper: callProcess: /Users/say/.local/bin/hie-8.6.5 (exit 1): failed if I use hie-wrapper rather than hie). If I add the flags --lsp --debug, the program will block after displaying the line haskell-lsp:Starting up server ..., and crash if I press any key and print the message:

2019-12-26 01:28:33.947057 [ThreadId 4] -
haskell-lsp: Failed to parse message header:
: string
 exiting 1 ...

image (^ The program gets stuck.)

image (^ It crashes if I press any key.)

The Haskell Language Server extension on Visual Studio Code doesn't work, either. It's continually emitting the following error messages: image

The following are the last few lines written to the standard output after I run stack repl haskell-ide-engine in the build directory: image

Environment:

$> which hie /Users/say/.local/bin/hie

$> ll /Users/say/.local/bin total 748968 -rwxr-xr-x 1 say staff 118M Dec 25 23:27 hie -rwxr-xr-x 1 say staff 118M Dec 25 23:27 hie-8.6 -rwxr-xr-x 1 say staff 118M Dec 25 23:27 hie-8.6.5 -rwxr-xr-x 1 say staff 12M Dec 25 23:27 hie-wrapper

- Compiler:
``` shell
$> cc --version
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$> gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.33.16)
Target: x86_64-apple-darwin19.2.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$> ls ~/.stack/programs/x86_64-osx/ ghc-8.4.2 ghc-8.4.3 ghc-8.4.4 ghc-8.6.1 ghc-8.6.2 ghc-8.6.3 ghc-8.6.4 ghc-8.6.5 ghc-8.4.2.installed ghc-8.4.3.installed ghc-8.4.4.installed ghc-8.6.1.installed ghc-8.6.2.installed ghc-8.6.3.installed ghc-8.6.4.installed ghc-8.6.5.installed ghc-8.4.2.tar.bz2 ghc-8.4.3.tar.bz2 ghc-8.4.4.tar.bz2 ghc-8.6.1.tar.bz2 ghc-8.6.2.tar.bz2 ghc-8.6.3.tar.bz2 ghc-8.6.4.tar.bz2

fendor commented 4 years ago

Thank you for the detailed bug report! I think you are running into multiple issues here. First, hie communicates with the lsp-client via stdin. So, if you enter anything, hie expects it to be a well-formed lsp message, which it is not, therefore not a bug. Another issue is that it seems currently impossible to use stack repl in haskell-ide-engine itself, which crashes hie and produces this weird error message: cannot satisfay -package z-haskell-ide-engine-z-test-utils. Currently, it is easier to work on hie with cabal. On which project did you execute hie? E.g. in which project did vscode emit the error messages? And which files did you open? I think you are also running into #1495, meaning that hie implicitly tries to use ghc 8.8.1 for which we have no support. The current effort to fix #1495 is in #1496.

EDIT: One last thing, does the project build with just stack build?

alanz commented 4 years ago

Also, make sure you are using current master, for a while we had a version that errored if it received the --lsp command line flag, which has been required up to now. Current master accepts it, as a nop, for backward compatibility.

mingcenwei commented 4 years ago

@fendor Thanks for your prompt explanation! I just created a sample project using the command stack new test. It uses the default template "new-template" of stack, which can be directly built with just stack build:

>$ tree test/
test/
├── ChangeLog.md
├── LICENSE
├── README.md
├── Setup.hs
├── app
│   └── Main.hs
├── package.yaml
├── src
│   └── Lib.hs
├── stack.yaml
├── test
│   └── Spec.hs
└── test.cabal

3 directories, 10 files

Precisely, the following script can reproduce my problem on my computer:

#!/usr/bin/env bash

cd $(mktemp -d)
stack new test
cd test
code .    # open this directory in VS Code

If I open any one of the files Setup.hs, Main.hs, Lib.hs, Spec.hs in VS Code, then after some time the error messages will appear.

mingcenwei commented 4 years ago

@alanz Yes, I'm using the current master. I git-cloned it and built it yesterday.

mingcenwei commented 4 years ago

This is the log file of the VS Code extension: vs-code-haskell-language-server-log-file.log

fendor commented 4 years ago

Opening Setup.hs will not work because that is a special file that is executed by Cabal. But the others need to work as expected.

You are using the implicit cradle discovery mechanism, also called, cabal-helper. This mechanism has a bug: https://github.com/mpickering/haskell-ide-engine/issues/47. tldr: Initial build of project does not generate enough files and is this happens because of this long standing bug https://github.com/haskell/cabal/issues/2209 and our attempt to fix this is https://github.com/haskell/cabal/pull/6441. However, it is a bit more complex to fix and will take some time to get right. Work around: Initially build the project, e.g.

#!/usr/bin/env bash

cd $(mktemp -d)
stack new test
cd test
stack build # initial build
code .    # open this directory in VS Code

then open app/Main.hs. This fixes the problem from above for me, could you try it, too?

mingcenwei commented 4 years ago

@fendor Thank you! I have just tried the commands. However, the problem persists. image

EDIT: If I open app/Main.hs in VS Code, in a while the bottom of the window will show Initializing Stack project, and then it will disappear and the error message will appear ezgif-2-8f2f6e1d34be

image

fendor commented 4 years ago

Can you show the log? E.g. press 71482332-eac2b880-283c-11ea-8ede-800530482005 and then select "output" and the haskell-ide-engine tab. Maybe there is something the logs? If you are running into #1495, you need to put the appropriate ghc version on the path for now.

mingcenwei commented 4 years ago

I removed all the symlinks for GHC 8.8.1 from $PATH and substituted them with symlinks for GHC 8.6.5. However, the problem is still there. The following are the logs.

2019-12-27 00:56:24.699115 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 1.0.0.0, Git revision 2c51b612d4f584e7f543961cf2a231139df8930b (dirty) (3507 commits) x86_64 ghc-8.6.5
2019-12-27 00:56:24.700894 [ThreadId 4] - Current directory:/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:24.702199 [ThreadId 4] - Operating system:darwin
2019-12-27 00:56:24.715227 [ThreadId 4] - Cabal-Helper found these projects: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:24.718366 [ThreadId 4] - These projects have the build tools installed: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:24.721037 [ThreadId 4] - Cabal-Helper dirs: ["/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/File.hs"]
2019-12-27 00:56:29.772026 [ThreadId 4] - Cabal-Helper cradle package: Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = Unit {uUnitId = UnitId "test", uPackage = Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = ()}, uDistDir = DistDirLib "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1", uImpl = UnitImplStack} :| []}
2019-12-27 00:56:29.777893 [ThreadId 4] - Cabal-Helper normalisedPackageLocation: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:29.778846 [ThreadId 4] - Cradle directory:/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:29.780064 [ThreadId 4] - Using stack GHC version
2019-12-27 00:56:30.242482 [ThreadId 4] - Project GHC version:8.6.5
2019-12-27 00:56:30.243118 [ThreadId 4] - hie exe candidates :["hie-8.6.5","hie-8.6","hie"]
2019-12-27 00:56:30.244286 [ThreadId 4] - found hie exe at:/Users/say/.local/bin/hie-8.6.5
2019-12-27 00:56:30.244893 [ThreadId 4] - args:["-d","--vomit"]
2019-12-27 00:56:30.245538 [ThreadId 4] - launching ....

2019-12-27 00:56:30.448332 [ThreadId 4] - Run entered for HIE(hie-8.6.5) Version 1.0.0.0, Git revision 2c51b612d4f584e7f543961cf2a231139df8930b (dirty) (3507 commits) x86_64 ghc-8.6.5
2019-12-27 00:56:30.449115 [ThreadId 4] - Current directory:/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:30.449209 [ThreadId 4] - args:["-d","--vomit"]
2019-12-27 00:56:30.449396 [ThreadId 4] - Enabling verbose mode for hie-bios. This option currently doesn't do anything.
2019-12-27 00:56:30.449597 [ThreadId 4] - 

haskell-lsp:Starting up server ...
2019-12-27 00:56:30.450825 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":82159,"clientInfo":{"name":"vscode","version":"1.41.1"},"rootPath":"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","rootUri":"file:///private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges":true,"resourceOperations":["create","rename","delete"],"failureHandling":"textOnlyTransactional"},"didChangeConfiguration":{"dynamicRegistration":true},"didChangeWatchedFiles":{"dynamicRegistration":true},"symbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]}},"executeCommand":{"dynamicRegistration":true},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true,"tagSupport":{"valueSet":[1,2]}},"synchronization":{"dynamicRegistration":true,"willSave":true,"willSaveWaitUntil":true,"didSave":true},"completion":{"dynamicRegistration":true,"contextSupport":true,"completionItem":{"snippetSupport":true,"commitCharactersSupport":true,"documentationFormat":["markdown","plaintext"],"deprecatedSupport":true,"preselectSupport":true,"tagSupport":{"valueSet":[1]}},"completionItemKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25]}},"hover":{"dynamicRegistration":true,"contentFormat":["markdown","plaintext"]},"signatureHelp":{"dynamicRegistration":true,"signatureInformation":{"documentationFormat":["markdown","plaintext"],"parameterInformation":{"labelOffsetSupport":true}},"contextSupport":true},"definition":{"dynamicRegistration":true,"linkSupport":true},"references":{"dynamicRegistration":true},"documentHighlight":{"dynamicRegistration":true},"documentSymbol":{"dynamicRegistration":true,"symbolKind":{"valueSet":[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]},"hierarchicalDocumentSymbolSupport":true},"codeAction":{"dynamicRegistration":true,"isPreferredSupport":true,"codeActionLiteralSupport":{"codeActionKind":{"valueSet":["","quickfix","refactor","refactor.extract","refactor.inline","refactor.rewrite","source","source.organizeImports"]}}},"codeLens":{"dynamicRegistration":true},"formatting":{"dynamicRegistration":true},"rangeFormatting":{"dynamicRegistration":true},"onTypeFormatting":{"dynamicRegistration":true},"rename":{"dynamicRegistration":true,"prepareSupport":true},"documentLink":{"dynamicRegistration":true,"tooltipSupport":true},"typeDefinition":{"dynamicRegistration":true,"linkSupport":true},"implementation":{"dynamicRegistration":true,"linkSupport":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true},"declaration":{"dynamicRegistration":true,"linkSupport":true},"selectionRange":{"dynamicRegistration":true},"callHierarchy":{"dynamicRegistration":true}},"window":{"workDoneProgress":true}},"trace":"off","workspaceFolders":[{"uri":"file:///private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","name":"test"}]}}
2019-12-27 00:56:30.453372 [ThreadId 4] - haskell-lsp:initializeRequestHandler: setting current dir to project root:/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:30.515942 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:30.517658 [ThreadId 11] - ideDispatcher: top of loop
2019-12-27 00:56:30.519984 [ThreadId 5] - <--2--{"result":{"capabilities":{"typeDefinitionProvider":true,"foldingRangeProvider":false,"textDocumentSync":{"openClose":true,"change":2,"willSave":false,"willSaveWaitUntil":false,"save":{"includeText":false}},"workspace":{},"implementationProvider":true,"documentRangeFormattingProvider":true,"documentHighlightProvider":true,"executeCommandProvider":{"commands":["82312:applyrefact:applyOne","82312:applyrefact:applyAll","82312:generic:type","82312:hsimport:import","82312:package:add","82312:pragmas:addPragma"]},"renameProvider":false,"colorProvider":false,"definitionProvider":true,"hoverProvider":true,"codeActionProvider":true,"completionProvider":{"triggerCharacters":["."],"resolveProvider":true},"documentSymbolProvider":true,"documentFormattingProvider":true,"referencesProvider":true}},"jsonrpc":"2.0","id":0}
2019-12-27 00:56:30.520869 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"initialized","params":{}}
2019-12-27 00:56:30.522779 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"workspace/didChangeConfiguration","params":{"settings":{"languageServerHaskell":{"hlintOn":true,"maxNumberOfProblems":100,"diagnosticsOnChange":true,"liquidOn":false,"completionSnippetsOn":true,"formatOnImportOn":true,"formattingProvider":"brittany","hieExecutablePath":"","useCustomHieWrapper":true,"useCustomHieWrapperPath":"~/.local/bin/hie-wrapper","showTypeForSelection":{"onHover":true,"command":{"location":"dropdown"}},"trace":{"server":"verbose"},"logFile":"","enableHIE":true}}}}
2019-12-27 00:56:30.522989 [ThreadId 4] - ---> {"jsonrpc":"2.0","method":"textDocument/didOpen","params":{"textDocument":{"uri":"file:///private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs","languageId":"haskell","version":1,"text":"module Main where\n\nimport Lib\n\nmain :: IO ()\nmain = someFunc\n\n "}}}
2019-12-27 00:56:30.523824 [ThreadId 8] - ****** reactor: got message number:0
2019-12-27 00:56:30.52394 [ThreadId 8] - ****** reactor: processing Initialized Notification
2019-12-27 00:56:30.52826 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"type":4,"message":"Using hie version: Version 1.0.0.0, Git revision 2c51b612d4f584e7f543961cf2a231139df8930b (dirty) (3507 commits) x86_64 ghc-8.6.5"},"method":"window/logMessage"}
Using hie version: Version 1.0.0.0, Git revision 2c51b612d4f584e7f543961cf2a231139df8930b (dirty) (3507 commits) x86_64 ghc-8.6.5
2019-12-27 00:56:30.532267 [ThreadId 8] - Cabal-Helper found these projects: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:30.533095 [ThreadId 8] - These projects have the build tools installed: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:30.533238 [ThreadId 8] - Cabal-Helper dirs: ["/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/File.hs"]
2019-12-27 00:56:30.552371 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":1,"method":"textDocument/documentSymbol","params":{"textDocument":{"uri":"file:///private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs"}}}
2019-12-27 00:56:30.720406 [ThreadId 10] - ghcDispatcher: top of loop
2019-12-27 00:56:32.817743 [ThreadId 8] - Cabal-Helper cradle package: Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = Unit {uUnitId = UnitId "test", uPackage = Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = ()}, uDistDir = DistDirLib "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1", uImpl = UnitImplStack} :| []}
2019-12-27 00:56:32.818533 [ThreadId 8] - Cabal-Helper normalisedPackageLocation: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:32.818835 [ThreadId 8] - Using stack GHC version
2019-12-27 00:56:33.260105 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:33.260195 [ThreadId 8] - ****** reactor: got message number:1
2019-12-27 00:56:33.260238 [ThreadId 8] - reactor:didChangeConfiguration notification:NotificationMessage {_jsonrpc = "2.0", _method = WorkspaceDidChangeConfiguration, _params = DidChangeConfigurationParams {_settings = Object (fromList [("languageServerHaskell",Object (fromList [("useCustomHieWrapper",Bool True),("useCustomHieWrapperPath",String "~/.local/bin/hie-wrapper"),("logFile",String ""),("hlintOn",Bool True),("formatOnImportOn",Bool True),("hieExecutablePath",String ""),("enableHIE",Bool True),("liquidOn",Bool False),("showTypeForSelection",Object (fromList [("onHover",Bool True),("command",Object (fromList [("location",String "dropdown")]))])),("diagnosticsOnChange",Bool True),("completionSnippetsOn",Bool True),("maxNumberOfProblems",Number 100.0),("formattingProvider",String "brittany"),("trace",Object (fromList [("server",String "verbose")]))]))])}}
2019-12-27 00:56:33.260497 [ThreadId 8] - reactor:didChangeConfiguration diagsOn:True
2019-12-27 00:56:33.260575 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:33.260625 [ThreadId 8] - ****** reactor: got message number:2
2019-12-27 00:56:33.260658 [ThreadId 8] - ****** reactor: processing NotDidOpenTextDocument
2019-12-27 00:56:33.260698 [ThreadId 8] - requestDiagnostics: no diagFunc for:DiagnosticOnOpen
2019-12-27 00:56:33.260734 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:33.26076 [ThreadId 8] - ****** reactor: got message number:3
2019-12-27 00:56:33.260789 [ThreadId 8] - reactor:got Document symbol request:RequestMessage {_jsonrpc = "2.0", _id = IdInt 1, _method = TextDocumentDocumentSymbol, _params = DocumentSymbolParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs"}}, _workDoneToken = Nothing}}
2019-12-27 00:56:33.260838 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:33.260869 [ThreadId 10] - ghcDispatcher:got request 0 with id: Nothing
2019-12-27 00:56:33.260983 [ThreadId 10] - ghcDispatcher: top of loop
2019-12-27 00:56:33.261022 [ThreadId 10] - ghcDispatcher:got request 2 with id: Nothing
2019-12-27 00:56:33.261053 [ThreadId 10] - ghcDispatcher:Processing request as version matches
2019-12-27 00:56:33.261272 [ThreadId 10] - New cradle: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs
2019-12-27 00:56:33.265286 [ThreadId 10] - Cabal-Helper found these projects: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:33.265407 [ThreadId 11] - ideDispatcher: got request 3 with id: IdInt 1
2019-12-27 00:56:33.265965 [ThreadId 10] - These projects have the build tools installed: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:33.266046 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"type":4,"message":"Using hoogle db at: /Users/say/.hoogle/default-haskell-5.0.17.hoo"},"method":"window/logMessage"}
2019-12-27 00:56:33.266326 [ThreadId 11] - ideDispatcher: top of loop
2019-12-27 00:56:33.266396 [ThreadId 10] - Cabal-Helper dirs: ["/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs"]
Using hoogle db at: /Users/say/.hoogle/default-haskell-5.0.17.hoo
2019-12-27 00:56:35.224854 [ThreadId 10] - Cabal-Helper cradle package: Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = Unit {uUnitId = UnitId "test", uPackage = Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = ()}, uDistDir = DistDirLib "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1", uImpl = UnitImplStack} :| []}
2019-12-27 00:56:35.225225 [ThreadId 10] - Cabal-Helper normalisedPackageLocation: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:35.225298 [ThreadId 10] - Found cradle: Cradle {cradleRootDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", cradleOptsProg = CradleAction: Cabal-Helper-Stack}
2019-12-27 00:56:35.225405 [ThreadId 57] - Relative Module FilePath: app/Main.hs
2019-12-27 00:56:35.228765 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"token":0},"method":"window/workDoneProgress/create","id":0}
2019-12-27 00:56:35.22893 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"begin","cancellable":false,"title":"Initializing Stack project","percentage":0},"token":0},"method":"$/progress"}
2019-12-27 00:56:35.229772 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":0,"result":null}
2019-12-27 00:56:35.229867 [ThreadId 4] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":0,\"result\":null}"
2019-12-27 00:56:35.230109 [ThreadId 8] - ****** reactor: got message number:4
2019-12-27 00:56:35.230244 [ThreadId 8] - reactor:got RspFromClient:ResponseMessage {_jsonrpc = "2.0", _id = IdRspInt 0, _result = Just Null, _error = Nothing}
2019-12-27 00:56:35.230372 [ThreadId 8] - ****** reactor: top of loop
test> configure (lib + exe)
Configuring test-0.1.0.0...
2019-12-27 00:56:38.665587 [ThreadId 57] - Unit Info: UnitInfo {uiUnitId = UnitId "test", uiPackageId = ("test",Version {versionBranch = [0,1,0,0], versionTags = []}), uiComponents = fromList [(ChLibName ChMainLibName,ChComponentInfo {ciComponentName = ChLibName ChMainLibName, ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-isrc","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/cabal_macros.h","-this-unit-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-XHaskell2010"], ciSourceDirs = ["src"], ciEntrypoints = ChLibEntrypoint {chExposedModules = [ChModuleName {unChModuleName = "Lib"}], chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}], chSignatures = []}}),(ChExeName "test-exe",ChComponentInfo {ciComponentName = ChExeName "test-exe", ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N"], ciSourceDirs = ["app"], ciEntrypoints = ChExeEntrypoint {chMainIs = "Main.hs", chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}]}})], uiCompilerId = ("GHC",Version {versionBranch = [8,6,5], versionTags = []}), uiPackageFlags = [], uiConfigFlags = [], uiNonDefaultConfigFlags = [], uiModTimes = UnitModTimes {umtPkgYaml = Just ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/package.yaml",1577376104), umtCabalFile = ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal",1577376104), umtSetupConfig = Just ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config",1577379106)}}
2019-12-27 00:56:38.666057 [ThreadId 57] - Flags for "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs": ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N","app/Main.hs","Paths_test"]
2019-12-27 00:56:38.666174 [ThreadId 57] - Component Infos: ChComponentInfo {ciComponentName = ChExeName "test-exe", ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N"], ciSourceDirs = ["app"], ciEntrypoints = ChExeEntrypoint {chMainIs = "Main.hs", chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}]}}
2019-12-27 00:56:38.737951 [ThreadId 57] - Ghc error on cradle initialisation: "cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\n    (use -v for more information)"
2019-12-27 00:56:38.738126 [ThreadId 10] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "\"cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\\n    (use -v for more information)\"", ideInfo = Null} with mid: Nothing
2019-12-27 00:56:38.738281 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"end"},"token":0},"method":"$/progress"}
2019-12-27 00:56:38.738309 [ThreadId 10] - ghcDispatcher: top of loop
2019-12-27 00:56:38.738433 [ThreadId 10] - ghcDispatcher:got request 2 with id: Nothing
2019-12-27 00:56:38.738477 [ThreadId 10] - ghcDispatcher:Processing request as version matches
2019-12-27 00:56:38.739277 [ThreadId 10] - New cradle: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs
2019-12-27 00:56:38.775543 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"type":1,"message":"\"cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\\n    (use -v for more information)\""},"method":"window/showMessage"}
2019-12-27 00:56:38.776107 [ThreadId 10] - Cabal-Helper found these projects: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:38.776942 [ThreadId 10] - These projects have the build tools installed: ["ProjLocStackYaml {plStackYaml = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/stack.yaml\"}","ProjLocV2Dir {plProjectDirV2 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}","ProjLocV1Dir {plProjectDirV1 = \"/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test\"}"]
2019-12-27 00:56:38.777313 [ThreadId 10] - Cabal-Helper dirs: ["/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs"]
2019-12-27 00:56:40.899473 [ThreadId 10] - Cabal-Helper cradle package: Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = Unit {uUnitId = UnitId "test", uPackage = Package {pPackageName = "test", pSourceDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", pCabalFile = CabalFile "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal", pFlags = [], pUnits = ()}, uDistDir = DistDirLib "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1", uImpl = UnitImplStack} :| []}
2019-12-27 00:56:40.899861 [ThreadId 10] - Cabal-Helper normalisedPackageLocation: /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test
2019-12-27 00:56:40.899923 [ThreadId 10] - Found cradle: Cradle {cradleRootDir = "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test", cradleOptsProg = CradleAction: Cabal-Helper-Stack}
2019-12-27 00:56:40.899986 [ThreadId 85] - Relative Module FilePath: app/Main.hs
2019-12-27 00:56:40.903518 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"token":1},"method":"window/workDoneProgress/create","id":1}
2019-12-27 00:56:40.903684 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"begin","cancellable":false,"title":"Initializing Stack project","percentage":0},"token":1},"method":"$/progress"}
2019-12-27 00:56:40.904425 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":1,"result":null}
2019-12-27 00:56:40.904538 [ThreadId 4] - haskell-lsp:Got reply message:"{\"jsonrpc\":\"2.0\",\"id\":1,\"result\":null}"
2019-12-27 00:56:40.906953 [ThreadId 8] - ****** reactor: got message number:5
2019-12-27 00:56:40.907042 [ThreadId 8] - reactor:got RspFromClient:ResponseMessage {_jsonrpc = "2.0", _id = IdRspInt 1, _result = Just Null, _error = Nothing}
2019-12-27 00:56:40.907096 [ThreadId 8] - ****** reactor: top of loop
2019-12-27 00:56:41.78734 [ThreadId 85] - Unit Info: UnitInfo {uiUnitId = UnitId "test", uiPackageId = ("test",Version {versionBranch = [0,1,0,0], versionTags = []}), uiComponents = fromList [(ChLibName ChMainLibName,ChComponentInfo {ciComponentName = ChLibName ChMainLibName, ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-isrc","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/cabal_macros.h","-this-unit-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-XHaskell2010"], ciSourceDirs = ["src"], ciEntrypoints = ChLibEntrypoint {chExposedModules = [ChModuleName {unChModuleName = "Lib"}], chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}], chSignatures = []}}),(ChExeName "test-exe",ChComponentInfo {ciComponentName = ChExeName "test-exe", ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N"], ciSourceDirs = ["app"], ciEntrypoints = ChExeEntrypoint {chMainIs = "Main.hs", chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}]}})], uiCompilerId = ("GHC",Version {versionBranch = [8,6,5], versionTags = []}), uiPackageFlags = [], uiConfigFlags = [], uiNonDefaultConfigFlags = [], uiModTimes = UnitModTimes {umtPkgYaml = Just ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/package.yaml",1577376104), umtCabalFile = ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/test.cabal",1577376104), umtSetupConfig = Just ("/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config",1577379398)}}
2019-12-27 00:56:41.787969 [ThreadId 85] - Flags for "/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app/Main.hs": ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/app","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N","app/Main.hs","Paths_test"]
2019-12-27 00:56:41.788288 [ThreadId 85] - Component Infos: ChComponentInfo {ciComponentName = ChExeName "test-exe", ciGhcOptions = ["-fbuilding-cabal-package","-O","-outputdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-odir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-hidir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-stubdir",".stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/global-autogen","-I.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/autogen/cabal_macros.h","-hide-all-packages","-Wmissing-home-modules","-no-user-package-db","-package-db","/Users/say/.stack/snapshots/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-db","/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/pkgdb","-package-id","base-4.12.0.0","-package-id","test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE","-XHaskell2010","-threaded","-rtsopts","-with-rtsopts=-N"], ciSourceDirs = ["app"], ciEntrypoints = ChExeEntrypoint {chMainIs = "Main.hs", chOtherModules = [ChModuleName {unChModuleName = "Paths_test"}]}}
2019-12-27 00:56:41.839114 [ThreadId 85] - Ghc error on cradle initialisation: "cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\n    (use -v for more information)"
2019-12-27 00:56:41.839289 [ThreadId 10] - ghcDispatcher:Got error for a request: IdeError {ideCode = OtherError, ideMessage = "\"cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\\n    (use -v for more information)\"", ideInfo = Null} with mid: Nothing
2019-12-27 00:56:41.839387 [ThreadId 10] - ghcDispatcher: top of loop
2019-12-27 00:56:41.83953 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"value":{"kind":"end"},"token":1},"method":"$/progress"}
2019-12-27 00:56:41.839633 [ThreadId 5] - <--2--{"jsonrpc":"2.0","params":{"type":1,"message":"\"cannot satisfy -package-id test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE\\n    (use -v for more information)\""},"method":"window/showMessage"}
fendor commented 4 years ago

And stack clean/stack build works as expected? For completeness, can you send the contents of .stack_work after doing stack build? E.g. the tree structure not the content of each file.

mingcenwei commented 4 years ago

stack clean/stack build all work as expected.

$> stack build
test> configure (lib + exe)
Configuring test-0.1.0.0...
test> build (lib + exe)
Preprocessing library for test-0.1.0.0..
Building library for test-0.1.0.0..
Preprocessing executable 'test-exe' for test-0.1.0.0..
Building executable 'test-exe' for test-0.1.0.0..
[2 of 2] Compiling Main
Linking .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/test-exe/test-exe ...
test> copy/register
Installing library in /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/lib/x86_64-osx-ghc-8.6.5/test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE
Installing executable test-exe in /private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test/.stack-work/install/x86_64-osx/0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445/8.6.5/bin
Registering library for test-0.1.0.0..

$> stack exec test-exe
someFunc

$> tree .stack-work/
.stack-work/
├── cabal-helper
│   ├── CabalHelper
│   │   ├── Runtime
│   │   │   ├── Compat.hi
│   │   │   ├── Compat.hs
│   │   │   ├── Compat.o
│   │   │   ├── HelperMain.hi
│   │   │   ├── HelperMain.hs
│   │   │   ├── HelperMain.o
│   │   │   └── Main.hs
│   │   └── Shared
│   │       ├── Common.hi
│   │       ├── Common.hs
│   │       ├── Common.o
│   │       ├── InterfaceTypes.hi
│   │       ├── InterfaceTypes.hs
│   │       └── InterfaceTypes.o
│   ├── Main.hi
│   ├── Main.o
│   └── cabal-helper
├── dist
│   └── x86_64-osx
│       └── Cabal-2.4.0.1
│           ├── build
│           │   ├── Lib.dyn_hi
│           │   ├── Lib.dyn_o
│           │   ├── Lib.hi
│           │   ├── Lib.o
│           │   ├── Paths_test.dyn_hi
│           │   ├── Paths_test.dyn_o
│           │   ├── Paths_test.hi
│           │   ├── Paths_test.o
│           │   ├── autogen
│           │   │   ├── Paths_test.hs
│           │   │   └── cabal_macros.h
│           │   ├── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE-ghc8.6.5.dylib
│           │   ├── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.a
│           │   └── test-exe
│           │       ├── autogen
│           │       │   ├── Paths_test.hs
│           │       │   └── cabal_macros.h
│           │       ├── test-exe
│           │       └── test-exe-tmp
│           │           ├── Main.hi
│           │           ├── Main.o
│           │           ├── Paths_test.hi
│           │           └── Paths_test.o
│           ├── build-lock
│           ├── package.conf.inplace
│           │   ├── package.cache
│           │   ├── package.cache.lock
│           │   └── test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.conf
│           ├── setup-config
│           ├── stack-build-caches
│           │   └── 0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445
│           │       ├── exe-test-exe
│           │       └── lib
│           └── stack-cabal-mod
├── install
│   └── x86_64-osx
│       ├── 0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445
│       │   └── 8.6.5
│       │       ├── bin
│       │       │   └── test-exe
│       │       ├── doc
│       │       │   └── test-0.1.0.0
│       │       │       └── LICENSE
│       │       ├── lib
│       │       │   └── x86_64-osx-ghc-8.6.5
│       │       │       ├── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE-ghc8.6.5.dylib
│       │       │       └── test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE
│       │       │           ├── Lib.dyn_hi
│       │       │           ├── Lib.hi
│       │       │           ├── Paths_test.dyn_hi
│       │       │           ├── Paths_test.hi
│       │       │           └── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.a
│       │       └── pkgdb
│       │           ├── package.cache
│       │           ├── package.cache.lock
│       │           └── test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.conf
│       └── 0c1dd042ce02da0af185d878b7827c29b01da878f4edcd00b6a40a16dfe3e861
│           └── 8.6.5
│               └── pkgdb
│                   ├── package.cache
│                   └── package.cache.lock
├── stack.sqlite3
└── stack.sqlite3.pantry-write-lock

29 directories, 58 files

$> stack clean

$> tree .stack-work/
.stack-work/
├── cabal-helper
│   ├── CabalHelper
│   │   ├── Runtime
│   │   │   ├── Compat.hi
│   │   │   ├── Compat.hs
│   │   │   ├── Compat.o
│   │   │   ├── HelperMain.hi
│   │   │   ├── HelperMain.hs
│   │   │   ├── HelperMain.o
│   │   │   └── Main.hs
│   │   └── Shared
│   │       ├── Common.hi
│   │       ├── Common.hs
│   │       ├── Common.o
│   │       ├── InterfaceTypes.hi
│   │       ├── InterfaceTypes.hs
│   │       └── InterfaceTypes.o
│   ├── Main.hi
│   ├── Main.o
│   └── cabal-helper
├── install
│   └── x86_64-osx
│       ├── 0baa6054dad47a08f0e811fc873921f837a750d427b358a66f338688f7da9445
│       │   └── 8.6.5
│       │       ├── bin
│       │       │   └── test-exe
│       │       ├── doc
│       │       │   └── test-0.1.0.0
│       │       │       └── LICENSE
│       │       ├── lib
│       │       │   └── x86_64-osx-ghc-8.6.5
│       │       │       ├── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE-ghc8.6.5.dylib
│       │       │       └── test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE
│       │       │           ├── Lib.dyn_hi
│       │       │           ├── Lib.hi
│       │       │           ├── Paths_test.dyn_hi
│       │       │           ├── Paths_test.hi
│       │       │           └── libHStest-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.a
│       │       └── pkgdb
│       │           ├── package.cache
│       │           ├── package.cache.lock
│       │           └── test-0.1.0.0-GonkJTtOuP1BV3CgSh86TE.conf
│       └── 0c1dd042ce02da0af185d878b7827c29b01da878f4edcd00b6a40a16dfe3e861
│           └── 8.6.5
│               └── pkgdb
│                   ├── package.cache
│                   └── package.cache.lock
├── stack.sqlite3
└── stack.sqlite3.pantry-write-lock

18 directories, 31 files
fendor commented 4 years ago

OK, can you try adding a file hie.yaml in the top-level directory with the contents:

cradle:
  stack:

Does that work?

mingcenwei commented 4 years ago

@fendor Yes, now it works well! Thank you very much!

fendor commented 4 years ago

Glad to hear that but you are not off-the-hook yet! We still have to find out why it doesnt work out-of-the-box.

To extend your configuration, see https://github.com/haskell/haskell-ide-engine#project-configuration This is useful if you have a more complicated project with multiple executables.

mingcenwei commented 4 years ago

I appreciate your efforts! I will continue watching this issue. Please let me know if there's anything that I can help with.

fendor commented 4 years ago

So, I did some investigating and I am able to reproduce the issue with the following steps:

stack new test
cd test/
code .

Make sure to only open app/Main.hs. This will trigger the described error: "cannot satisfy -package test-...".

If you only open src/Lib.hs, then it works as expected.

@mingcenwei Can you verify similar behaviour?

I discussed this with @flutterlice and we have different observations regarding the next step. For me, explicitly building the project, e.g.:

rm -rf .stack_work/
stack build
code .

Makes every component work as expected. However, for @flutterlice, the issue seemed fixed at first, but after typing, the errors were shown again. @mingcenwei I think you tried stack build, too, and it didnt work, right?

However, adding a custom hie.yaml with the contents:

cradle:
  stack:

Fixes it for all of us, iirc.

I think this issue is only cabal-helper related, e.g. not enough files are generated for dependencies, e.g. we might run into https://github.com/haskell/cabal/issues/2209 or maybe https://github.com/commercialhaskell/stack/issues/2790.

mingcenwei commented 4 years ago

@fendor I found that the error message will be triggered on my MacBook no matter which file I open (even if I only open src/Lib.hs). Yes, I have tried running statck build explicitly, and the error still existed. If I add a hie.yaml with the given contents, then the error no longer exists.

lukel97 commented 4 years ago

@mingcenwei are you opening this project from a temporary directory? I just noticed

2019-12-27 00:56:24.700894 [ThreadId 4] - Current directory:/private/var/folders/pr/x9vb6yhj0wz0dsfy1s6_6nh80000gn/T/tmp.B8OT1LWl/test

Not that it shouldn't work, but I think we had another user with issues when they tried to open a project inside a temporary directory? cc @fendor

fendor commented 4 years ago

@mingcenwei The plot thickens. Would you mind trying if cabal is able to build the project correctly? Assuming you have cabal version 2.4.0.0 or higher (cabal v2-* commands need to exist), add to the test project a cabal.project with the contents:

packages: ./

Or echo "packages: ./" > cabal.project. The cabal.project file is the pendant to stack.yaml for cabal. Errors must be different on this project. Can you compare again how everything works before executing cabal v2-build and afterwards? E.g. complete workflow:

stack new test
cd test
echo "packages: ./" > cabal.project
## now make sure that your `ghc` on the path has the same version 
## as the version `hie` has been compiled with
code . # check the files, report errors, etc..

cabal v2-build all # build the project
code . # compare results again
mingcenwei commented 4 years ago

@bubba The problem still exists even if I put the project into ${HOME}/Downloads/temp/.

@fendor If I add the cabal.project file, then when I open app/Main.hs or src/Lib.hs in VS Code these error messages will be emitted (I'm sure that I have the right ghc on my path): image image Even if I have run cabal v2-build all, the error messages still exist and appear the same. My cabal version is 3.0.0.0.

fendor commented 4 years ago

uhm... weird... In the terminal of vscode, can you check if vscode really knows about ghc?

mingcenwei commented 4 years ago

@fendor Oh, my fault. I added the directory of ghc to PATH variable and exported it in my computer's terminal, but it seems that the terminal in VS Code doesn't know about ghc. Once I created the symlinks in /usr/local/bin, all works well, whether I run cabal v2-build all or not.

fendor commented 4 years ago

Ok, so, we are closing in, the issue only happens with cabal-helper with stack.