Stack has not been tested with GHC versions above 9.0 - haskell

I wandet to run my Code. I get this Kind of "Error".
Stack has not been tested with GHC versions above 9.0, and using 9.2.5, this may fail
Stack has not been tested with Cabal versions above 3.4, but version 3.6.3.0 was found, this may fail
Do i have to download a new Version of GHC?

Related

Is there a way for `stack --nix` to allow newer versions of ghc to be used?

I'm running stack --nix init for a new project (xmonad config) and getting error: attribute 'ghc863' missing, at (string):1:43; I have ghc 8.6.5 in the environment, and stack --version reports: 2.1.3.1 x86_64 hpack-0.32.0. My project is roughly following this blog post for building XMonad (with exceptions made to do things using Nix where possible), and so far only consists of cloning the three repos into .xmonad and running stack --nix init; the three repos are: xmobar, xmonad-contrib, xmonad.
Is there a way for stack --nix to allow newer versions of ghc to be used? Or are there other possible causes for the issue?
I saw stack --nix build complains about ghc version mismatch but felt this didn't really illuminate the issue, though it does suggest possibly alternatives using cabal/nix.

Stack only finds newer version of Cabal

I'm trying to build a project of mine using Stackage lts-13.12.
After Stack was complaining that the version of Cabal was too new, I've tried to install an older version:
cabal --version
cabal-install version 2.2.0.0
compiled using version 2.2.0.1 of the Cabal library
However, when I run stack solver, I get the following error:
Using configuration file: stack.yaml
Using cabal packages:
- ./
Using resolver: lts-13.12
Warning: Installed version of cabal-install (2.4.1.0) is newer than stack has been tested with. If you run into difficulties, consider downgrading.
Using compiler: ghc-8.6.4
Asking cabal to calculate a build plan...
Trying with packages from lts-13.12 and 1 external packages as hard constraints...
The following lines from cabal-install output could not be parsed:
optparse-applicative-0.14.3.0 (via: project-0.1.0.0 project-0.1.0.0) (new
package)
CallStack (from HasCallStack):
error, called at src/Stack/Solver.hs:174:16 in stack-1.9.3-F7FXKCpM3pk5wCtbL9Utvv:Stack.Solver
My questions are:
Why is Stack seeing the newer Cabal? How can I make it see the older one?
Why is Stack incompatible with Cabal 2.4.1.0, when that's the version in the Stackage LTS 13.12?
I'm running Version 1.9.3 of Stack, if that makes a difference.
Stack solver error messages are known to be bad and choke on cabal output. I don't believe this feature is well maintained.
I do wish stack would update its errors and warnings. Sticking with cabal-install-2.4.1.0 is probably the best choice.
Instead of using stack solver, I recommend you force it to use lts-13.12 and then add extra deps by hand to address any issues you encounter. Most of the time stack will helpfully recommend the right extra deps (without using the solver), but you do need to apply some intuition to make sure they are right.

stack 1.6.5 not working with cabal 2.0.0.1

I have stack 1.6.5 but see the error described in Cabal 2.0 required when using a nightly snapshot with stack. I understand that the problem was solved in stack v 1.5.1, but I see it in 1.6.5:
Using resolver: lts-11.2
Warning: Installed version of cabal-install (2.0.0.1) is newer than stack has been tested with. If you run into difficulties, consider downgrading.
Using compiler: ghc-8.2.2
Asking cabal to calculate a build plan...
Trying with packages from lts-11.2 and 3 external packages as hard constraints...
The following lines from cabal-install output could not be parsed:
abstract-par-0.3.3 (via: monad-par-0.3.4.8 monad-par-extras-0.3.3) (new
package)
base-compat-0.9.3 (via: criterion-1.3.0.0 criterion-1.3.0.0 aeson-pretty-0.8.5
aeson-1.2.4.0 quickcheck-instances-0.3.18) (new package)
stack upgrade gives:
frank#oporto:~/Workspace8/LitTextWork/LitText$ stack upgrade
Current Stack version: 1.6.5, available download version: 1.6.5
Skipping binary upgrade, you are already running the most recent version
I assume that the output is harmless, but should be bypassed in this version? How would I downgrad the cabal? What is the last cabal version recommended?
Stack issues #3453 and #3799 suggest this is a known bug in Stack. Until a fix for it lands, a makeshift workaround suggested in a comment to #3453 is using stack --resolver lts-9 install cabal-install to install cabal-install 1.24.0.2 (the executable, not the library).
Caveats:
The workaround assumes the local installation path Stack uses (cf. what stack path --local-bin tells you) has priority over the path of the globally installed cabal-install in hour PATH environment variable, or if you don't have a globally installed cabal-install to begin with (e.g. if you aren't using the Haskell Platform).
As hvr points out, this is not officially supported as far as Cabal and GHC are concerned, and you might run into further issues if features from newer cabal-install versions ever turn out to be necessary while using the solver via Stack.
If you ever need or want to have an up-to-date cabal-install, just use stack install cabal-install -- which will do it with the resolver you are using elsewhere. (If you have a globally installed cabal-install and want to go back to using it, you can simply delete the Stack-installed one from the location indicated by stack path --local-bin.)

Cannot cabal install hs3 (for haskell-supercollider)

(Ubuntu 12.04)
Hello!
I'm trying to get hs3 installed to my haskell platform so that I can use the haskore-supercollider package (it's a required dependency). However, when I attempt cabal install, it crashes on the some files I believe to be related to hosc. Here's a text readout of the error:
Sound/SC3/UGen/Help.hs:26:46: Not in scope: `lookupEnv'
cabal: Error: some packages failed to install:
hsc3-0.15 failed during the building phase. The exception was:
ExitFailure 1
I've attempted a number of things including updating cabal, reinstalling hosc, and throwing some flags on the install, or getting the install from a different source (slavepianos.org). Still though, I keep getting the same error. Here's an image of the error for reference:
http://i.stack.imgur.com/dGEKx.png
Thanks for your help!
You appear to have reached "Cabal Hell".
It looks to me like hsc3 for versions later than 0.13 depends on GHC being at least version 7.6 (the version which added the lookupEnv function), while Ubuntu 12.0.4 provides 7.4. This shows up as a compilation error because hsc3 has a badly set version bound on the base package.
You might try either of:
Installing a later version of GHC. It's currently at 7.8 with 7.10 expected out next month.
Using the older haskore-supercollider version 0.2, which uses hsc3 0.13. (Alas, when I try this with --dry-run, cabal fails to find an installation plan, but perhaps it works better if you actually have GHC 7.4.)

FFI Stubs in GHC 7

I'm trying to compile a Haskell module with some FFI code in it. It used to work under the old Haskell Platform with GHC 6 and a custom GHC 7 to get the 64 bit version.
Upgrading to the latest Haskell Platform with 64 bit version of GHC 7 has stopped it from working. It seems like GCC is having some trouble with the stub files that GHC spits out - they use GHC Framework headers that are having trouble finding standard C files. Here's just one of the many errors I'm getting:
/Library/Frameworks/GHC.framework/Versions/7.0.2-x86_64/usr/lib/ghc-7.0.2/include/Stg.h:62:18:
error: math.h: No such file or directory
I seem to have the same problem with the 32 bit version of the Platform, and the same standard files work correctly in normal GCC compilations. Why isn't this working?
There seems to be a problem with the latest version of XCode and ghc 7.0.2. Ghc 7.0.3 supposedly fixes this.

Resources