Cabal problem, broken packages?

Hi! I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install: desktop ~ $ cabal install rfc5051 Resolving dependencies... cabal: Could not resolve dependencies: [__0] next goal: directory (user goal) [__0] rejecting: directory-1.3.8.0 (constraint from user target requires ==1.3.7.1) [__0] trying: directory-1.3.7.1 [__1] next goal: ghc (user goal) [__1] rejecting: ghc-9.4.2, ghc-9.4.1, ghc-9.2.4, ghc-9.2.3, ghc-9.2.2, ghc-9.2.1, ghc-9.0.2, ghc-8.10.7, ghc-8.10.2, ghc-8.10.1 (constraint from user target requires ==8.8.4) [__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...) [__1] rejecting: ghc-8.8.3, ghc-8.8.1, ghc-8.6.5, ghc-8.6.4, ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1, ghc-9.2.3.20220620 (constraint from user target requires ==8.8.4) [__1] fail (backjumping, conflict set: directory, ghc) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: directory, ghc This doesn't make much sense to me. How can I repair it? Are the packages broken? Can a solution somehow be specified? Cheers, Volker

On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051. As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt? $ cabal repl -z --build-depends rfc5051
desktop ~ $ cabal install rfc5051 Resolving dependencies... cabal: Could not resolve dependencies: [__0] next goal: directory (user goal) [__0] rejecting: directory-1.3.8.0 (constraint from user target requires ==1.3.7.1) [__0] trying: directory-1.3.7.1 [__1] next goal: ghc (user goal) [__1] rejecting: ghc-9.4.2, ghc-9.4.1, ghc-9.2.4, ghc-9.2.3, ghc-9.2.2, ghc-9.2.1, ghc-9.0.2, ghc-8.10.7, ghc-8.10.2, ghc-8.10.1 (constraint from user target requires ==8.8.4) [__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...) [__1] rejecting: ghc-8.8.3, ghc-8.8.1, ghc-8.6.5, ghc-8.6.4, ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1, ghc-9.2.3.20220620 (constraint from user target requires ==8.8.4) [__1] fail (backjumping, conflict set: directory, ghc) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: directory, ghc

This may be caused by some cabal.project lying around
(e.g., in the directory you are in when you are installing, but also
in any parent directory) or by .ghc.environment.arch-os-version
files lying around
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-env...
which is likely if you indeed installed whole packages, and not just
executables from the packages (`cabal install` only installs executables).
If the problem persists please file a ticket on cabal github bug tracker.
BTW, I haven't received your email, but only the response from Tom.
Nothing in the spam folder, either. Strange.
On Thu, Sep 15, 2022 at 5:32 PM Tom Ellis
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
desktop ~ $ cabal install rfc5051 Resolving dependencies... cabal: Could not resolve dependencies: [__0] next goal: directory (user goal) [__0] rejecting: directory-1.3.8.0 (constraint from user target requires ==1.3.7.1) [__0] trying: directory-1.3.7.1 [__1] next goal: ghc (user goal) [__1] rejecting: ghc-9.4.2, ghc-9.4.1, ghc-9.2.4, ghc-9.2.3, ghc-9.2.2, ghc-9.2.1, ghc-9.0.2, ghc-8.10.7, ghc-8.10.2, ghc-8.10.1 (constraint from user target requires ==8.8.4) [__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...) [__1] rejecting: ghc-8.8.3, ghc-8.8.1, ghc-8.6.5, ghc-8.6.4, ghc-8.6.1, ghc-8.4.4, ghc-8.4.3, ghc-8.4.1, ghc-8.2.2, ghc-8.2.1, ghc-9.2.3.20220620 (constraint from user target requires ==8.8.4) [__1] fail (backjumping, conflict set: directory, ghc) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: directory, ghc
Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

