input-output-hk / haskell.nix

Alternative Haskell Infrastructure for Nixpkgs
https://input-output-hk.github.io/haskell.nix
Apache License 2.0
556 stars 240 forks source link

No or unhelpful error message when cabal dependency resolution fails #1392

Open ramirez7 opened 2 years ago

ramirez7 commented 2 years ago

(on haskell.nix at 7e06e14ae1b894445254fe41288bfa7dd4ccbc6f)

Ran into this attempting to upgrade to GHC 9, which bumped base and caused dependency issues:

trace: No index state specified for haskell-project, using the latest index state that we know about (2022-03-03T00:00:00Z)!
trace: ERROR: cabal configure failed with:
Cloning into '/build/tmp.98bf8coUXq/dist-newstyle/src/5iznfxhg3_-fcc2e6bf5e8d0a29'...
HEAD is now at ab961c7 Minimal Repo For Haskell.Nix
Your branch is up to date with 'origin/minimal'.
Cloning into '/build/tmp.98bf8coUXq/dist-newstyle/src/j8hf6vl6n_-dd62867bd959eb2d'...
HEAD is now at f9e1e64 Minimal Repo For Haskell.Nix
Your branch is up to date with 'origin/minimal'.
Cloning into '/build/tmp.98bf8coUXq/dist-newstyle/src/j8wl52ps3_-b093b9a032d673dd'...
HEAD is now at b690ec1 Minimal Repo For Haskell.Nix
Your branch is up to date with 'origin/minimal'.
Warning: The package list for 'hackage.haskell.org-at-2022-03-03T000000Z' is
19056 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cute-c2-0.1.0.0 (user goal)
[__1] trying: base-4.16.0.0/installed-4.16.0.0 (dependency of cute-c2)
[__2] trying: elided-0.1.0.0 (user goal)
[__3] next goal: ekg (dependency of elided)
[__3] rejecting: ekg-0.4.0.15 (conflict: base==4.16.0.0/installed-4.16.0.0,
ekg => base>=4.5 && <4.15)
[__3] skipping: ekg-0.4.0.14, ekg-0.4.0.13, ekg-0.4.0.12, ekg-0.4.0.11,
ekg-0.4.0.10, ekg-0.4.0.9, ekg-0.4.0.8, ekg-0.4.0.7, ekg-0.4.0.6, ekg-0.4.0.5,
ekg-0.4.0.4, ekg-0.4.0.3 (has the same characteristics that caused the
previous version to fail: excludes 'base' version 4.16.0.0)
[__3] trying: ekg-0.4.0.2
[__4] next goal: time (dependency of ekg)
[__4] rejecting: time-1.11.1.1/installed-1.11.1.1 (conflict: ekg => time<1.5)
[__4] skipping: time-1.12.1, time-1.12, time-1.11.1.2, time-1.11.1.1,
time-1.11.1, time-1.11, time-1.10, time-1.9.3, time-1.9.2, time-1.9.1,
time-1.9, time-1.8.0.4, time-1.8.0.3, time-1.8.0.2, time-1.8.0.1, time-1.8,
time-1.7.0.1, time-1.7, time-1.6.0.1, time-1.6, time-1.5.0.1, time-1.5 (has
the same characteristics that caused the previous version to fail: excluded by
constraint '<1.5' from 'ekg')
[__4] trying: time-1.4.2
[__5] next goal: deepseq (dependency of time)
[__5] rejecting: deepseq-1.4.6.1 (conflict: time => deepseq>=1.1 && <1.4)
[__5] skipping: deepseq-1.4.5.0, deepseq-1.4.4.0, deepseq-1.4.3.0,
deepseq-1.4.2.0, deepseq-1.4.1.2, deepseq-1.4.1.1, deepseq-1.4.1.0,
deepseq-1.4.0.0 (has the same characteristics that caused the previous version
to fail: excluded by constraint '>=1.1 && <1.4' from 'time')
[__5] rejecting: deepseq-1.3.0.2 (conflict: base==4.16.0.0/installed-4.16.0.0,
deepseq => base>=4.3 && <4.8)
[__5] trying: deepseq-1.3.0.1
[__6] next goal: snap-server (dependency of ekg)
[__6] rejecting: snap-server-1.1.2.0 (conflict: ekg => snap-server<0.10)
[__6] skipping: snap-server-1.1.1.2, snap-server-1.1.1.1, snap-server-1.1.1.0,
snap-server-1.1.0.0, snap-server-1.0.3.3, snap-server-1.0.3.2,
snap-server-1.0.3.1, snap-server-1.0.3.0, snap-server-1.0.2.2,
snap-server-1.0.2.1, snap-server-1.0.2.0, snap-server-1.0.1.1,
snap-server-1.0.1.0, snap-server-1.0.0.0 (has the same characteristics that
caused the previous version to fail: excluded by constraint '<0.10' from
'ekg')
[__6] trying: snap-server-0.9.5.1
[__7] trying: template-haskell-2.18.0.0/installed-2.18.0.0 (dependency of
elided)
[__8] next goal: pretty (dependency of template-haskell)
[__8] rejecting: pretty-1.1.3.6/installed-1.1.3.6 (conflict: deepseq==1.3.0.1,
pretty => deepseq==1.4.6.0/installed-1.4.6.0)
[__8] rejecting: pretty-1.1.3.6, pretty-1.1.3.5, pretty-1.1.3.4,
pretty-1.1.3.3, pretty-1.1.3.2, pretty-1.1.3.1, pretty-1.1.2.1,
pretty-1.1.2.0, pretty-1.1.1.3, pretty-1.1.1.2, pretty-1.1.1.1,
pretty-1.1.1.0, pretty-1.1.0.0, pretty-1.0.1.2, pretty-1.0.1.1,
pretty-1.0.1.0, pretty-1.0.0.0 (conflict: template-haskell =>
pretty==1.1.3.6/installed-1.1.3.6)
[__8] fail (backjumping, conflict set: deepseq, pretty, template-haskell)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: template-haskell, time, pretty,
deepseq, snap-server, base, ekg, elided, cute-c2
Try running with --minimize-conflict-set to improve the error message.

error: attribute 'shellFor' missing

       at /nix/store/vigmrh748qnywz175y3hsyyp98nfb3qg-haskellNix-src/overlays/haskell.nix:653:18:

          652|                   selectedCrossProjects;
          653|               in rawProject.hsPkgs.shellFor (args' // {
             |                  ^
          654|                   # Add inputs from the cross compilation shells
(use '--show-trace' to show detailed location information)

The real error is that cabal couldn't solve, but the error is that shellFor is missing. It would be nice if we got a nice bold useful error.

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jbgi commented 2 years ago

This issue was the cause for merging a build regression in https://github.com/input-output-hk/plutus/pull/4871#issuecomment-1266613546

peterbecich commented 1 year ago

Should this be labeled "enhancement"? https://github.com/input-output-hk/haskell.nix/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement