stack is unable to resolve dependencies instaling wx - haskell

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

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.)

Getting started with stack on Windows

I am trying to learn how to use stack to build Haskell project. I run from a command line:
stack new helloworld new-template
cd helloworld
stack build
I get
Error parsing targets: The specified targets matched no packages.
Perhaps you need to run 'stack init'?
Any idea? I am on Windows.
Try to upgrade your stack version with stack upgrade, you might be using some outdated or unstable version.

Error installing haskelly to use with VSCode

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

Aeson error building test yesod-sqlite project

I'm new to yesod and just trying to use stack to build one or two basic sites from the templates but I get an Aeson error when I do. There is a discussion of the error message here [0] but it is apparently fixed in 1.6.1 and I'm using 1.6.3. This is what I'm trying:
$ stack --version
Version 1.6.3
$ stack new yesod-project yesod-sqlite
Downloading template "yesod-sqlite" to create project "yesod-project" in yesod-project/ ...
Looking for .cabal or package.yaml files to use to init the project.
Using cabal packages:
- yesod-project/
Selecting the best among 12 snapshots...
* Matches lts-10.5
Selected resolver: lts-10.5
Initialising configuration using resolver: lts-10.5
Total number of user packages considered: 1
Writing configuration to file: yesod-project/stack.yaml
All done.
$ cd yesod-project/
$ stack build
$ stack exec -- yesod devel
Yesod devel server. Enter 'quit' or hit Ctrl-C to quit.
Application can be accessed at:
http://localhost:3000
https://localhost:3443
If you wish to test https capabilities, you should set the following variable:
export APPROOT=https://localhost:3443
Downloading lts-10.5 build plan ...
Downloaded lts-10.5 build plan.
AesonException "Error in $.packages.cassava.constraints.flags['bytestring--lt-0_10_4']: Invalid flag name: \"bytestring--lt-0_10_4\""
Type help for available commands. Press enter to force a rebuild.
[0] https://github.com/commercialhaskell/stack/issues/3634
If you run stack exec -- stack --version I bet you will find that it is older than 1.6.3. You should probably delete the stack binary at stack exec -- which stack
mgsloan's assessment of the cause is correct, at least in my case.
Solution-wise, I'm guessing deleting the stack binary forces it to upgrade. For those who are hesitant to delete stack, stack upgrade did the trick for me.

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