Am Donnerstag, dem 15.09.2022 um 17:47 +0200 schrieb Mikolaj Konarski:
This may be caused by some cabal.project lying around (e.g., in the directory you are in when you are installing, but also in any parent directory) or by .ghc.environment.arch-os-version files lying around
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-env...
I don't have a cabal.project or .ghc.environment.arch-os-version lying around. However, I've found ~/.ghc/x86_64-linux-8.8.4/environments/default, which contains this: clear-package-db global-package-db package-db /home/v/.cabal/store/ghc-8.8.4/package.db package-id ghc-8.8.4 package-id bytestring-0.10.10.1 package-id unix-2.7.3- f9e049162269c42fac796ce2193bc96fb95dfe3ac975de03338213cf0e37a14a package-id base-4.13.0.0 package-id time-1.12.1- 79940fa11921893814fd2d9a0f4653cb6d9b3a2de6720e03a14215ba5d4e06e7 package-id hpc-0.6.0.3 package-id filepath-1.4.2.1 package-id process-1.6.15.0- 0397a5aa0d99937f979c3ecfb8c3917000787735a4c430a5ee92c026f8987cf0 package-id array-0.5.4.0 package-id integer-gmp-1.0.2.0 package-id containers-0.6.2.1 package-id ghc-boot-8.8.4 package-id binary-0.8.7.0 package-id ghc-prim-0.5.3 package-id ghci-8.8.4 package-id rts package-id terminfo-0.4.1.4 package-id transformers-0.5.6.2 package-id deepseq-1.4.4.0 package-id ghc-boot-th-8.8.4 package-id pretty-1.1.3.6 package-id template-haskell-2.15.0.0 package-id directory-1.3.7.1- ada0557c8af940ba0586588eddbc02eb543cb70097182636c20a53c37f6c724e package-id text-1.2.4.0 package-id random-1.2.1.1- 96a066a3c9e6ce9db8a64c0229a4a92c26549367424a16852f798314b610d9ae package-id hsshellscript-3.5.0- d22730dc2a5e25b97ff191ad98a6a1517ff456eecf456231207a8e35d428732e I've tried the "cabal install --lib" commmand in /tmp, but it's the same.
which is likely if you indeed installed whole packages, and not just executables from the packages (`cabal install` only installs executables).
What I've actually called is "cabal install --lib rfc5051", sorry.
If the problem persists please file a ticket on cabal github bug tracker.
BTW, I haven't received your email, but only the response from Tom. Nothing in the spam folder, either. Strange.
Cheers, Volker

On Thu, Sep 15, 2022 at 06:09:33PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 17:47 +0200 schrieb Mikolaj Konarski:
This may be caused by some cabal.project lying around (e.g., in the directory you are in when you are installing, but also in any parent directory) or by .ghc.environment.arch-os-version files lying around
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-env...
I don't have a cabal.project or .ghc.environment.arch-os-version lying around. However, I've found ~/.ghc/x86_64-linux-8.8.4/environments/default, which contains this:
GHC 8.8.4 depends on directory 1.3.6.0, therefore the GHC API package, ghc, does too as mentioned in the original error message: [__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...) and can be verified at: https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-hist... However, you have got an environment file that requires ghc-8.8.4 and directory-1.3.7.1 at the same time. Something's funny about that because it's impossible to satisfy and I'm not sure how it could have happened in the first place. Perhaps some cabal expert can weigh in. Tom
clear-package-db global-package-db package-db /home/v/.cabal/store/ghc-8.8.4/package.db package-id ghc-8.8.4 package-id bytestring-0.10.10.1 package-id unix-2.7.3- f9e049162269c42fac796ce2193bc96fb95dfe3ac975de03338213cf0e37a14a package-id base-4.13.0.0 package-id time-1.12.1- 79940fa11921893814fd2d9a0f4653cb6d9b3a2de6720e03a14215ba5d4e06e7 package-id hpc-0.6.0.3 package-id filepath-1.4.2.1 package-id process-1.6.15.0- 0397a5aa0d99937f979c3ecfb8c3917000787735a4c430a5ee92c026f8987cf0 package-id array-0.5.4.0 package-id integer-gmp-1.0.2.0 package-id containers-0.6.2.1 package-id ghc-boot-8.8.4 package-id binary-0.8.7.0 package-id ghc-prim-0.5.3 package-id ghci-8.8.4 package-id rts package-id terminfo-0.4.1.4 package-id transformers-0.5.6.2 package-id deepseq-1.4.4.0 package-id ghc-boot-th-8.8.4 package-id pretty-1.1.3.6 package-id template-haskell-2.15.0.0 package-id directory-1.3.7.1- ada0557c8af940ba0586588eddbc02eb543cb70097182636c20a53c37f6c724e package-id text-1.2.4.0 package-id random-1.2.1.1- 96a066a3c9e6ce9db8a64c0229a4a92c26549367424a16852f798314b610d9ae package-id hsshellscript-3.5.0- d22730dc2a5e25b97ff191ad98a6a1517ff456eecf456231207a8e35d428732e

