Closed pavanetti closed 8 years ago
@carlos-pavanetti please see https://github.com/atom-haskell/haskell-ghc-mod#configuration
@lierdakil Can you please explain in more detail?
The description on that linked website tells me I need to add ghc-mod
to my PATH
somehow. In .bashrc? I installed haskell-ghc-mod
using apm
, however, I have no idea what path to add to my PATH
now.
See https://github.com/atom-haskell/haskell-ghc-mod/blob/master/README.md#dependencies
It's package readme file btw. 24 янв. 2016 г. 3:40 пользователь "hwroitzsch" notifications@github.com написал:
@lierdakil https://github.com/lierdakil Can you please explain in more detail?
The description on that linked website tells me I need to add ghc-mod to my PATH somehow. In .bashrc? I installed haskell-ghc-mod using apm, however, I have no idea what path to add to my PATH now.
— Reply to this email directly or view it on GitHub https://github.com/atom-haskell/haskell-ghc-mod/issues/81#issuecomment-174238817 .
Hi there, I'm a noob to both mac and haskell so you might get frustrated! So, how should one install this haskell mod in a step to step way? I installed all required packages for IDE in ATOM itself, but I guess I have to configure some things in terminal, with which I'm not very confident handling (like setting up PATH and all that). Thanks a bunch for any help.
Thank you
@Addibro I resorted to using stack instead:
http://docs.haskellstack.org/en/stable/README.html
You basically do the following:
.bashrc
file: add the program's directory to PATH like this: PATH=$PATH:/your/directory/here/
.bashrc
file: add eval "$(stack --bash-completion-script stack)".bashrc
file is read.stack ghci
in that directory.This was written from memory, could be that I forgot a step.
@hwroitzsch Hi and thanks for replying. So you work completely in terminal instead of Atom then?
@Addibro
For stack
usage yes, completely in the terminal. I am not aware of any Atom packages, which enable one to do these steps from inside Atom, but there might be some. I prefer to work on the command line for doing such things, as I don't have to rely on the correctness of any packages of Atom this way.
However, the Haskell packages for Atom I installed using Atom's GUI. There are a few and you could also install them with the apm
command on command line.
@Addibro, what OS are you on?
In any case, you need Haskell Platform installed. Then you can do this (from terminal):
mkdir ghc-mod
cd ghc-mod
cabal sandbox init --sandbox=.
cabal update
cabal install ghc-mod
This will install ghc-mod into ghc-mod/bin
. If you ever need to update ghc-mod, you just remove ghc-mod
directory and repeat those steps. This takes care of dependencies. Remember the directory that you installed ghc-mod into.
Now for setup.
You need to either specify full path to ghc-mod executable in haskell-ghc-mod settings, specifically in 'Ghc Mod Path' (e.g. .../ghc-mod/bin/ghc-mod
), or add path to .../ghc-mod/bin
to 'Additional Path Directories'. To open haskell-ghc-mod settings, in Atom open 'Edit' -> 'Preferences', select 'Packages', find `haskell-ghc-mod', and click 'Settings' (or package name).
Please note that on Atom 1.4.0 and up, there is a bug (https://github.com/atom/atom/issues/10426) which prevents settings from showing up unless package is activated, and it only activates on Haskell files. Sorry, can't do much about it on my end :(
If you're on OSX, there exists some PATH weirdness with Atom, so I suggest you start it from terminal to save some headache. If you want to start it from Finder, read on.
You will need to add your shell PATH to 'Additional Path Directories' setting in haskell-ghc-mod
package settings, and to ide-haskell-cabal
settings (select relevant GHC version as active, and paste your shell PATH as 'Path for GHC 7.X').
To get shell PATH, run echo $PATH
from terminal. Note, that you need to replace :
(semicolons) with ,
(commas) when adding to 'Additional Path Directories'. Not the case with 'Path for GHC 7.X'.
I know all this is somewhat awkward. Sorry. Didn't notice some of this until recently (since ide-haskell-cabal wasn't written by me). As soon as I have some substantial free time, I will try to pull my crap together and make this whole thing easier.
[Enter steps to reproduce below:]
Atom Version: 1.3.2 System: linux 4.3.3-2-ARCH Thrown From: haskell-ghc-mod package, v1.4.1
Stack Trace
Haskell-ghc-mod: ghc-mod failed to launch. It is probably missing or misconfigured. ENOENT
Commands
Config
Installed Packages