kazu-yamamoto / hhp

Happy Haskell Programming
BSD 3-Clause "New" or "Revised" License
67 stars 5 forks source link

Emacs front-end not installed? #8

Closed mouse07410 closed 5 years ago

mouse07410 commented 5 years ago

I installed hhp via cabal, as your README->Install page suggested, via cabal install hhp.

Installation appeared to succeed, and resulted in hhpc and hhpi placed in ~/.cabal/bin, just as expected.

However, Emacs front-end was not installed, and there's nothing in ~/.cabal/share.

I successfully built haskell-mode and added the (autoload ... stuff to the init file, but the mode doesn't work because Emacs front-end is not installed.

I'm getting error:

File mode specification error: (file-missing Cannot open load file No such file or directory hhp)

To prove that the relevant files are there:

$ ll ~/.cabal/bin
total 0
drwxr-xr-x   6 ur20980  MITLL\Domain Users  192 Mar 28 14:35 ./
drwxr-xr-x@ 12 ur20980  MITLL\Domain Users  384 Mar 28 12:28 ../
lrwxr-xr-x   1 ur20980  MITLL\Domain Users   55 Feb 23 23:05 cabal@ -> ../store/ghc-8.6.3/cbl-nstll-2.4.1.0-61b5e16a/bin/cabal
lrwxr-xr-x   1 ur20980  MITLL\Domain Users   30 Mar 28 14:35 hhpc@ -> ../../Library/Haskell/bin/hhpc
lrwxr-xr-x   1 ur20980  MITLL\Domain Users   30 Mar 28 14:35 hhpi@ -> ../../Library/Haskell/bin/hhpi
lrwxr-xr-x   1 ur20980  MITLL\Domain Users   41 Mar 28 12:34 stylish-haskell@ -> ../../Library/Haskell/bin/stylish-haskell
$ ll ~/Library/Haskell/bin/hhp*
-rwxr-xr-x  1 ur20980  admin  78305656 Mar 28 14:35 /Users/ur20980/Library/Haskell/bin/hhpc*
-rwxr-xr-x  1 ur20980  admin  78270104 Mar 28 14:35 /Users/ur20980/Library/Haskell/bin/hhpi*
$ 

Could you help please?

mouse07410 commented 5 years ago

Probably a pilot error. I think I got it working on another machine, so I'm closing this ticket.

mouse07410 commented 5 years ago

Weird - on this machine I'm unable to locate the Front-end:

$ cabal install hhp
Warning: The install command is a part of the legacy v1 style of cabal usage.

Please switch to using either the new project style and the new-install
command or the legacy v1-install alias as new-style projects will become the
default in the next version of cabal-install. Please file a bug if you cannot
replicate a working v1- use case with the new-style commands.

For more information, see: https://wiki.haskell.org/Cabal/NewBuild

Warning: the following files would be used as linker inputs, but linking is not being done: /usr/lib/libiconv.dylib /usr/lib/libiconv.dylib
Resolving dependencies...
Starting     clock-0.7.2
Starting     base-orphans-0.8.1
Starting     colour-2.3.4
Downloading  dlist-0.8.0.6
Starting     data-default-class-0.1.2.0
Starting     old-locale-1.0.0.7
Starting     integer-logarithms-1.0.2.2
. . . . .
Completed    aeson-1.4.2.0
Starting     yaml-0.11.0.0
Building     yaml-0.11.0.0
Completed    yaml-0.11.0.0
Starting     hlint-2.1.15
Building     hlint-2.1.15
Completed    hlint-2.1.15
Starting     hhp-0.0.0
Building     hhp-0.0.0
Completed    hhp-0.0.0
Updating documentation index
/Users/ur20980/Library/Haskell/share/doc/x86_64-osx-ghc-8.6.4/index.html
$ type hhpc
hhpc is /Users/ur20980/.cabal/bin/hhpc
$ type hhpi
hhpi is /Users/ur20980/.cabal/bin/hhpi
$ ll ~/.cabal/share
total 0
drwxr-xr-x   2 ur20980  MITLL\Domain Users   64 Jul 27  2017 ./
drwxr-xr-x@ 12 ur20980  MITLL\Domain Users  384 Apr  1 18:01 ../
$ 

Help would be appreciated, as I'd prefer the standard installation path through released packages. Thanks!

kazu-yamamoto commented 5 years ago

In my case, I found:

~/.cabal/share/x86_64-osx-ghc-8.6.4/hhp-0.0.0/hhp.el

mouse07410 commented 5 years ago

In my case, I found: ~/.cabal/share/x86_64-osx-ghc-8.6.4/hhp-0.0.0/hhp.el

And in my case it isn't there:

$ ghc-pkg list hhp
/Users/uri/.ghcup/ghc/8.6.4/lib/ghc-8.6.4/package.conf.d
    (no packages)
/Users/uri/.ghc/x86_64-darwin-8.6.4/package.conf.d
    hhp-0.0.0
$ type hhpc
hhpc is /Users/uri/.cabal/bin/hhpc
$ find ~/.cabal -name hhp.el -print
$ 

Update

But I found it on both machines - thanks for your hint:

$ $ find ~/Library/Haskell -name hhp.el -print
/Users/uri/Library/Haskell/share/ghc-8.6.3-x86_64/hhp-0.0.0/hhp.el
$ 
mouse07410 commented 5 years ago

However, even though the correct (I think) paths are added to Emacs paths list, now it seems unable to locate hhpi and hhpc: From *Messages* buffer:

Loading paren...done
Importing package-keyring.gpg...done
Contacting host: elpa.gnu.org:443
Contacting host: stable.melpa.org:80
Contacting host: melpa.org:80
Package refresh done
For information about GNU Emacs and the GNU system, type C-h C-a.
Initializing...
"hhpc" not found
File mode specification error: (file-missing Searching for program No such file or directory hhpi)

Here's where they are:

$ ll ~/Library/Haskell/bin/hhp*
-rwxr-xr-x  1 uri  staff  78255536 Mar 28 19:57 /Users/uri/Library/Haskell/bin/hhpc*
-rwxr-xr-x  1 uri  staff  78219968 Mar 28 19:57 /Users/uri/Library/Haskell/bin/hhpi*
$

Here's the relevant (I think) part of ~/.emacs:

(dolist (dir '(
           "/usr/local/bin"
           "/usr/local/sbin"
           "/opt/local/bin"
           "/opt/local/sbin"
           "/Library/Haskell/bin"
           "/Users/uri/.ghcup/bin"
           "/Users/uri/.ghc/bin"
       "/Users/uri/Library/Haskell/bin"
       "/Users/uri/.local/bin"
           "/Users/uri/.cabal/bin"
           "/Users/uri/.cargo/bin"
          ))
(add-to-list 'exec-path dir))

Could you help further please?

mouse07410 commented 5 years ago

This turned out to be a problem with exec-path: ~/.emacs re-defined it after it was configured. After remedying that the "hhpc" not found error disappeared.