On Thu, Sep 15, 2022 at 05:33:06PM +0100, Tom Ellis wrote:
On Thu, Sep 15, 2022 at 06:09:33PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 17:47 +0200 schrieb Mikolaj Konarski:
This may be caused by some cabal.project lying around (e.g., in the directory you are in when you are installing, but also in any parent directory) or by .ghc.environment.arch-os-version files lying around
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-env...
I don't have a cabal.project or .ghc.environment.arch-os-version lying around. However, I've found ~/.ghc/x86_64-linux-8.8.4/environments/default, which contains this:
GHC 8.8.4 depends on directory 1.3.6.0, therefore the GHC API package, ghc, does too as mentioned in the original error message:
[__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...)
and can be verified at:
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-hist...
However, you have got an environment file that requires ghc-8.8.4 and directory-1.3.7.1 at the same time. Something's funny about that because it's impossible to satisfy and I'm not sure how it could have happened in the first place. Perhaps some cabal expert can weigh in.
In the hope that a cabal expert can explain this behaviour I have opened as issue: https://github.com/haskell/cabal/issues/8473

Am Freitag, dem 16.09.2022 um 08:38 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:33:06PM +0100, Tom Ellis wrote:
On Thu, Sep 15, 2022 at 06:09:33PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 17:47 +0200 schrieb Mikolaj Konarski:
This may be caused by some cabal.project lying around (e.g., in the directory you are in when you are installing, but also in any parent directory) or by .ghc.environment.arch-os-version files lying around
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-env...
I don't have a cabal.project or .ghc.environment.arch-os-version lying around. However, I've found ~/.ghc/x86_64-linux-8.8.4/environments/default, which contains this:
GHC 8.8.4 depends on directory 1.3.6.0, therefore the GHC API package, ghc, does too as mentioned in the original error message:
[__1] rejecting: ghc-8.8.4/installed-8.8... (conflict: directory==1.3.7.1, ghc => directory==1.3.6.0/installed-1.3...)
and can be verified at:
https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/libraries/version-hist...
However, you have got an environment file that requires ghc-8.8.4 and directory-1.3.7.1 at the same time. Something's funny about that because it's impossible to satisfy and I'm not sure how it could have happened in the first place. Perhaps some cabal expert can weigh in.
In the hope that a cabal expert can explain this behaviour I have opened as issue:
Thanks for that. But I'm switching to cabal ("cabal build") now, instead of my Makefile. Of course the problem should be minded, if it is a bug. However, I don't need that any longer. Cheers, Volker

Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in: desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude> Looks good, doesn't it..? Volker

On Thu, Sep 15, 2022 at 06:11:55PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Yes, so this means that the problem is indeed the ~/.ghc/x86_64-linux-8.8.4/environments/default that Mikolaj predicted and you confirmed in a sibling thread. I'm not sure what the suggested fix is. I find this part of the cabal command line API extremely inscrutable. Tom

