Skip to content
This repository was archived by the owner on Oct 7, 2020. It is now read-only.
This repository was archived by the owner on Oct 7, 2020. It is now read-only.

HIE doesn't work with 'simple' yesod project #1207

Closed
@skress

Description

@skress

Hi,

I am trying to use HIE with the current VSCode extension. HIE is started, then it dies after a couple of seconds. VSCode retries 5 times and then gives up.

The project is created via

stack new yesod-test yesod-sqlite

I can run successfully run stack build in the project, but due to bugs in GHC and the chosen LTS I cannot run stack haddock.

So I updated to LTS 13.17 which uses GHC 8.6.4 and I cherry picked https://gitlab.haskell.org/ghc/ghc/merge_requests/276/commits which fixes the GHC bug that prevents haddock from running successfully. With my fixed GHC I can now run stack haddock and stack hoogle. Nevertheless the result is the same: hie dies 5 times and then the extension doesn't try anymore.

For completeness: when upgrading to LTS 13.17 I needed to upgrade a couple of the dependencies and I needed to add haskell-src-exts-1.21.0@sha256:02421cacaa48c055551b8e5796efc543301b7ea9527a38e1385403d2b85512fb as extra-dependency to the project's stack.yaml.

This is the log output in VSCode:

info: Found Stack project at: /Users/skress/tmp/yesod-test
Using hie version: Version 0.8.0.0 (2579 commits) x86_64 ghc-8.6.4
info: Using Stack project at: /Users/skress/tmp/yesod-test
Using hoogle db at: /Users/skress/.hoogle/default-haskell-5.0.17.hoo
info: Found Stack project at: /Users/skress/tmp/yesod-test
info: Using Stack project at: /Users/skress/tmp/yesod-test
DEBUG: regenerating cache: /Users/skress/tmp/yesod-test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config.ghc-mod.cabal-components (cache missing or unreadable)
DEBUG: writing memory cache: /Users/skress/tmp/yesod-test/.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config.ghc-mod.cabal-components
DEBUG: resolveEntrypoint:
       ["-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"]
DEBUG: resolveEntrypoint:
       ["-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/yesod-test-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/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/yesod-test/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/yesod-test/yesod-test-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/autogen/cabal_macros.h"]
DEBUG: resolveEntrypoint: []
DEBUG: making sure autogen files exist
DEBUG: resolvedComponentsCache: files changed: none
DEBUG: resolveGmComponent:
       ["-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/cabal_macros.h"]
DEBUG: resolveGmComponent:
       ["-i","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/yesod-test-tmp","-iapp","-i.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/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/yesod-test/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/yesod-test/yesod-test-tmp","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/yesod-test/autogen/cabal_macros.h","-XHaskell2010","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/cabal_macros.h"]
DEBUG: resolveGmComponent:
       ["-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","-XHaskell2010","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-2.4.0.1/build/autogen/cabal_macros.h"]
