Skip to content

cabal-helper-wrapper "print-build-platform" (exit 1): failed. #128

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

Closed
ghost opened this issue Dec 29, 2018 · 19 comments
Closed

cabal-helper-wrapper "print-build-platform" (exit 1): failed. #128

ghost opened this issue Dec 29, 2018 · 19 comments

Comments

@ghost
Copy link

ghost commented Dec 29, 2018

When i open a .hs file in vscode, an error occurred following:

Got error while processing diagnostics: readCreateProcess: /Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper "print-build-platform" (exit 1): failed
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.3

MacOS : 10.14.2
vscode : 1.30.1(1.30.1)

@ghost ghost changed the title The Haskell HIE (study) server crashed 5 times in the last 3 minutes. cabal-helper-wrapper "print-build-platform" (exit 1): failed. Dec 29, 2018
@alanz
Copy link
Collaborator

alanz commented Dec 29, 2018

Does /Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper exist?

After installing hie, you have to leave the directory intact that it was installed from.

@ghost
Copy link
Author

ghost commented Dec 29, 2018

Yep, That file exists.

$ ls -l /Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper
.rwxr-xr-x      1 6.8Mi foo staff 2018-12-29 18:53 /Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper

@alanz
Copy link
Collaborator

alanz commented Dec 29, 2018

And what happens if you run

/Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper print-build-platform

@ghost
Copy link
Author

ghost commented Dec 29, 2018

The result:

$ /Users/foo/dev/study/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.0/8.6.3/bin/cabal-helper-wrapper print-build-platform
cabal-helper-wrapper: dieVerbatim: user error (cabal-helper-wrapper: The program 'ghc' version >=7.0.1 is required but it
could not be found.
)

Hmm, do i need to expose ghc command on my bash environment? I am using stack ghc instead of ghc:

$ ghc --version
zsh: command not found: ghc

$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.6.3

@alanz
Copy link
Collaborator

alanz commented Dec 29, 2018

It looks like the wrapper is also expecting a system ghc to be installed.

What I do is just symlink the stack one in to a location on the path somewhere, but in the meantime this is a bug, I will look into it.

@alanz
Copy link
Collaborator

alanz commented Dec 29, 2018

This line is the problem.

https://github.com/alanz/cabal-helper/blob/cabal-new-legacy/src/CabalHelper/Compiletime/Wrapper.hs#L162

@ghost
Copy link
Author

ghost commented Dec 29, 2018

Oh, you are right. Thanks. I appended a path for ghc into my .zshrc file following. And the error was gone. Is this a right way to fix this error, especially the path for ghc ?:

export PATH=~/.stack/programs/x86_64-osx/ghc-8.6.3/bin:$PATH

Or

export PATH=$(stack path | grep ^bin-path):$PATH

@alanz
Copy link
Collaborator

alanz commented Dec 29, 2018

you can also use

export PATH=$(stack path --compiler-exe):$PATH

@ghost
Copy link
Author

ghost commented Dec 30, 2018

I assume --compiler-exe should be --compiler-bin... :)

$ stack path --compiler-exe
/Users/foo/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc

$ stack path --compiler-bin
/Users/foo/.stack/programs/x86_64-osx/ghc-8.6.3/bin

@FledgeXu
Copy link

Hey Guys,I have the same problem.

  ls -l /Users/fledge/Develpment/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.5/8.6.3/bin/cabal-helper-wrapper
-rwxr-xr-x  1 fledge  staff  7089880 Feb 21 20:41 /Users/fledge/Develpment/haskell-ide-engine/.stack-work/install/x86_64-osx/lts-13.5/8.6.3/bin/cabal-helper-wrapper

When I run the cabal-helper-wapper, It shows:

cabal-helper-wrapper: dieVerbatim: user error (cabal-helper-wrapper: The program 'ghc' version >=7.0.1 is required but it
could not be found.
)

what should I do?

Should I install ghc above 7.0 by stack?

@ghost
Copy link
Author

ghost commented Feb 22, 2019

@FledgeXu You should add ghc command to PATH environment variable of your shell.

@FledgeXu
Copy link

@jinbeomhong It works! Thank you for your help.

@krikchaip
Copy link

I assume --compiler-exe should be --compiler-bin... :)

$ stack path --compiler-exe
/Users/foo/.stack/programs/x86_64-osx/ghc-8.6.3/bin/ghc

$ stack path --compiler-bin
/Users/foo/.stack/programs/x86_64-osx/ghc-8.6.3/bin