Am Donnerstag, dem 15.09.2022 um 17:17 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 06:11:55PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Yes, so this means that the problem is indeed the ~/.ghc/x86_64-linux-8.8.4/environments/default that Mikolaj predicted and you confirmed in a sibling thread.
For reference, here's the beginning of that file again: clear-package-db global-package-db package-db /home/v/.cabal/store/ghc-8.8.4/package.db package-id ghc-8.8.4 package-id bytestring-0.10.10.1 package-id unix-2.7.3- f9e049162269c42fac796ce2193bc96fb95dfe3ac975de03338213cf0e37a14a package-id base-4.13.0.0 ... What makes me wonder is, that some but not all "package-id" entries have a large hexadecimal string at the end of the line...
I'm not sure what the suggested fix is. I find this part of the cabal command line API extremely inscrutable.
Bye Volker

The hex ID is an ABI hash. It is included for libraries installed by
cabal, but not those that ship with ghc itself.
On Thu, Sep 15, 2022 at 12:27 PM Volker Wysk
Am Donnerstag, dem 15.09.2022 um 17:17 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 06:11:55PM +0200, Volker Wysk wrote:
Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Yes, so this means that the problem is indeed the ~/.ghc/x86_64-linux-8.8.4/environments/default that Mikolaj predicted and you confirmed in a sibling thread.
For reference, here's the beginning of that file again:
clear-package-db global-package-db package-db /home/v/.cabal/store/ghc-8.8.4/package.db package-id ghc-8.8.4 package-id bytestring-0.10.10.1 package-id unix-2.7.3- f9e049162269c42fac796ce2193bc96fb95dfe3ac975de03338213cf0e37a14a package-id base-4.13.0.0 ...
What makes me wonder is, that some but not all "package-id" entries have a large hexadecimal string at the end of the line...
I'm not sure what the suggested fix is. I find this part of the cabal command line API extremely inscrutable.
Bye Volker _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com

It looks good because you're using it the way you're supposed to
instead of blindly using --lib to install things. That creates
dependency issues like what you're having. Basically, don't use --lib
unless you know what you're doing.
Remove the environment file, and create projects with dependencies on
the libraries you want, instead of trying to preinstall them. Cabal
knows how to manage packages for you so they don't conflict.
On Thu, Sep 15, 2022 at 12:12 PM Volker Wysk
Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Volker _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com

On Thu, Sep 15, 2022 at 12:25:11PM -0400, Brandon Allbery wrote:
It looks good because you're using it the way you're supposed to instead of blindly using --lib to install things. That creates dependency issues like what you're having. Basically, don't use --lib unless you know what you're doing.
+1, although I'm yet to see evidence that anyone knows what they're doing with --lib. Unfortunately instructions like This package can be installed using the Cabal package manager for Haskell by issuing the following command: cabal install QuickCheck are still prevalent around the web. When the user tries he or she gets the response @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: Installation might not be completed as desired! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The command "cabal install [TARGETS]" doesn't expose libraries. * You might have wanted to add them as dependencies to your package. In this case add "QuickCheck" to the build-depends field(s) of your package's .cabal file. * You might have wanted to add them to a GHC environment. In this case use "cabal install --lib QuickCheck". The "--lib" flag is provisional: see https://github.com/haskell/cabal/issues/6481 for more information. The next natural course of action is "cabal install --lib". Tom

xmonad uses `--lib` along with `--package-env` so its packages are
visible only to xmonad during mod-q rebuilds. This works well without
polluting the global package environment.
On Thu, Sep 15, 2022 at 12:38 PM Tom Ellis
On Thu, Sep 15, 2022 at 12:25:11PM -0400, Brandon Allbery wrote:
It looks good because you're using it the way you're supposed to instead of blindly using --lib to install things. That creates dependency issues like what you're having. Basically, don't use --lib unless you know what you're doing.
+1, although I'm yet to see evidence that anyone knows what they're doing with --lib.
Unfortunately instructions like
This package can be installed using the Cabal package manager for Haskell by issuing the following command:
cabal install QuickCheck
are still prevalent around the web. When the user tries he or she gets the response
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: Installation might not be completed as desired! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The command "cabal install [TARGETS]" doesn't expose libraries. * You might have wanted to add them as dependencies to your package. In this case add "QuickCheck" to the build-depends field(s) of your package's .cabal file. * You might have wanted to add them to a GHC environment. In this case use "cabal install --lib QuickCheck". The "--lib" flag is provisional: see https://github.com/haskell/cabal/issues/6481 for more information.
The next natural course of action is "cabal install --lib".
Tom _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com

