Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cabal install --lib errors should point to the package environment that cause the error #7820

Open
andreasabel opened this issue Nov 15, 2021 · 5 comments
Labels
blocked: needs reproducer cabal-install: cmd/install re: error-message Concerning error messages delivered to the user re: install --lib Concerning `cabal install --lib`

Comments

@andreasabel
Copy link
Member

E.g., trying (GHC 9.2.1, cabal master):

$ cabal install --lib microlens
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: directory-1.3.7.0 (user goal)
[__1] next goal: ghc (user goal)
[__1] rejecting: ghc-9.2.1/installed-9.2.1 (conflict: directory==1.3.7.0, ghc
=> directory==1.3.6.2/installed-1.3.6.2)
[__1] trying: ghc-9.2.1
[__2] unknown package: unbuildable (dependency of ghc)
[__2] fail (backjumping, conflict set: ghc, unbuildable)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: directory, ghc, unbuildable

This is surprising, as microlens does not have any dependencies except base.

With ghc-pkg there was no problem, but after some longer digging I remembered https://ghc.gitlab.haskell.org/ghc/doc/users_guide/packages.html#package-environments and found .ghc/x86_64-darwin-9.2.1/environments/default:

clear-package-db
global-package-db
package-db /Users/abel/.cabal/store/ghc-9.2.1/package.db
package-id ghc-9.2.1
...
package-id template-haskell-2.18.0.0
package-id drctry-1.3.7.0-75757ae7
package-id text-1.2.5.0
package-id prttyprntr-1.7.1-58b4e5f6
package-id xtr-1.7.10-74cdb974

So with knowledge of #7209 I can identify drctry (dorctry? --- no, directory!!) as source of conflict. (I still wonder how it ended up here if it conflicts with ghc-9.2.1??)

I still think that

[__0] trying: directory-1.3.7.0 (user goal)

is inaccurate when I invoked cabal on microlens.

The output should rather reveal the correct source of the directory-1.3.7.0 goal.

@andreasabel andreasabel added cabal-install: cmd/install re: error-message Concerning error messages delivered to the user re: install --lib Concerning `cabal install --lib` labels Nov 15, 2021
@Mikolaj
Copy link
Member

Mikolaj commented Nov 15, 2021

May this be caused by #7819?

@andreasabel
Copy link
Member Author

If I understand #7819 correctly, it is about ghci ignoring .ghc/ (this explains my confusions about ghci refusing to find packages...).
However, in the present issue, ~/.ghc/ is taken into account. The offending package directory-1.3.7.0 indeed came from the default package environment located there. After I deleted it there, cabal install --lib microlens worked again.
But maybe you refer to my question how directory-1.3.7.0 got into the package environment there in the first place, if it produces "cabal hell" with the shipped directory-1.3.6.2?

@Mikolaj
Copy link
Member

Mikolaj commented Nov 16, 2021

Yes, I'm generally confused what's going on here, before I even consider misleading error messages, so I'm grasping at straws. E.g., are you able to reproduce the problem? Or just produce a different, less mysterious, case of the misleading error message? How will we test the errors are improved? Perhaps if we instead fix the root cause of the problem, the better error messages won't be required?

To be clear: tickets with non-reproducible problems are valuable, as well, especially if several cases are recorded, but I'm not sure about the status of this one.

@andreasabel
Copy link
Member Author

Ok, maybe I will find a reproducer.

@andrewufrank
Copy link

andrewufrank commented Dec 12, 2021

Remark (by @andreasabel): The following comment refers to agda/agda#5693.

the reference to citeproc was in .ghc/x86_64-linux-8.10.4/default. I deleted this and a few other files which are automatically recreated and now things work.
The default file was produced several month ago - why is not clear now. I was then perhaps trying to get a haskell program to work with stack and gave up and switched to cabal. It was not reproduced now.

the file content was - the last line is the likely culprit!

clear-package-db
global-package-db
package-db /home/frank/.cabal/store/ghc-8.10.4/package.db
package-id ghc-8.10.4
package-id bytestring-0.10.12.0
package-id unix-2.7.2.2
package-id base-4.14.1.0
package-id time-1.9.3
package-id hpc-0.6.1.0
package-id filepath-1.4.2.1
package-id process-1.6.9.0
package-id array-0.5.4.0
package-id integer-gmp-1.0.3.0
package-id containers-0.6.2.1
package-id ghc-boot-8.10.4
package-id binary-0.8.8.0
package-id ghc-prim-0.6.1
package-id ghci-8.10.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.10.4
package-id pretty-1.1.3.6
package-id template-haskell-2.16.0.0
package-id directory-1.3.6.0
package-id text-1.2.4.1
package-id citeproc-0.5-9f761cb4a516ae7cf8a09a7b5b9aa54b8a98e0ffc680db70cd56fa10d443ba33

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked: needs reproducer cabal-install: cmd/install re: error-message Concerning error messages delivered to the user re: install --lib Concerning `cabal install --lib`
Projects
None yet
Development

No branches or pull requests

4 participants