(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.)
Related
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.
I'm trying to install ghc-mod for GHC 8.0.1 on windows/x64. When I try to install ghc-mod via cabal install ghc-mod I get an error saying my C compiler isn't working (it is using the c-compiler bundled with ghc).
Here is the output (of the second time I ran the command. Its basically what the first one says but reduced to the error message):
C:\Users\******>cabal install ghc-mod
Resolving dependencies...
Configuring old-time-1.1.0.3...
Failed to install old-time-1.1.0.3
Build log ( C:\Users\******\AppData\Roaming\cabal\logs\old-time-1.1.0.3.log ):
Configuring old-time-1.1.0.3...
bash.exe: warning: could not find /tmp, please create!
configure: WARNING: unrecognized options: --with-compiler
checking for gcc... C:\PROGRA~1\Haskell Platform\8.0.1\mingw\bin\gcc.exe
^ I think the error lies here, as you can see the file path is corrupted but I wasn't able to locate the cause for this
checking whether the C compiler works... no
configure: error: in `/cygdrive/c/Users/******/AppData/Local/Temp/cabal-tmp-6084/old-time-1.1.0.3':
configure: error: C compiler cannot create executables
See `config.log' for more details
cabal: Leaving directory 'C:\Users\******\AppData\Local\Temp\cabal-tmp-6084\old-time-1.1.0.3'
cabal: Error: some packages failed to install:
cpphs-1.20.2 depends on old-time-1.1.0.3 which failed to install.
ghc-mod-5.6.0.0 depends on old-time-1.1.0.3 which failed to install.
haskell-src-exts-1.17.1 depends on old-time-1.1.0.3 which failed to install.
hlint-1.9.35 depends on old-time-1.1.0.3 which failed to install.
old-time-1.1.0.3 failed during the configure step. The exception was:
ExitFailure 77
Could you please help me to install ghc-mod or provide any other way of installing it.
I already trieded reinstalling Haskell since I'm just starting off but this didn't make any difference.
And YES I added the 3 lines provided on the haskell homepage.
I can't know for certain, but thought I'd write an answer with what I think is going on.
The old-time package contains a configure script, which is a Unix shell script used to (surprise!) configure the package. The Cabal build system allows packages to automatically integrate configure, and will run the script for them. On POSIX systems, there's always a shell easily available. However, on Windows, that's not the case. I believe that's the problem you're running into.
Now the tricky part: why don't you have a shell? In theory, the Haskell Platform ships a shell. Well, here are my guesses:
For Stack usage, there's a Haskell Platform bug where Stack cannot find the MSYS tools, which include the shell script. Newer versions of Stack work around this bug, but passing in --no-system-ghc tells Stack to ignore any installed toolchain and manage the installation itself, which is more reliable than using HP's copy.
For Cabal usage, I'm less certain. I think the HP team decided to require you to use a special batch program to set environment variables correctly, so if you just run cabal install foo from a normal command window, Cabal won't find MSYS and it will fail. However, without more information, I can't be certain this is the case.
My personal recommendation: uninstall Haskell Platform, and use the recommended Stack installation instructions. In your case, that's just downloading and running the 64-bit Windows installer.
Finally: your suspected problem is not actually a problem; on Windows, pathnames longer than 8 characters can be compressed in the way you see (with ~1 at the end). There's nothing buggy in that path display.
I tried, but I got this error:
https://gist.github.com/Wizek/a3e02b93b9f672a91f54
I remember trying with GHC 7.8.4 too, and AFAIR that also failed similarly.
Misc
I've used a new & empty cabal sandbox
cabal-install version 1.22.2.0
Looks like your happy executable needs to be upgraded. You can install the new version with cabal-install. Alternatively, using stack will automatically install the correct version of happy.
using cabal; came accross this error.
did cabal install and this happened.
failed during the building phase. The exception was:
ExitFailure 1
checked my log; it said:
dist/package.conf.inplace:
inappropriate type
I have 0 ideas what's going on. cabal build works though. #STRANGE
CURRENTLY:
CABAL version: 1.22.0.0. Glorious Glasgow Haskell Compilation version: 7.8.4
Possible explanation: you have upgraded GHC to 7.10, which does things a bit differently I gather, but not upgraded cabal-install. If this is the problem, running
cabal install cabal-install -w ghc-7.8.4 # or whatever other version of GHC you have
may fix the problem.
You can get this error if you previously built your package with an older (or newer) version of Cabal and now are building with a newer (or older) version.
Not enough information to determine whether this is the problem in your case.
If it is, I think cabal clean should fix it (though I usually just rm -rf dist).
I am new to Haskell, and wanted to play around with snap framework. Unfortunately I just cant get the thing to compile. I've tried (all I know too), updating cabal and running sudo ghc-pkg recache but I still get the following when I run cabal install snap. Please help.
12 warnings and 1 error generated.
Failed to install binary-0.7.1.0
cabal: Error: some packages failed to install:
SHA-1.6.4 depends on binary-0.7.1.0 which faile
d to install.
binary-0.7.1.0 failed during the building phase
. The exception was:
ExitFailure 1
pwstore-fast-2.4.1 depends on binary-0.7.1.0 wh
ich failed to install.
snap-0.13.2.2 depends on binary-0.7.1.0 which f
ailed to install.
Solution:
I first install the 'real' gcc via homebrew like so:
brew update
brew install gcc47
This took a while to install (as in over an hour). Once it was done I updated the GHC settings to use the copy of gcc installed by homebrew.
GHC settings are located either here :
/Library/Frameworks/GHC.framework/Versions/Current/usr/lib/ghc-7.6.3/settings
or here if you installed ghc with homebrew (I did not).
/usr/local/Cellar/ghc/7.6.3/lib/ghc-7.6.3/settings
Update the line
("C compiler command", "/usr/bin/gcc")
to
("C compiler command", "/usr/local/Cellar/gcc47/4.7.3/bin/gcc-4.7")
Then just run
cabal update && cabal install snap
and all should be well. :)
Your problem is that the binary package has some C preprocessor constructs that are not strictly valid.
After looking around a bit, I found a similar problem somebody had when installing the Haskell platform. It seems the core issue is that the Clang C preprocessor is stricter than the GCC one most Haskellers use. I'm assuming that this is your problem: you're using Clang rather than GCC. If you're on OS X, this is the default choice.
The easiest solution seems to be to switch to using GCC for the preprocessing. Note that on OS X, /usr/bin/gcc actually points to Clang! You will need to point GHC to an actual install of GCC.
You can do this by editing GHC's configuration file. On my system it's found at
/usr/local/lib/ghc-7.6.3/settings
Yours is probably somewhere similar, although I'm on Linux rather than OS X. In the file, change
("C compiler command", "/usr/bin/gcc")
to point to an actual copy of gcc rather than Clang and try installing again.
In the long run, this feels like a bug with the package and probably needs to be addressed, although I don't really know enough about the issue or constraints package authors have to be sure.