Installing Haskell on Windows, cabal config
Asked Answered
D

2

4

I'm installing Haskell on Windows based on the instructions at https://www.haskell.org/platform/ and looking at step 3, it says, Modify your cabal config file (you can verify the location by running "cabal user-config init") to contain the following lines:

extra-prog-path: C:\Program Files\Haskell Platform\8.0.2\msys\usr\bin
extra-lib-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\lib
extra-include-dirs: C:\Program Files\Haskell Platform\8.0.2\mingw\include

But the auto generated config file contains e.g.

extra-prog-path: C:\Users\w\AppData\Roaming\cabal\bin

So that's a different value for one of the suggested variables.

Is this intentional?

What should I do, paste the lines from step 3 at the start of the file, the end of the file, overwrite the existing lines or skip step 3 altogether?

Deoxygenate answered 2/3, 2017 at 12:14 Comment(6)
"What should I do" isn't really a question - only you can know what your environment looks like, if it is appropriate to keep one or the other, or both paths (extra-prog-path can be a list of paths separated by commas). What doesn't work if you replace the existing paths, or don't replace them, or include both? Two asides; having spaces in the path will probably lead to issues down the line; and why aren't you using stack (it is the 2nd option on the downloads page)?Diu
@Diu I don't know what's appropriate here because I'm not familiar with the Haskell environment. I've left it alone for the moment and I'm making an attempt to use Stack (it seems to have been automatically installed) since Google search said it was better (is that true?) stack install hfmt has been updating package index for twenty minutes now; is that supposed to happen?Deoxygenate
But neither is SO familiar with your environment - I don't know the contents of the C:\Users\w\AppData\Roaming\cabal\bin directory, nor if it even exists. Yes, it takes a long time (it's never taken me 20 minutes, but of course this depends on the speed of your internet connection) to fetch the package index the first time, but this is no different for plain cabal without stack. To be sure all is going well, you can run stack with -v (verbosity) - it will print the progress of the downloads.Diu
@Diu Well, this is starting with a clean install of Haskell, so whatever a clean install would produce. Okay, if Stack is supposed to be taking a long time to fetch the package index the first time, that's no problem, just want to make sure it wasn't hung or anything. Thanks!Deoxygenate
Related Q: https://mcmap.net/q/1845504/-how-to-modify-cabal-config-file-on-windows/2157640Esta
This question is about the Haskell Platform installation procedure. Clean install, no modifications -- the environment is sufficiently defined by the installer. I am pretty sure the original extra-prog-path should be used and the new extra-prog-path should be added, @user2407038. For newbies, Haskell Platform installation instructions for WIndows are hard to follow because of unfamiliarity of Cabal's user config syntax.Esta
N
1

I have cabal-install version 2.4.1.0. As proposed in https://www.haskell.org/cabal/users-guide/nix-local-build.html and contrary to the installing instructions at https://www.haskell.org/platform/windows.html, I'm using one single extra-prog-path line containing a comma separated list of paths:

extra-prog-path: C:\Users\...\AppData\Roaming\cabal\bin,C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin

Reason: Like this, at least the command cabal user-config diff gives reasonable results.

C:\>cabal user-config diff
+ extra-include-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\include
+ extra-lib-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\lib
- extra-prog-path: C:\Users\...\AppData\Roaming\cabal\bin
+ extra-prog-path: C:\Users\...\Roaming\cabal\bin,C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin
+ logs-dir: C:\Users\...\AppData\Roaming\cabal\logs

If I'd follow the installing instructions and use two extra-prog-path lines, then cabal user-config diff would ignore the second one. I'm not sure however if this matters.

Nisa answered 20/2, 2020 at 10:12 Comment(0)
B
1

You don't need to overwrite existing lines. You can have multiple extra-prog-path entries and they all get used.

Beffrey answered 21/8, 2017 at 3:46 Comment(0)
N
1

I have cabal-install version 2.4.1.0. As proposed in https://www.haskell.org/cabal/users-guide/nix-local-build.html and contrary to the installing instructions at https://www.haskell.org/platform/windows.html, I'm using one single extra-prog-path line containing a comma separated list of paths:

extra-prog-path: C:\Users\...\AppData\Roaming\cabal\bin,C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin

Reason: Like this, at least the command cabal user-config diff gives reasonable results.

C:\>cabal user-config diff
+ extra-include-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\include
+ extra-lib-dirs: C:\Program Files\Haskell Platform\8.6.5\mingw\lib
- extra-prog-path: C:\Users\...\AppData\Roaming\cabal\bin
+ extra-prog-path: C:\Users\...\Roaming\cabal\bin,C:\Program Files\Haskell Platform\8.6.5\msys\usr\bin
+ logs-dir: C:\Users\...\AppData\Roaming\cabal\logs

If I'd follow the installing instructions and use two extra-prog-path lines, then cabal user-config diff would ignore the second one. I'm not sure however if this matters.

Nisa answered 20/2, 2020 at 10:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.