DEBUG: regenerating cache: .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config.ghc-mod.resolved-components (cache missing or unreadable)
DEBUG: writing memory cache: .stack-work/dist/x86_64-osx/Cabal-2.4.0.1/setup-config.ghc-mod.resolved-components
VOMIT: hide all packages(ignore .ghc.environment):: DontLoadGhcEnvironment
VOMIT: Using the following mapped files: "/Users/skress/tmp/yesod-test/src/Application.hs"
VOMIT: Using the following mapped files: "/Users/skress/tmp/yesod-test/src/Application.hs"
VOMIT: Initializing GHC session with following options: "-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" "yesod-test-0.0.0-6DjXNe20DleW7CMppajBn" "-hide-all-packages" "-Wmissing-home-modules" "-no-user-package-db" "-package-db" "/Users/skress/.stack/snapshots/x86_64-osx/lts-13.17/8.6.4/pkgdb" "-package-db" "/Users/skress/tmp/yesod-test/.stack-work/install/x86_64-osx/lts-13.17/8.6.4/pkgdb" "-package-id" "aeson-1.4.2.0-9cSxVTttZ9O9gQQeYMFLor" "-package-id" "base-4.12.0.0" "-package-id" "bytestring-0.10.8.2" "-package-id" "case-insensitive-1.2.0.11-GGYU9CY9cs88wywgwHVKC6" "-package-id" "classy-prelude-1.5.0-9ua77cq6KAUIhfNv7qqpNw" "-package-id" "classy-prelude-conduit-1.5.0-E7fRBtKKtGQ8ttlUwXVnpL" "-package-id" "classy-prelude-yesod-1.5.0-1TnZAq8ZUafHCtlvaf8Ok0" "-package-id" "conduit-1.3.1.1-9dJdFSy5i9yEMUCfUtIeMw" "-package-id" "containers-0.6.0.1" "-package-id" "data-default-0.7.1.1-48AlmAL5bp0K1GegiZac8Q" "-package-id" "directory-1.3.3.0" "-package-id" "fast-logger-2.4.15-5ogIBC4IeSf8znicURd5U9" "-package-id" "file-embed-0.0.11-4IE3sw0bCLQ7xXwEGMUYke" "-package-id" "foreign-store-0.2-FCKu23zJ1MhKEqdHalRzFz" "-package-id" "hjsmin-0.2.0.2-7ujCE5A9usgHO0U0zlM90P" "-package-id" "http-client-tls-0.3.5.3-4Oj3XfLIB1u1YcwkJvsJyQ" "-package-id" "http-conduit-2.3.7-7GcjDE8EjpuB5TglywFQE3" "-package-id" "monad-control-1.0.2.3-MU9UBTCjrb6B3h9cgBZmE" "-package-id" "monad-logger-0.3.30-GEWCAHrLi3C16XdkA2qgQQ" "-package-id" "persistent-2.9.2-8ZsEOLdPGVyMpKk9TbNm6" "-package-id" "persistent-sqlite-2.9.3-GCcpwQxiUmBKqTffmjVCC" "-package-id" "persistent-template-2.5.4-1p3PyRQtkwjA8WlmYjgfLg" "-package-id" "safe-0.3.17-43oyx4B630gDZMbTh3Ttji" "-package-id" "shakespeare-2.0.20-GgZsrpU3qRD7IcOFzA7qLZ" "-package-id" "template-haskell-2.14.0.0" "-package-id" "text-1.2.3.1" "-package-id" "time-1.8.0.2" "-package-id" "unordered-containers-0.2.9.0-BRWkoSTuML1cQdpep6Oin" "-package-id" "vector-0.12.0.2-AoZ9EwUsgIW1yrOc105QXH" "-package-id" "wai-3.2.2-ItOaIlhStjHFO5Ka82Wde" "-package-id" "wai-extra-3.0.25-DZTrSe3T9l0HrwTFrBnu0y" "-package-id" "wai-logger-2.3.4-5sEZlyZhmcYAw79Hj8qvs" "-package-id" "warp-3.2.26-AFIGCLCiaz23mDsL3PYZV1" "-package-id" "yaml-0.11.0.0-KC6yhv4lzea9KrxGHmNBH5" "-package-id" "yesod-1.6.0-2EAJfcvA8rgCwtAJe48cVL" "-package-id" "yesod-auth-1.6.6-5h65fgi6e2A95CrbtzJi7j" "-package-id" "yesod-core-1.6.14-NXRwhm3esn34tB0knb3g1" "-package-id" "yesod-form-1.6.4-Jf50ecrTMQwLDv7EbLXrL6" "-package-id" "yesod-static-1.6.0.1-6AcQgmxsoY1G9JLY1pgT7q" "-XHaskell2010" "-Wall" "-fwarn-tabs" "-O2" "-Wno-missing-home-modules" "-O0" "-fno-warn-missing-home-modules" "-Wwarn"
DEBUG: initSession: Session not initialized, creating new one
VOMIT: Using the following targets: "/Users/skress/tmp/yesod-test/src/Application.hs" "/Users/skress/tmp/yesod-test/src/Application.hs"
DEBUG: loadTargets:
       Loading: /private/var/folders/rx/6cf2s8fd33z4pt3xm_lkgrsc0000gn/T/ghc-mod42844/Application42843-0.hs
DEBUG: loadTargets: filterModSums: True
info: loadTargets:
      Target needs interpeter, switching to LinkInMemory/HscInterpreted. Perfectly normal if anything is using TemplateHaskell, QuasiQuotes or PatternSynonyms.
hie-wrapper: callProcess: /Users/skress/.local/bin/hie-8.6.4 "--lsp" "-d" "-l" "/var/folders/rx/6cf2s8fd33z4pt3xm_lkgrsc0000gn/T/hie.log" "--vomit" (exit -11): failed
[Info  - 12:36:26 PM] Connection to server got closed. Server will restart.

This is part of the debug output of hie:

2019-04-25 12:36:20.021277 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 0.8.0.0 (2579 commits) x86_64 ghc-8.6.4
2019-04-25 12:36:20.022045 [ThreadId 4] - Current directory:/Users/skress/tmp/yesod-test
2019-04-25 12:36:20.501057 [ThreadId 4] - Cradle directory:/Users/skress/tmp/yesod-test
2019-04-25 12:36:20.501527 [ThreadId 4] - Using stack GHC version
2019-04-25 12:36:20.934247 [ThreadId 4] - Project GHC version:8.6.4
2019-04-25 12:36:20.934341 [ThreadId 4] - hie exe candidates :["hie-8.6.4","hie-8.6","hie"]
2019-04-25 12:36:20.934593 [ThreadId 4] - found hie exe at:/Users/skress/.local/bin/hie-8.6.4
2019-04-25 12:36:20.934635 [ThreadId 4] - args:["--lsp","-d","-l","/var/folders/rx/6cf2s8fd33z4pt3xm_lkgrsc0000gn/T/hie.log","--vomit"]
2019-04-25 12:36:20.93466 [ThreadId 4] - launching ....



2019-04-25 12:36:20.951212 [ThreadId 4] - Using stack GHC version
2019-04-25 12:36:21.379566 [ThreadId 4] - Run entered for HIE(hie-8.6.4) Version 0.8.0.0 (2579 commits) x86_64 ghc-8.6.4
2019-04-25 12:36:21.379686 [ThreadId 4] - Current directory:/Users/skress/tmp/yesod-test
2019-04-25 12:36:21.379716 [ThreadId 4] - Enabling --vomit for ghc-mod. Output will be on stderr
2019-04-25 12:36:21.37977 [ThreadId 4] -




haskell-lsp:Starting up server ...
2019-04-25 12:36:21.379976 [ThreadId 4] - ---> {"jsonrpc":"2.0","id":0,"method":"initialize","params":{"processId":42805,"rootPath":"/Users/skress/tmp/yesod-test","rootUri":"file:///Users/skress/tmp/yesod-test","capabilities":{"workspace":{"applyEdit":true,"workspaceEdit":{"documentChanges"
:true},"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":tr
ue},"configuration":true,"workspaceFolders":true},"textDocument":{"publishDiagnostics":{"relatedInformation":true},"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},"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"]}},"definition":{"dynamicRegistration":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,"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},"documentLink":{"dynamicRegistration":true},"typeDefinition":{"dynamicRegistration":true},"implementation":{"dynamicRegistration":true},"colorProvider":{"dynamicRegistration":true},"foldingRange":{"dynamicRegistration":true,"rangeLimit":5000,"lineFoldingOnly":true}}},"trace":"off","workspaceFolders":[{"uri":"file:///Users/skress/tmp/yesod-test","name":"yesod-test"}]}}
2019-04-25 12:36:21.38096 [ThreadId 4] - haskell-lsp:initializeRequestHandler: setting current dir to project root:/Users/skress/tmp/yesod-test
2019-04-25 12:36:21.381375 [ThreadId 10] - ****** reactor: top of loop
...

... and these are the last lines of the output:

2019-04-25 12:36:46.853527 [ThreadId 10] - ****** reactor: got message number:4
2019-04-25 12:36:46.85359 [ThreadId 10] - reactor:got CodeActionRequest:RequestMessage {_jsonrpc = "2.0", _id = IdInt 2, _method = TextDocumentCodeAction, _params = CodeActionParams {_textDocument = TextDocumentIdentifier {_uri = Uri {getUri = "file:///Users/skress/tmp/yesod-test/src/Application.hs"}}, _range = Range {_start = Position {_line = 42, _character = 18}, _end = Position {_line = 42, _character = 18}}, _context = CodeActionContext {_diagnostics = List [], only = Nothing}}}
2019-04-25 12:36:46.853644 [ThreadId 10] - ****** reactor: top of loop
2019-04-25 12:36:46.853669 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.853697 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.853717 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.85374 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.853758 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.853779 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.8538 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.853915 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.853943 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.853967 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.853985 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.854006 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.854024 [ThreadId 13] - ideDispatcher: got request 4 with id: IdInt 2
2019-04-25 12:36:46.854048 [ThreadId 13] - ideDispatcher: top of loop
2019-04-25 12:36:46.854105 [ThreadId 6] - <--2--{"result":[],"jsonrpc":"2.0","id":2}

The full hie.log can be seen here: https://gist.github.com/skress/d16c5a7e65086b86dee2170c4791e2d4

Using hie with a project generated via stack new i.e. not using any stack template seems to work.

Any ideas what might cause this problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions