10

Would love to try the Yi editor, but unfortunately, it keeps failing during the installation.

First I get:

> cabal install yi
haskell-src-exts-1.13.0 failed during the configure step. The exception was:
ExitFailure 1
yi-0.6.5.0 depends on haskell-src-exts-1.13.0 which failed to install.

then when I try to install haskell-src-exts I am stumped by this:

setup: The program happy version >=1.17 is required but it could not be found.
cabal: Error: some packages failed to install:
haskell-src-exts-1.13.0 failed during the configure step. The exception was:
ExitFailure 1

installing happy cabal install happy (version 1.18.9 at that) does not help, as it still produces the error above!

I am trying to get this going on ArchLinux. Also, Windows installation didn't work either.

Any ideas?

Andriy Drozdyuk
  • 58,435
  • 50
  • 171
  • 272

5 Answers5

17

cabal installs programs to ~/.cabal/bin (on Unix; no idea about Windows) if they are not already installed, and does not warn you to add it to your $PATH; it also (unless you have the latest unreleased version, built from its repo) does not know that it has done so, because it only tracks libraries, not executables. You will need to manually add $HOME/.cabal/bin to your $PATH so that it will be found

(edit be pedantic)

geekosaur
  • 59,309
  • 11
  • 123
  • 114
  • Hm... that didn't work. I can run `happy` fine from console, but install still can't find it. – Andriy Drozdyuk Apr 10 '12 at 19:40
  • Then we'll need to see the `-v3` output as requested by @DanielFischer above. – geekosaur Apr 10 '12 at 19:46
  • @drozzy Did you remember to `export` your `PATH` so that more than just your shell can see it? – Daniel Wagner Apr 10 '12 at 19:51
  • Yes, but as it worked interactively, that shouldn't have been the problem. – geekosaur Apr 11 '12 at 01:14
  • @geekosaur: there's a difference: `~/` is expanded by your shell, so it works in bash, etc.; **however** `cabal-install` doesn't run within a shell, so it doesn't get expanded. – ivanm Apr 11 '12 at 07:28
  • *sigh* I'm quite aware of it (and in fact have raised this exact point on various Haskell mailing lists in the past), *but* when it's been put in `$PATH` it's going to behave the same way interactively or in a program. Since the OP reports it working interactively as already set in `$PATH`, it is working. – geekosaur Apr 11 '12 at 07:32
  • @geekosaur: no it doesn't, quite often that has failed in the past (unless cabal-install now goes and expands `$PATH` itself) whereas using `$HOME` results in it working. – ivanm Apr 11 '12 at 10:45
  • I've just checked this myself: if you use `~/.cabal/bin/` in your `$PATH` then cabal-install isn't able to use it to find build-tools such as happy, alex, the various gtk2hs buildtools, etc. – ivanm Apr 11 '12 at 10:55
  • @ivanm that's not the question, if you have `~` embedded in `$PATH` you are asserting that `bash` will handle it, and it doesn't any better than `cabal` does. OP said `PATH` search worked, therefore `~` character is *not* in their `$PATH`. – geekosaur Apr 11 '12 at 17:19
  • 1
    @ivanm `$HOME` is the right way, but normally [I'm not a shell expert, don't know which versions handle it differently] `~` is only a problem if it's quoted in `.bash_rc` (or `.profile`, ...). If unquoted, it's expanded before `cabal` sees it, but if quoted, the `PATH` obtained from the shell contains the actual `~` character. Then you depend on the programme searching for the command to run doing tilde-expansion. The shell does, so alex, say, is callable from the command line; but cabal won't find it. – Daniel Fischer Apr 11 '12 at 21:18
  • @geekosaur: using `~` works in bash for me but not with cabal-install, so it *does* make a difference. – ivanm Apr 11 '12 at 22:05
  • it is important to add it in the *beginning* of the string in the $PATH variable. Otherwise you may end up executing some older version of the binary that was installed system-wide. – user7610 Oct 04 '13 at 11:53
5

On ubuntu I installed happy using apt-get instead of through cabal, which worked.

Kathy Van Stone
  • 25,531
  • 3
  • 32
  • 40
1

Here is what I have done to install Yi with GTK+ under ArchLinux.

First, I tried cabal install yi and I got the same error as you.

To solve this error, I installed happy using this command:

yaourt -S happy

Then, I got another error because the alex package was needed. So, I installed it with:

yaourt -S alex

After that, I got some errors because of gtk2hs packages missing. I installed them with:

yaourt -S haskell-cairo haskell-glib haskell-gtk haskell-pango

Finally, I was able to install Yi with:

cabal install yi -fvty -fpango
antoyo
  • 11,097
  • 7
  • 51
  • 82
1

I had the same issue in installing hprotoc which has a dependency on haskell-src-exts. The issue I believe was that I was running the sudo command which was modifying the path. When I took the recommended action in the following Q&A, it resolved the issue of finding happy.

sudo changes PATH - why?

Community
  • 1
  • 1
Nelson
  • 511
  • 4
  • 5
0

Leksah uses Yi as a component, try installing leksah instead. I had similar error messages at one point, the haskell-src-exts error is due to running out of memory. Reboot your computer, have nothing else running except the console, and try again.

Raahul Kumar
  • 59
  • 1
  • 4