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

Hie-wrapper dead while start-up: no .cabal files in stack based project #1666

Open
Hypnoes opened this issue Feb 25, 2020 · 10 comments
Open

Comments

@Hypnoes
Copy link

Hypnoes commented Feb 25, 2020

Here is the output from log:

2020-02-25 15:50:24.185400354 [ThreadId 4] - run entered for hie-wrapper(hie-wrapper) Version 1.1, Git revision 91422e95459130633905ab619772150860b2da2d (3793 commits) x86_64 ghc-8.8.2
2020-02-25 15:50:24.185751944 [ThreadId 4] - Current directory:/home/hypnoes/source/repos/devoke
2020-02-25 15:50:24.185931317 [ThreadId 4] - Operating system:linux
2020-02-25 15:50:24.18598141 [ThreadId 4] - args:["--lsp"]
2020-02-25 15:50:24.186935326 [ThreadId 4] - Cabal-Helper decided to use: ProjLocStackYaml {plStackYaml = "/home/hypnoes/source/repos/devoke/stack.yaml"}
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
Stack has not been tested with GHC versions above 8.6, and using 8.8.2, this may fail
Stack has not been tested with Cabal versions above 2.4, but version 3.0.1.0 was found, this may fail
hie-wrapper: user error (Pattern match failure in do expression at lib/Distribution/Helper.hs:603:7-22)
[Error - 3:50:24 PM] Connection to server got closed. Server will not be restarted.

I thought it might be related to DanielG/cabal-helper/issues/90, but i can't find the solution of this problem.

@fendor
Copy link
Collaborator

fendor commented Feb 25, 2020

A possible solution might be to add an explicit hie.yaml with the contents:

cradle:
  stack:

for simple projects and for more complex projects, use a more complex one, see https://github.com/haskell/haskell-ide-engine#project-configuration
You can find the components of your projects via stack ide targets and components are your executables, library, tests and benchmarks.

@DanielG
Copy link
Collaborator

DanielG commented Feb 25, 2020

@Hypnoes Can you paste the output of stack ide packages --cabal-files --stdout and just stack ide packages --stdout?

@Hypnoes
Copy link
Author

Hypnoes commented Feb 25, 2020

@Hypnoes Can you paste the output of stack ide packages --cabal-files --stdout and just stack ide packages --stdout?

Nothing.

Btw, add a hie.yaml just work for me. But why? why it work?

@DanielG
Copy link
Collaborator

DanielG commented Feb 25, 2020

Ok, so how is your project setup? Do you have a stack.yaml, package.yaml, *.cabal file or all of the above?

If stack build works in your project but ide packages doesn't spit anything out I'd actually consider this a stack bug.

@Hypnoes
Copy link
Author

Hypnoes commented Feb 25, 2020

@DanielG Emmm, I just found stack build goes wrong. I build a new project by stack new and it works. So it seems i'm not config my project correctly.

@awgn
Copy link

awgn commented Mar 1, 2020

I'm facing the same issue here. Instead, with the following hie.yaml:

cradle:
   stack:

it does work.

Stack build builds properly the project and stack ide packages dumps the package name.

The interesting part is that the project is using a handwritten cabal file, though it does compile via stack (hence it is equipped with both stack.yml and the related project.cabal).

The resolver in use is lts-15.1, and the build-type: Simple is set.

@jneira
Copy link
Member

jneira commented Mar 1, 2020

@awgn and stack ide packages --cabal-files --stdout?

@fendor
Copy link
Collaborator

fendor commented Mar 2, 2020

@awgn Please post some logs, if you use hie.yaml, your problem is definitely different to the posted issue. Ideally, open a new issue with logs attached, please :)

@jneira
Copy link
Member

jneira commented Mar 2, 2020

To be sure that it is the same issue the error log should contain:
user error (Pattern match failure in do expression at lib/Distribution/Helper.hs:603:7-22)
(with the exact line numbers)

@ryanbas21
Copy link

ryanbas21 commented Mar 21, 2020

If it helps, I am running arch and installed via aura -A haskell-ide-engine.

I had the exact error @jneira posted above. I added the hie.yaml as also posted above.

resulted in

2020-03-20 21:11:32.758869325 [ThreadId 4] - Executing Stack GHC with args: --numeric-version
2020-03-20 21:11:33.00966254 [ThreadId 4] - Project GHC version:8.8.3
2020-03-20 21:11:33.00973858 [ThreadId 4] - hie exe candidates :["hie-8.8.3","hie-8.8","hie"]
2020-03-20 21:11:33.009944699 [ThreadId 4] - cannot find any hie exe, looked for:hie-8.8.3, hie-8.8, hie
[Error  - 9:11:33 PM] Connection to server got closed. Server will not be restarted.

The project I am in was initialized via stack new on Version 2.2.0, Git revision 95aaf2bc2c969622679c2a8233e7bb637e43210d (dirty) (8043 commits) PRE-RELEASE x86_64

stack ide packages --cabal-files --stdout produced no output.

I solved this by uninstalling haskell-ide-engine with aura and cloning the repo manually.

@jneira jneira changed the title Hie-wrapper dead while start-up. Hie-wrapper dead while start-up: no .cabal files in stack based project May 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants