Repository navigation
Closed
Description
Could we show the import path when reporting solver rejections from project constraints?
Here's a mockup example using ascii +-- as the leader instead of the └── leader of the tree command output:
# cabal v2-update
Downloading the latest package list from test-local-repo
# 3-web-dot-relative.project --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Error: [Cabal-7107]
Could not resolve dependencies:
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
[__1] next goal: hashable (dependency of cabal-version-override)
[__1] rejecting: hashable-1.4.3.0 (constraint from project requires ==1.4.2.0)
+-- <ROOT>/3-web-dot-relative.project requires ==1.4.2.0
[__1] rejecting: hashable-1.4.2.0 (constraint from project requires ==1.4.3.0)
+-- <ROOT>/3-web-dot-relative.project
+-- ./dot-1/hop-web.config
+-- ./stackage-web.config
+-- https://www.stackage.org/nightly-2023-12-07/cabal.config requires ==1.4.3.0
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
I'd tried using └── leader but it doesn't render properly. The output could be moved further left if desired but I didn't want to interrupt the flow of the [__n] step indicators.
What we show now:
# cabal v2-update
Downloading the latest package list from test-local-repo
# 3-web-dot-relative.project --version-win not supplied, default
# cabal v2-build
Resolving dependencies...
Error: cabal: Could not resolve dependencies:
[__0] trying: cabal-version-override-0.1.0.0 (user goal)
[__1] next goal: hashable (dependency of cabal-version-override)
[__1] rejecting: hashable-1.4.3.0 (constraint from project config <ROOT>/3-web-dot-relative.project requires ==1.4.2.0)
[__1] rejecting: hashable-1.4.2.0 (constraint from project config https://www.stackage.org/nightly-2023-12-07/cabal.config requires ==1.4.3.0)
[__1] fail (backjumping, conflict set: cabal-version-override, hashable)
After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: hashable (3), cabal-version-override (2)
To generate the above, I ran the following with a test project I have in the works for #9510.
$ cabal run cabal-testsuite:cabal-tests -- --with-cabal=./dist-newstyle/build/x86_64-linux/ghc-9.4.7/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal cabal-testsuite/PackageTests/VersionPriority/3-web.test.hs --accept
$ cabal run cabal-testsuite:cabal-tests -- --with-cabal=/home/philderbeast/.ghcup/bin/cabal cabal-testsuite/PackageTests/VersionPriority/3-web.test.hs --accept
Reacted by matil019
Activity
9999years commentedon Oct 28, 2024
Hello,
cabal build warp-quicis failing in yesodweb/wai@23b8c4c with an unintuitive failure message on Cabal HEAD:Here,
memory-0.17.0comes from asource-repository-packagein thecabal.project.When I run
cabal build warp-quic -v3, here's what it says about the constraints:(In my mind,
warp-quicis the only real user target here, and the rest are a mix, e.g.memoryis fromcabal.project,waiis a dependency ofwarp-quic,auto-updateis a transitive dependency (viawarp), etc.)My current hypothesis is that your PR (#9578) does the correct thing, but that something in Cabal is causing these dependencies to be added as "user target" constraints rather than
cabal.projectconstraints. I've poked around the codebase but I can't find where it's going wrong.9999years commentedon Oct 30, 2024
Update: It seems that this error comes from Cabal attempting to resolve the packages in the workspace, before it attempts to figure out what you actually want built.
sebright commentedon Nov 1, 2024
@9999years Could you please open a new issue for the problem with user target constraints? The fix for this issue only added more information to project config constraints, so I wouldn't expect it to have any effect on whether constraints are labeled as "project config" or "user target". It would also help to see the part of cabal.project that could be adding these packages as targets.