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

readCreateProcess error when using cabal v2-build #1407

Closed
freeman42x opened this issue Oct 11, 2019 · 13 comments
Closed

readCreateProcess error when using cabal v2-build #1407

freeman42x opened this issue Oct 11, 2019 · 13 comments

Comments

@freeman42x
Copy link

Does HIE work with cabal v2-build?

For me it is throwing the following error:

Got error while processing diagnostics: readCreateProcess: /nix/store/jq8x50rkl3cm7cqkj1zsk6kfbb692iwv-cabal-helper-0.9.0.0/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/home/neo/Projects/haskell-editor-setup" "/home/neo/Projects/haskell-editor-setup/dist-newstyle/build/x86_64-linux/ghc-8.6.5/haskell-editor-setup-0.1.0.0" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output" (exit 1): failed

Haskell (hie) /home/neo/Projects/haskell-editor-setup/

I am using HIE installed via https://github.com/Infinisil/all-hies on NixOS.

[neo@nixos:~/Projects/haskell-editor-setup]$ hie --version
Version 0.12.0.0 x86_64 ghc-8.6.5

Running HIE in terminal seems to work fine:

[neo@nixos:~/Projects/haskell-editor-setup]$ hie
2019-10-11 11:07:23.057891434 [ThreadId 4] - run entered for hie-wrapper(hie) Version 0.12.0.0 x86_64 ghc-8.6.5
2019-10-11 11:07:23.05847655 [ThreadId 4] - Current directory:/home/neo/Projects/haskell-editor-setup
2019-10-11 11:07:23.058803704 [ThreadId 4] - Operating system:linux
2019-10-11 11:07:23.24951839 [ThreadId 4] - Cradle directory:/home/neo/Projects/haskell-editor-setup
2019-10-11 11:07:23.250094489 [ThreadId 4] - Using plain GHC version
2019-10-11 11:07:23.29634425 [ThreadId 4] - Project GHC version:8.6.5
2019-10-11 11:07:23.296684374 [ThreadId 4] - hie exe candidates :["hie-8.6.5","hie-8.6","hie"]
2019-10-11 11:07:23.29735114 [ThreadId 4] - found hie exe at:/nix/store/s8697vc63xjak866yginj7273cwjj23r-haskell-ide-engine-combined/libexec/bin/hie-8.6.5
2019-10-11 11:07:23.297915493 [ThreadId 4] - args:[]
2019-10-11 11:07:23.298120594 [ThreadId 4] - launching ....



2019-10-11 11:07:23.719709752 [ThreadId 4] - Using plain GHC version
2019-10-11 11:07:23.760840242 [ThreadId 4] - Run entered for HIE(hie-8.6.5) Version 0.12.0.0 x86_64 ghc-8.6.5
2019-10-11 11:07:23.761491916 [ThreadId 4] - Current directory:/home/neo/Projects/haskell-editor-setup

If you wish to reproduce the issue, this is the project I am testing on: https://github.com/fairy-tale-agi-solutions/haskell-editor-setup

@jneira
Copy link
Member

jneira commented Oct 11, 2019

Does exists the cabal-helper-wrapper executable in the path mentioned in the error? if it does, running the executable directly adding the --verbose option could give us more hints.

@freeman42x
Copy link
Author

The Atom HIE extension is the one making that call. How could I tell it to add --verbose? I can test with VSCode also (it will probably throw the same error).

@jneira
Copy link
Member

jneira commented Oct 11, 2019

The command should be executed in a shell. For example if i run the command in windows (it finish succesfully in my case):

D:\ws\haskell\haskell-ide-engine>.stack-work\install\827c0090\bin\cabal-helper-wrapper --verbose "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "." ".stackwork\dist\e626a42b" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output"

D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe list --simple-output Cabal
=> Cabal-2.4.0.1

using helper compiled with Cabal from user/global package-db
helper already compiled, using exe: C:\Users\user\Local Settings\Cache\cabal-help
er\cabal-helper0.9.0.0-Cabal2.4.0.1

Searching for ghc in path.
Found ghc at
D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe
"D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe" "--numeric-version"
D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc.exe
is version 8.6.5
looking for tool ghc-pkg near compiler in
D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin
candidate locations:
["D:\\bin\\Programs\\stack\\x86_64-windows\\ghc-8.6.5\\bin\\ghc-pkg.exe"]
found ghc-pkg in
D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe
"D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe" "--version"
D:\bin\Programs\stack\x86_64-windows\ghc-8.6.5\bin\ghc-pkg.exe
is version 8.6.5
[Just (ChResponsePkgDbs.... lot of info about the project

Note the --verbose flag should be in the first position
One point where it usually fail is in the

using helper compiled with Cabal from user/global package-db
helper already compiled, using exe: C:\Users\user\Local Settings\Cache\cabal-help
er\cabal-helper0.9.0.0-Cabal2.4.0.1

part

@freeman42x
Copy link
Author

Running:

/nix/store/jq8x50rkl3cm7cqkj1zsk6kfbb692iwv-cabal-helper-0.9.0.0/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/home/neo/Projects/haskell-editor-setup" "/home/neo/Projects/haskell-editor-setup/dist-newstyle/build/x86_64-linux/ghc-8.6.5/haskell-editor-setup-0.1.0.0" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output"

Gives:

cabal-helper-wrapper: /home/neo/Projects/haskell-editor-setup/dist-newstyle/build/x86_64-linux/ghc-8.6.5/haskell-editor-setup-0.1.0.0/setup-config: openFile: does not exist (No such file or directory)

Running with verbose gives:

Searching for ghc in path.
Found ghc at /run/current-system/sw/bin/ghc
/run/current-system/sw/bin/ghc --numeric-version
/run/current-system/sw/bin/ghc is version 8.6.5
looking for tool ghc-pkg near compiler in /run/current-system/sw/bin
candidate locations:
["/run/current-system/sw/bin/ghc-pkg","/nix/store/jsfacg5kaw9d0sa1q8zgagaizar5k8xd-ghc-8.6.5/bin/ghc-pkg-ghc-8.6.5","/nix/store/jsfacg5kaw9d0sa1q8zgagaizar5k8xd-ghc-8.6.5/bin/ghc-pkg-8.6.5","/nix/store/jsfacg5kaw9d0sa1q8zgagaizar5k8xd-ghc-8.6.5/bin/ghc-pkg"]
found ghc-pkg in /run/current-system/sw/bin/ghc-pkg
/run/current-system/sw/bin/ghc-pkg --version
/run/current-system/sw/bin/ghc-pkg is version 8.6.5
/run/current-system/sw/bin/ghc --supported-languages
/run/current-system/sw/bin/ghc --info
cabal-helper-wrapper: /home/neo/Projects/haskell-editor-setup/dist-newstyle/build/x86_64-linux/ghc-8.6.5/haskell-editor-setup-0.1.0.0/setup-config: openFile: does not exist (No such file or directory)

@freeman42x
Copy link
Author

@jneira Also, HIE running this command with "v1-style" seems wrong since I built the project using cabal v2.

@freeman42x
Copy link
Author

In VSCode I am getting this error:

readCreateProcess: cabal "configure" "--with-ghc=ghc" "--flags" "" (exit 1): failed

@freeman42x
Copy link
Author

Ignore the above error, that was without doing cabal v2-build before opening VSCode.

This is the error after doing the v2 build:

{
"resource": "/home/neo/Projects/haskell-editor-setup/src/Main.hs",
"owner": "Haskell HIE (haskell-editor-setup)",
"severity": 8,
"message": "readCreateProcess: /nix/store/jq8x50rkl3cm7cqkj1zsk6kfbb692iwv-cabal-helper-0.9.0.0/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/home/neo/Projects/haskell-editor-setup" "/home/neo/Projects/haskell-editor-setup/dist-newstyle/build/x86_64-linux/ghc-8.6.5/haskell-editor-setup-0.1.0.0" "package-db-stack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-options" "ghc-options" "source-dirs" "entrypoints" "needs-build-output" (exit 1): failed\n",
"source": "ghcmod",
"startLineNumber": 1,
"startColumn": 1,
"endLineNumber": 2,
"endColumn": 1
}

@jneira
Copy link
Member

jneira commented Oct 11, 2019

Hi, i've got the same error in a cabal project with an executable and i've remembered there is a previous issue about: #1015 (sorry for not link it early)

In that issue:

@freeman42x
Copy link
Author

@jneira Thank you! You're a hero. At least there is a workaround which if I understand correctly would only need to be done once and then later HIE builds would work fine.

I am still confused as to why the command references cabal v1 though.

Oh, and your link to the PR is not pointing at any PR. Could you update it please?

@jneira
Copy link
Member

jneira commented Oct 12, 2019

You are welcome, link updated!

@infinisil
Copy link
Contributor

Fyi, all-hies now has support to build the hie-bios PR, see https://github.com/infinisil/all-hies#hie-bios-versions (not cached though)

@freeman42x
Copy link
Author

@infinisil I tried to use it and got this: infinisil/all-hies#27

@fendor
Copy link
Collaborator

fendor commented Dec 20, 2019

PR #1126 has landed bringing support for Cabal 3.0.0.0 and nix-style builds!

This issue was closed.
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

4 participants