ghc-mod icon indicating copy to clipboard operation
ghc-mod copied to clipboard

Make cannot satisfy package messages more helpful

Open DanielG opened this issue 10 years ago • 5 comments

We should be able to look for package-dbs that might contain packages that cannot be satisfied. Also this seems to be caused by GHC version conflicts.

DanielG avatar Oct 30 '15 18:10 DanielG

I have seen many many users having this message in different circumstances. but it seems that they just accept and give up.. so that would be a good idea.

a systematic collect of errors would be awesome to know what are the most pressing needs. sometimes small things we might not think of are effectively posing the biggest pb

nrolland avatar Oct 31 '15 12:10 nrolland

with the ghc-mod for ghcjs, I have <command line>: cannot satisfy -package-id aeson-0.9.0.1-18aa0b80940b48ed7f17b22f32a24d4f (use -v for more information) and not a clue what's wrong...

nrolland avatar Oct 31 '15 22:10 nrolland

We just pass whatever -package flags Cabal comes up with to GHC so you'll want to start debugging by looking at dist/setup-config, cabal-helper-wrapper . dist print-lbi --human | head -n1 | ppsh is your friend. cabal-helper-wrapper is installed in $libexec, ppsh is part of the pretty-show package.

DanielG avatar Oct 31 '15 22:10 DanielG

so much info, will parse that later

for reference to stackers, the command was, in my ghcjs project
/Users/nrolland/Sync/clones/cabal-helper-0.6.1.0/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/cabal-helper-wrapper/cabal-helper-wrapper . .stack-work/dist/x86_64-osx/Cabal-1.22.4.0 print-lbi --human | head -n1 | push

and for getting verbose information

ghc-mod -v7 --ghcOpt=-v7 check example/todo/TodoComponents.hs

resulting in my case in

$ /Users/nrolland/Sync/clones/ghc-mod/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/ghc-mod/ghc-mod -v7 --ghcOpt=-v7 check example/todo/TodoComponents.hs                              not sandboxed
DEBUG: reading cache: /Users/nrolland/Sync/clones/react-flux/.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup-config.ghc-mod.cabal-components
DEBUG: resolveEntrypoint:
       ["-i","-i.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build","-isrc","-i.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen","-I.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen","-I.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build","-optP-include","-optP.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen/cabal_macros.h"]
DEBUG: resolveEntrypoint: []
DEBUG: making sure autogen files exist
DEBUG: reading cache: .stack-work/dist/x86_64-osx/Cabal-1.22.4.0/setup-config.ghc-mod.resolved-components
DEBUG: Could not find a component assignment, falling back to picking library
       component in cabal file.
VOMIT: Initializing GHC session with following options: "-fbuilding-cabal-package" "-O" "-outputdir" ".stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-odir" ".stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-hidir" ".stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-stubdir" ".stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-i" "-i.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-isrc" "-i.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen" "-I.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen" "-I.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build" "-optP-include" "-optP.stack-work/dist/x86_64-osx/Cabal-1.22.4.0/build/autogen/cabal_macros.h" "-hide-all-packages" "-no-user-package-db" "-package-db" "/Users/nrolland/.stack/snapshots/x86_64-osx/ghcjs-0.2.0.20151029_ghc-7.10.2/ghcjs-0.2.0.20151029_ghc-7.10.2/pkgdb/" "-package-db" "/Users/nrolland/Sync/clones/react-flux/.stack-work/install/x86_64-osx/ghcjs-0.2.0.20151029_ghc-7.10.2/ghcjs-0.2.0.20151029_ghc-7.10.2/pkgdb/" "-package-id" "aeson-0.9.0.1-18aa0b80940b48ed7f17b22f32a24d4f" "-package-id" "base-4.8.0.0-a3a3ebe3085e9d11c37cceba58a4365f" "-package-id" "bytestring-0.10.6.0-5352fe91f9dde68208480250c39ad337" "-package-id" "deepseq-1.4.1.1-221104de3b70837212b17aeb24781f46" "-package-id" "ghcjs-base-0.2.0.0-63fbb2f6833ad403ae52802aa0f12155" "-package-id" "mtl-2.2.1-88e615093eb72b33e8e48eca9396796c" "-package-id" "template-haskell-2.10.0.0-4a14865506a288db83640d5902bbf74e" "-package-id" "text-1.2.1.1-143e2b21f3b7f11ce926e3b74b97d235" "-package-id" "time-1.5.0.1-c55ef234a11d3c02dd441bdf346a7342" "-package-id" "unordered-containers-0.2.5.1-7321e65d882cabe2643a15780b81da9a" "-XHaskell2010" "-XCPP" "-XEmptyDataDecls" "-XExistentialQuantification" "-XFlexibleContexts" "-XFlexibleInstances" "-XFunctionalDependencies" "-XGeneralizedNewtypeDeriving" "-XMultiParamTypeClasses" "-XDeriveGeneric" "-XOverloadedStrings" "-XScopedTypeVariables" "-XTypeFamilies" "-Wall" "-O0" "-v7"
DEBUG: initSession: Session not initialized, creating new one
wired-in package ghc-prim mapped to ghc-prim-0.4.0.0-befc8fea2f3d1fbb5c8d9d76daa004f8
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-fe48735f5952c9cfd131a37f6b03b1f3
wired-in package base mapped to base-4.8.0.0-a3a3ebe3085e9d11c37cceba58a4365f
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.10.0.0-4a14865506a288db83640d5902bbf74e
wired-in package ghc not found.
wired-in package dph-seq not found.
wired-in package dph-par not found.
wired-in package ghc-prim mapped to ghc-prim-0.4.0.0-befc8fea2f3d1fbb5c8d9d76daa004f8
wired-in package integer-gmp mapped to integer-gmp-0.5.1.0-fe48735f5952c9cfd131a37f6b03b1f3
wired-in package base mapped to base-4.8.0.0-a3a3ebe3085e9d11c37cceba58a4365f
wired-in package rts mapped to builtin_rts
wired-in package template-haskell mapped to template-haskell-2.10.0.0-4a14865506a288db83640d5902bbf74e
wired-in package ghc not found.
wired-in package dph-seq not found.
wired-in package dph-par not found.
<command line>: cannot satisfy -package-id aeson-0.9.0.1-18aa0b80940b48ed7f17b22f32a24d4f    (use -v for more information)

nrolland avatar Oct 31 '15 22:10 nrolland

This should take care of the majority of cases: https://github.com/kazu-yamamoto/ghc-mod/pull/687

DanielG avatar Nov 26 '15 15:11 DanielG