Hi there,
I already did this. but the error still occurs 😕

screen shot 2562-02-25 at 17 36 50

screen shot 2562-02-25 at 17 38 23

screen shot 2562-02-25 at 17 47 15

$ haskell-ide-engine/.stack-work/install/x86_64-osx/lts-12.26/8.4.4/bin/cabal-helper-wrapper print-build-platform
x86_64-osx
$ stack ghc -- --version
The Glorious Glasgow Haskell Compilation System, version 8.4.4

@KillyMXI
Copy link

I got this on Windows 10.
I would love to not depend on workarounds for this issue.

@luochen1990
Copy link

Following is my workaround (as a summarize of @alanz and @jinbeomhong 's above comment):

add export PATH="$(stack path --compiler-bin):$PATH" to rc file, so that the command ghc works, and this issue gone.

@Rizary
Copy link

Rizary commented Jun 25, 2019

Hi... I got the following error when trying to run vscode-hie-server extension on my WSL.

Got error while processing diagnostics: readCreateProcess: /nix/store/1i3fyx4wywvkzz1fcji6zysshvxvx5ja-cabal-helper-0.9.0.0/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/home/rizary/Haskell/alltuts/fp-course" "/home/rizary/Haskell/alltuts/fp-course/dist" "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

I am using all-hies and hvr:ppa for my cabal and ghc/ghcjs binary.

One thing that I noticed here is that cabal-helper put this "v1-style" "/home/rizary/Haskell/alltuts/fp-course" "/home/rizary/Haskell/alltuts/fp-course/dist" argument automatically whereas I'm using v2-style and the dist folder is not existed (dist-newstyle is).

So I try to run it manually and change it into:

"--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v2-style" "/home/rizary/Haskell/alltuts/fp-course" "/home/rizary/Haskell/alltuts/fp-course/dist-newstyle" "package-db-st
ack" "flags" "compiler-version" "ghc-merged-pkg-options" "config-flags" "non-default-config-flags" "ghc-src-options" "ghc-pkg-options" "ghc-lang-op
tions" "ghc-options" "source-dirs" "entrypoints" "needs-build-output"

and get the following output:

  course-0.1.4-in place
  course-0.1.4-in place-tasty

Is this output already what is intended by cabal-helper-wrapper? Or how can I have plan.json?

Does this issue still relevant to this thread?

@infinisil
Copy link

I think as of now HIE doesn't work well with the new-style commands (haskell/haskell-ide-engine#962 is related). For my development I'm therefore still using the old-style commands.

@nwaywood
Copy link

I am getting this same error message:

Got error while processing diagnostics: readCreateProcess: /Users/nick/code/src/github.com/haskell/haskell-ide-engine/.stack-work/install/x86_64-osx/7dfa7340ecd7919dc6ad0bc2cca5d855561f4efbe97f9adff94af88edbcb34ed/8.6.5/bin/cabal-helper-wrapper "--with-ghc=ghc" "--with-ghc-pkg=ghc-pkg" "--with-cabal=cabal" "v1-style" "/Users/nick/code/src/github.com/nwaywood/fp-course" "/Users/nick/code/src/github.com/nwaywood/fp-course/dist" "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

But the solutions above do not work for me. When I run:

/Users/nick/code/src/github.com/haskell/haskell-ide-engine/.stack-work/install/x86_64-osx/7dfa7340ecd7919dc6ad0bc2cca5d855561f4efbe97f9adff94af88edbcb34ed/8.6.5/bin/cabal-helper-wrapper print-build-platform

The output is x86_64-osx

But when I run the full command from the error message I get:

cabal-helper-wrapper: /Users/nick/code/src/github.com/nwaywood/fp-course/dist-newstyle/build/x86_64-osx/ghc-8.6.5/course-0.1.4/setup-config: openFile: does not exist (No such file or directory)

The dist-newstyle directory seems to be auto created from this plugin so I'm not sure how to proceed from here. Any debugging hints or solutions would be appreciated. Thanks

@jneira
Copy link
Member

jneira commented Jan 9, 2020

hie not longer uses cabal-helper-wrapper and it is able to start using stack if there is no ghc on path so i think this should be fixed with latest versions of hie and the extension: @srcdes @FledgeXu @krikchaip @KillyMXI @Rizary @luochen1990 feel free to reopen if it is not the case

@jneira jneira closed this as completed Jan 9, 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

9 participants