Am Donnerstag, dem 15.09.2022 um 12:25 -0400 schrieb Brandon Allbery:
It looks good because you're using it the way you're supposed to instead of blindly using --lib to install things. That creates dependency issues like what you're having. Basically, don't use --lib unless you know what you're doing.
Remove the environment file, and create projects with dependencies on the libraries you want, instead of trying to preinstall them. Cabal knows how to manage packages for you so they don't conflict.
I admit that I don't really know what I'm doing, when using cabal. I've built my projects by calling ghc from a generic Makefile for a long time now. And you're saying I should build them with "cabal build" instead? This would mean that I must change my long-fostered build environment. Looks like I have to do some reading. Bye, Volker
On Thu, Sep 15, 2022 at 12:12 PM Volker Wysk
wrote: Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Volker _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.

The problem with the old way of doing things is exactly what you're
seeing: conflicting package versions that interfere with each other.
Cabal and stack both know how to expose only the package versions
needed by a build, while retaining all versions needed by various
build environments.
On Thu, Sep 15, 2022 at 12:39 PM Volker Wysk
Am Donnerstag, dem 15.09.2022 um 12:25 -0400 schrieb Brandon Allbery:
It looks good because you're using it the way you're supposed to instead of blindly using --lib to install things. That creates dependency issues like what you're having. Basically, don't use --lib unless you know what you're doing.
Remove the environment file, and create projects with dependencies on the libraries you want, instead of trying to preinstall them. Cabal knows how to manage packages for you so they don't conflict.
I admit that I don't really know what I'm doing, when using cabal. I've built my projects by calling ghc from a generic Makefile for a long time now. And you're saying I should build them with "cabal build" instead? This would mean that I must change my long-fostered build environment.
Looks like I have to do some reading.
Bye, Volker
On Thu, Sep 15, 2022 at 12:12 PM Volker Wysk
wrote: Am Donnerstag, dem 15.09.2022 um 16:31 +0100 schrieb Tom Ellis:
On Thu, Sep 15, 2022 at 05:23:10PM +0200, Volker Wysk wrote:
I've lately set up the Haskell environment on my Linux box, with no problems. Then I have installed some packages with "cabal install", again without problems. But now I'm trying to install another package and I get a dependency conflict. It doesn't seem to matter which package I try to install:
This is quite weird, because neither directory nor ghc are dependencies of rfc5051.
As a first step, can you try the following and report back whether you successfully get to a GHCi a prompt?
$ cabal repl -z --build-depends rfc5051
This results in:
desktop ~ $ cabal repl -z --build-depends rfc5051 Resolving dependencies... Build profile: -w ghc-8.8.4 -O1 In order, the following will be built (use -v for more details): - rfc5051-0.2 (lib) (requires download & build) - fake-package-0 (lib) (first run) Downloading rfc5051-0.2 Downloaded rfc5051-0.2 Starting rfc5051-0.2 (lib) Building rfc5051-0.2 (lib) Installing rfc5051-0.2 (lib) Completed rfc5051-0.2 (lib) Configuring library for fake-package-0.. Preprocessing library for fake-package-0.. Warning: No exposed modules GHCi, version 8.8.4: https://www.haskell.org/ghc/ :? for help Loaded GHCi configuration from /tmp/cabal-repl.-17863/setcwd.ghci Prelude>
Looks good, doesn't it..?
Volker _______________________________________________ Haskell-Cafe mailing list To (un)subscribe, modify options or view archives go to: http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe Only members subscribed via the mailman list are allowed to post.
-- brandon s allbery kf8nh allbery.b@gmail.com
participants (4)
-
Brandon Allbery
-
Mikolaj Konarski
-
Tom Ellis
-
Volker Wysk