Error installing haskelly to use with VSCode - haskell

I'm trying to install Haskelly so that I can use VSCode to build and debug Haskell. The issue here is that when I try to install intero, Quick Check and stack-run using the following command:
stack install intero QuickCheck stack-run
I get the following error:
Error: While constructing the build plan, the following exceptions
were encountered:
In the dependencies for stack-run-0.1.1.4:
conduit-1.3.1.1 from stack configuration does not match >1.1 && <1.3 (latest matching version is 1.2.13.1)
conduit-extra-1.3.4 from stack configuration does not match >=1.1 && <1.2 (latest matching version is 1.1.17) needed since stack-run is
a build target.
Some different approaches to resolving this:
Set 'allow-newer: true' in C:\sr\config.yaml to ignore all version
constraints and build anyway.
Recommended action: try adding the following to your extra-deps in
C:\sr\global-project\stack.yaml:
conduit-1.2.13.1#sha256:afd4db7fe66ae7af3d418e1a932384a8dee08df2f6299cca80e53ba964ce1228,4371
conduit-extra-1.1.17#sha256:dfa0d00dc11a8a4c3fdff15374c378ee34c25a2255b52194aa1ea3c1f1a63fd7,4521
Plan construction failed.
Now while it does provide some clues as to what I'm supposed to do, I have no clue what it means to add these things to stack.yaml. I found stack.yaml, and it's just a file that I seemingly can't open or modify. Does anyone know how I can fix this issue?

This is a problem installing stack-run, documented here: https://github.com/yamadapc/stack-run/issues/21.
I solved it by adding the following to my stack.yaml:
extra-deps:
- url: https://github.com/Magicloud/stack-run/archive/master.zip

Related

stack install error: Recommended extra-dep

I am currently trying to install stack to utilise the software Taiji. I have been able to run 'stack setup', but get an error when I run stack install:
C:\Users\My Name\Taiji-1.2.1>stack install
Error: While constructing the build plan, the following exceptions were encountered:
In the dependencies for shelly-1.8.1:
unix needed, but the stack configuration has no specified version (latest matching version is 2.7.2.2)
needed due to Taiji-1.2.1 -> shelly-1.8.1
Some different approaches to resolving this:
* Recommended action: try adding the following to your extra-deps in C:\Users\My Name\Taiji-1.2.1\stack.yaml:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
Plan construction failed.
I am guessing I'll have to install another package of some sort and put it into the Taiji-1.2.1 folder, but am not exactly sure how(I am completely new to stack/programming). Is anyone able to help me with this issue? Thanks kindly.
When you see this error, you will need to open stack.yaml (the error message contains the full path), find the line saying # extra-deps: [], and replace it with the line shown in the error message:
extra-deps:
- unix-2.7.2.2#sha256:9e93f93cc5a065248120136e83a0a6d1ce93d6eb5ef2a2543f9593e93e164d24,3496
(If you already have something listed in extra-deps, then you can just add that line to the end of extra-deps rather than replacing the whole thing.)
Now, this is usually enough. But you’ve got a further problem: you are using Windows, but you’re trying to compile a program which depends on the unix package — a package which is not available on Windows. Due to this, you will not be able to compile your program on Windows.
(As for why all that extra-deps stuff is needed: basically, Stack maintains a list of package versions known to work with each other, but occasionally you will run into a package which isn’t in that list. In that case you will need to list that package version in extra-deps to tell Stack which version to use.)

stack is unable to resolve dependencies instaling wx

I am trying to get wx installed using stack. I don't have Haskell installed globally and use stack new <app> new-template to create a new project. Next, within the directory I run stack install wx and get an error message:
In the dependencies for wx-0.92.3.0:
wxcore must match >=0.92, but the stack configuration has no specified
version (latest matching version is 0.92.3.0)
Following-up the recommended actions and rerunning stack install wx a couple of times, the extra-deps list looks like this:
- wxcore-0.92.3.0
- wxc-0.92.3.0
- wxdirect-0.92.3.0
- Cabal-1.24.2.0
- process-1.4.3.0
- base-4.10.1.0
at this point, stack complains:
In the dependencies for process-1.4.3.0:
base-4.11.1.0 from stack configuration does not match >=4.4 && <4.11
(latest matching version is 4.10.1.0)
and suggesting to add base-4.10.1.0 again, but which is already there.
Q: so, how should I install wx?
Is it really that hard to get wxHaskell going? Should I start using cabal instead of stack?
I use the latest stack version 1.7.1 with lts-12.4 as the resolver.
A similar question was posted back in 2015.
The hint given by Stéphane Laurent works! On my Debian 9 (stretch) I used the following steps:
Install the required libraries
sudo apt-get install libwxgtk3.0-dev libwxgtk-webview3.0-dev libwxgtk-media3.0-dev
Create a stack project with stack new <app> new-template and change to the <app> directory
Make the following changes to the stack.yaml file:
resolver: lts-8.16
extra-deps:
- wxdirect-0.92.3.0
- wxc-0.92.3.0
- wxcore-0.92.3.0
- wx-0.92.3.0
Run stack install wx and be patient!
Add - wx to the list of dependencies in the package.yaml file

