Can't install cabal by stack - cabal

when I want to install cabal by stack, an error occured:
=================
~$ stack install cabal
Error: While constructing the build plan, the following exceptions were
encountered:
In the dependencies for cabal-0.0.0.0:
youProbablyWantCapitalCabal must match <0 && >1, but the stack configuration
has no specified version (no package with that
name found, perhaps there is a typo in a
package's build-depends or an omission from the
stack.yaml packages list?)
needed since cabal is a build target.
Some different approaches to resolving this:
Consider trying 'stack solver', which uses the cabal-install solver to
attempt to find some working build configuration. This can be convenient
when dealing with many complicated constraint errors, but results may be
unpredictable.
Plan construction failed.
=================
Then I try to use stack solver to solve it following the hint. But it still failed:
=================
~$ stack solver
Using configuration file: stack.yaml
Using cabal packages:
- cabel/
No changes needed to stack.yaml
=================
It seems that I should configured the stack.yaml. But What should I Do? Thanks in advance.

As the error message says, you actually want stack install Cabal (note the capitalization!)

Related

installing hackage package with stack (not in LTS or nightly)

I'm getting started with stack, and I'm not entirely sure how to pull in a package that appears in hackage but not in the curated builds.
In particular, I'd like to pull in thrift-0.10.0. It seems I can't specify it in my project.cabal file, nor does the extra-deps section work since there is no resolver that contains this package.
When I run stack install thrift-0.10.0, I receive the following error:
While constructing the build plan, the following exceptions were encountered:
In the dependencies for thrift-0.10.0:
vector-0.11.0.0 must match ==0.10.12.2 (latest applicable is 0.10.12.2)
I'm not really sure (a) what stack install does, and (b) how to resolve the build plan since the thrift package specifies an equality (==) on the vector-0.10.12.2 package. If I try and include the relevant vector == 0.10.12.2 in my package.cabal, that also fails. Do I need to specify an earlier resolver?
I realize I have much to learn about this build tool, but in this case, my primary question, for which no documentation seems readily available is:
how do I include a hackage package in my stack build?
nor does the extra-deps section work since there is no resolver that contains this package.
extra-deps can contain any hackage package.
(a) what stack install does
It just does a build of the package + copying of executables to .local/bin
Install shouldn't be used for dependencies, instead it should be used for your local project / applications from hackage (packages with executables). There is no benefit to installing the dependencies of your project, instead they should be specified in stack.yaml
(b) how to resolve the build plan since the thrift package specifies an equality (==) on the vector-0.10.12.2 package.
It seems really ugly for the thrift package to have an (==) constraint like that. To get around it either do "allow-newer: true" in your stack.yaml (causes constraints to get ignored). Or, probably better, add `vector-0.10.12.2" to your extra-deps.
for which no documentation seems readily available is:
how do I include a hackage package in my stack build?
See this section of docs: https://docs.haskellstack.org/en/stable/GUIDE/#external-dependencies

Install ffmpeg-light with cabal

I want to install the ffmpeg-light library from hackage via cabal on Windows 10 (64 bit). So I downloaded ffmpeg and extracted it to C:\FFmpeg.
At first pkg-config was complaining that it could not find various packages. I solved this problem with .pc files.
When I tried to use the command: cabal install ffmpeg-light cabal complained about missing C-libraries, being exactly those for which I created the .pc files.
Then I tried the command: cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib. Now I have a different error message, which says:
Enums.hsc:7:32: fatal error: libavcodec/avcodec.h: No such file or directory
Edit:
Then I tried the following command:
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib \
--extra-include-dirs=C:\FFmpeg\include
Now first the compiler gives some warnings about deprecated functions in ffmpeg and redundant imports in ffmpeg-light, but compiles 11 of 11. But the build is still not successfull.
In-place registering ffmpeg-light-0.11.1...
setup-Simple-Cabal-1.22.5.0-x86_64-windows-ghc-7.10.3.exe:
'C:\Haskell\bin\ghc-pkg.exe' exited with an error:
ffmpeg-light-0.11.1: Warning: haddock-interfaces:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light\ffmpeg-light.haddock
doesn't exist or isn't a file
ffmpeg-light-0.11.1: Warning: haddock-html:
C:\Users\HOLEYC~1\AppData\Local\Temp\cabal-tmp-2824\ffmpeg-light-0.11.1\dist\doc\html\ffmpeg-light
doesn't exist or isn't a directory
ffmpeg-light-0.11.1: library-dirs: C:FFmpeglib is a relative path which makes
no sense (as there is nothing for it to be relative to). You can make paths
relative to the package database itself by using ${pkgroot}. (use --force to
override)
ffmpeg-light-0.11.1: include-dirs: C:FFmpeginclude is a relative path which
makes no sense (as there is nothing for it to be relative to). You can make
paths relative to the package database itself by using ${pkgroot}. (use
--force to override)
cabal: Error: some packages failed to install:
ffmpeg-light-0.11.1 failed during the building phase. The exception was:
ExitFailure 1
Some additional information:
cabal version: cabal-install version 1.22.6.0
using version 1.22.5.0 of the Cabal library
gcc version of my installed Haskell platform: 5.2.0
Example .pc file I used for pkg-config:
Name: libavcodec
Description: Library for ffmpeg
Version: 57
Cflags: -IC:\FFmpeg\include
Libs: -LC:\FFmpeg\lib -llibavcodec
OK. I figured it out. The --ghc-pkg-options="--force" option was needed.
cabal install ffmpeg-light --extra-lib-dirs=C:\FFmpeg\lib --extra-include-dirs=C:\FFmpeg\include --ghc-pkg-options="--force"

cabal-install "Couldn't read cabal file ..."

I just made a fresh haskell-platform install on a Linux Mint 12, via apt-get. Everytime I try to install some hackage package with cabal-install, I get a:
couldn't read caba file xxxx.cabal
where xxxx is a dependency of the package I'm installing or the package itself. Based on this thread on haskell cafe and other questions here in SO, I deleted the bytestring package from the index:
tar -f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete bytestring/0.9.2.0
tar -f ~/.cabal/packages/hackage.haskell.org/00-index.tar --delete bytestring/0.9.2.1
but the errors are still there.
My cabal-install version is:
$ cabal --version
cabal-install version 0.10.2
using version 1.10.1.0 of the Cabal library
The error is like this:
$ cabal install yesod
Resolving dependencies...
cabal: Couldn't read cabal file "fsnotify/0.0.5/fsnotify.cabal"
Does anyone knows what might be happening?
I'm having the same problem. There's a relevant mailing list thread about this problem at http://haskell.1045720.n5.nabble.com/Cabal-install-fails-due-to-recent-HUnit-td5715081i20.html
I believe the upshot is that the format of the packages files has changed, and the cabal version in use here (I have the same version, obtained from ubuntu oneiric) can't understand the files. You can't even do "cabal install cabal-install".
The mailing list thread just peters out in september 2012 without a clear decision being made, but I think they decided to just ignore the problem. There's not a clear statement of what to do for users like us; I think the only approach possible is to install haskell from scratch, but I don't yet know where to start with that.
EDIT: I fixed this by downloading the latest source package of cabal from http://hackage.haskell.org/packages/archive/cabal-install/1.16.0.2/cabal-install-1.16.0.2.tar.gz, unpacking it and following the instructions in its README to do a local install.
I was having the same problem and I wasn't able to follow Richard's instructions, so I realized I was running version 7.0.?, I uninstalled it using the command $ uninstall-hs, then installed the newest version (7.6.3). Problem solved here.

Package path error when trying to install lib package in C

I am trying to install libpackedobjects on my fedora 17. The path that I am trying to install it on is home/libpackedobjects. The steps that I am following are:
git clone git://gitorious.org/libpackedobjectsd/libpackedobjectsd.git
cd libpackedobjectsd
autoreconf -i
./configure
when I am trying to run the ./configure I am getting error:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.
Alternatively, you may set the environment variables LIBPACKEDOBJECTS_CFLAGS
and LIBPACKEDOBJECTS_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.
I do understand that the path can not be found, but do not know how to repair the problem. Any suggestions?
As evident from your error report:
checking for LIBPACKEDOBJECTS... no
configure: error: Package requirements (libpackedobjects) were not met:
No package 'libpackedobjects' found
Hence, You have to install the packages libpackedobjects and libXml2to install the libpackedobjectsd.
If you still get this error after installing the depenedent packages, there might be a PATH issue or linking issue.

AIX Package Install Issues

I want to install gettext but i cannot because my AIX says that gettext is dependent on glib and when i try to install glib it says that I cannot because glib is in turn dependent on gettext.
Please let me know how I could get past this situation?
root [rover]% rpm -i gettext-0.17-1.aix5.1.ppc.rpm
error: failed dependencies: libglib-2.0.a(libglib-2.0.so.0) is needed by gettext-0.17-1
libxlsmp.a(smprt.o) is needed by gettext-0.17-1
root [rover]% rpm -i glib2-2.22.5-2.aix5.1.ppc.rpm
error: failed dependencies: gettext is needed by glib2-2.22.5-2
You really have 2 problems:
error: failed dependencies: libglib-2.0.a(libglib-2.0.so.0) is needed by gettext-0.17-1
libxlsmp.a(smprt.o) is needed by gettext-0.17-1
The first error is indeed solved by what is said above (DO NOT use the --nodeps option in this case, it can cause really bad things to happen): use rpm -i (or -U for upgrade) to install both gettext and glib2 at the same time. If you have both in the same directory you can just use rpm -ihv (or -Uhv) *.rpm to install all of the RPM's at once, and it will resolve interdependencies that way.
HOWEVER, you still will not likely be able to install gettext due to #2: libxlsmp.a is a SECOND library/dependency that you need to solve.
It's my understanding that this library comes from a base AIX package (NOT an RPM/Open Source package) that will need to be installed from your AIX installation Media by installp. According to other web research it's the "xlsmp" package.
You have to pass in both files at once for dependency resolution to work: rpm -U gettext.rpm glib2.rpm.
I am not sure this will work or not, but install one of the package ignoring the dependencies.
use --nodeps flag of rpm to do this. Once it is installed, then go ahead with the other package.
root [rover]% rpm --nodeps -i gettext-0.17-1.aix5.1.ppc.rpm
Make sure to resolve other dependencies (if any) later if you are following this.

Resources