Installing specific versions via stack

So I suppose the problem I'm really trying to solve is that when I run ghc-mod I get this error:
CabalHelper/Licenses.hs|53 col 18 error| error: Ambiguous occurrence ‘lookupInstalledPackageId’
I found this relevant issue:
https://github.com/DanielG/ghc-mod/issues/772
Where it suggests installing ghc-mod from github,
I'd like to do everything via stack if possible (just to avoid mixing too many environments), but I couldn't find a way to specify either a version or how to specify a github repo with stack install.
I also continually run into errors from stack saying that it found version x when version y was required, but I can't seem to figure out how to get it to install version x anyways.
Anyone know how I can install the latest version of ghc-mod? Preferably with stack.
This was implemented recently. https://github.com/commercialhaskell/stack/issues/2028
Just use:
stack install ghc-mod-5.0.0
or any other version you like.

IntelliJ Haskell plugin: ghc-modi failed with error

I just installed IntelliJ idea and the official Haskell plugin.
IntelliJ couldn't find ghc-modi.exe, so I installed ghc-mod through cabal.
However, after importing my cabal project, I am still receiving the following error:
ghc-modi failed with error: NG BUG: GMECabalFlags (GMEString "extractField: failed extracting configFlags from input, input contained `configFlags'? False")
How can I solve or get more information on this error?
Thanks in advance.
This question has been answered by Atsky on GitHub:
This is internal problem of ghc-mod. It fails to read file dist/setup-config for some reason.
Try to remove dist folder from your project and then run cabal config.

install yesod with stackage failed

environment:
ubuntu14.04
haskell platform 2014 2.0.0 (ghc 7.8.3,cabal 1.18.13)
stackage:Stackage build for GHC 7.8 + Haskell Platform, 2014-09-24, exclusive
according to http://www.yesodweb.com/page/quickstart , I ran:
dsu#dsu-G41MT-D3:~$ cabal install alex happy yesod-bin
Resolving dependencies...
Configuring ansi-terminal-0.6.1.1...
Configuring alex-3.1.3...
Downloading unix-time-0.3.4...
Failed to install ansi-terminal-0.6.1.1
Last 10 lines of the build log ( /home/dsu/.cabal/logs/ansi-terminal-0.6.1.1.log ):
Configuring asn1-types-0.2.3...
Configuring auto-update-0.1.1.3...
Failed to install alex-3.1.3
Last 10 lines of the build log ( /home/dsu/.cabal/logs/alex-3.1.3.log ):
Failed to install asn1-types-0.2.3
Configuring base-unicode-symbols-0.2.2.4...
Last 10 lines of the build log ( /home/dsu/.cabal/logs/asn1-types-0.2.3.log ):
Failed to install auto-update-0.1.1.3
Last 10 lines of the build log ( /home/dsu/.cabal/logs/auto-update-0.1.1.3.log ):
Configuring base64-bytestring-1.0.0.1...
Configuring blaze-builder-0.3.3.4...
Failed to install base-unicode-symbols-0.2.2.4
Last 10 lines of the build log ( /home/dsu/.cabal/logs/base-unicode-symbols-0.2.2.4.log ):
Failed to install unix-time-0.3.4
Last 10 lines of the build log ( /home/dsu/.cabal/logs/unix-time-0.3.4.log ):
cabal: /home/dsu/.cabal/logs/unix-time-0.3.4.log: does not exist
It simply says "fail to install" and give no any hints.Why use of stackage still has these problems?
This generic cabal debugging advice usually finds the problem....
Update the cabal database, try again
cabal update
cabal install ....
Try to install the dependency with the problem separately.... Looking above, it seems I see a few lines that start with "Failed to install....", test these separately.
cabal install base-unicode-symbols
Recurse if necessary.
Download the package that fails,
cabal unpack base-unicode-symbols
cd base-unicode-symbols-*
Configure to see if its dependencies are all loaded
cabal configure
If not, recurse into the troubled package.
Try to build the package
cabal build
If it doesn't work, you now have useful error messages. If you can fix the problem, great, else repost the information here.
Install
cabal install
In more drastic cases, you might want to delete (actually, just move it in case you want it back) your ~/.cabal/* contents, or your ~/.ghc/* contents, but leave this as a last resort, because you will have to reinstall all cabal packages. Also, you might want to keep the contents of ~/.cabal/bin/*.
I just updated Stackage Server to use FP Complete's Hackage mirror (which is Amazon S3 powered) instead of Hackage itself. That should make it completely resilient to Hackage downtime. Thanks for raising this issue, we definitely want Stackage to have better uptime guarantees than Hackage.
I've encountered the same problem. I have resolved it by temporarily deleting my HTTP_PROXY environment variable to not have cabal try to connect through an unreachable server.

Resources