Visitar URL original
cannot satisfy -package-id errors · Issue #76 · hdevtools/hdevtools · GitHub
Skip to content

cannot satisfy -package-id errors #76

Open

Description

@hasufell

Running in a cabal sandbox of this project with latest stable ghc (8.2.2)

$ hdevtools check src/HSFM/History.hs -d -g -v
Cabal file: Just "/home/hasufell/git/hsfm/./hsfm.cabal"
Stack file: Nothing
Socket file: "/home/hasufell/git/hsfm/./.hdevtools.sock"
<no location info>:
    Using binary package database: /home/hasufell/.ghc-system/lib/ghc-8.2.2.20180117/package.conf.d/package.cache
<no location info>:
    Using binary package database: /home/hasufell/.ghc/x86_64-linux-8.2.2.20180117/package.conf.d/package.cache
<no location info>:
    Using binary package database: /home/hasufell/git/hsfm/.cabal-sandbox/x86_64-linux-ghc-8.2.2.20180117-packages.conf.d/package.cache
<no location info>:
    package flags [-package-id Cabal-2.0.1.0{unit Cabal-2.0.1.0 True ([])},
                   -package-id base-4.10.1.0{unit base-4.10.1.0 True ([])},
                   -package-id bytestring-0.10.8.2{unit bytestring-0.10.8.2 True ([])},
                   -package-id filepath-1.4.1.2{unit filepath-1.4.1.2 True ([])},
                   -package-id glib-0.13.5.0-5n6S0rOXgzZ8WPmvUMyCor{unit glib-0.13.5.0-5n6S0rOXgzZ8WPmvUMyCor True ([])},
                   -package-id gtk3-0.14.8-wdYsJySLPx3q2SnzVXEZz{unit gtk3-0.14.8-wdYsJySLPx3q2SnzVXEZz True ([])},
                   -package-id hinotify-bytestring-0.3.8.1-9LFXG74jB5l1avf8ir8LSk{unit hinotify-bytestring-0.3.8.1-9LFXG74jB5l1avf8ir8LSk True ([])},
                   -package-id hpath-0.8.0-AmpVWBXEVCu1jTGwfrOkNL{unit hpath-0.8.0-AmpVWBXEVCu1jTGwfrOkNL True ([])},
                   -package-id hsfm-0.0.0.1-Lfx0tX0IEiFEatectPJIJW{unit hsfm-0.0.0.1-Lfx0tX0IEiFEatectPJIJW True ([])},
                   -package-id monad-loops-0.4.3-4g9tbQ6v5D92QXu31BWMk9{unit monad-loops-0.4.3-4g9tbQ6v5D92QXu31BWMk9 True ([])},
                   -package-id old-locale-1.0.0.7-uLYLcRn7Nv8SkmeS8fMf9{unit old-locale-1.0.0.7-uLYLcRn7Nv8SkmeS8fMf9 True ([])},
                   -package-id process-1.6.1.0{unit process-1.6.1.0 True ([])},
                   -package-id safe-0.3.16-9YcgrXj17kg79mfNx7tCoF{unit safe-0.3.16-9YcgrXj17kg79mfNx7tCoF True ([])},
                   -package-id simple-sendfile-0.2.27-9msR4LkQZoWCOYn5RGGRnE{unit simple-sendfile-0.2.27-9msR4LkQZoWCOYn5RGGRnE True ([])},
                   -package-id stm-2.4.5.0-15FdumhhnVEKazIoQZDzp1{unit stm-2.4.5.0-15FdumhhnVEKazIoQZDzp1 True ([])},
                   -package-id time-1.8.0.2{unit time-1.8.0.2 True ([])},
                   -package-id transformers-0.5.2.0{unit transformers-0.5.2.0 True ([])},
                   -package-id unix-2.7.2.2{unit unix-2.7.2.2 True ([])},
                   -package-id unix-bytestring-0.3.7.3-pXc9nsdPWU6aOminZynIc{unit unix-bytestring-0.3.7.3-pXc9nsdPWU6aOminZynIc True ([])},
                   -package-id utf8-string-1.0.1.1-7sQ7eR5H5ED7poickls5aO{unit utf8-string-1.0.1.1-7sQ7eR5H5ED7poickls5aO True ([])},
                   -package-id word8-0.1.3-C7vr3ObxpJ0EFhIkA3lNrM{unit word8-0.1.3-C7vr3ObxpJ0EFhIkA3lNrM True ([])}]
<no location info>:
    loading package database /home/hasufell/.ghc-system/lib/ghc-8.2.2.20180117/package.conf.d
<no location info>:
    loading package database /home/hasufell/.ghc/x86_64-linux-8.2.2.20180117/package.conf.d
<no location info>:
    loading package database /home/hasufell/git/hsfm/.cabal-sandbox/x86_64-linux-ghc-8.2.2.20180117-packages.conf.d
<no location info>:
    package ansi-terminal-0.8.0.1-1ACuSYWLYbA6EptIrIJkN4 overrides a previously defined package
<no location info>:
    package colour-2.3.4-3MiiEznBxpfEYrMTHbnSer overrides a previously defined package
<no location info>:
    package exceptions-0.8.3-8jq1x3muwGHIWN3Vqa2qrf overrides a previously defined package
<no location info>:
    package hashable-1.2.6.1-1CEyWRgqAFgCUxDoGPXj9S overrides a previously defined package
<no location info>:
    package mtl-2.2.1-DscMMmDQUE6GBfOSl4qMUH overrides a previously defined package
<no location info>:
    package network-2.6.3.3-LsInmfJLY3IBO2L8iqXwV9 overrides a previously defined package
<no location info>:
    package old-locale-1.0.0.7-uLYLcRn7Nv8SkmeS8fMf9 overrides a previously defined package
<no location info>:
    package primitive-0.6.3.0-CXy1O9sQYlI58rn9KQkFyo overrides a previously defined package
<no location info>:
    package random-1.1-LLUGZ7T9DqQ5vN0Jbcd0We overrides a previously defined package
<no location info>:
    package stm-2.4.5.0-15FdumhhnVEKazIoQZDzp1 overrides a previously defined package
<no location info>:
    package text-1.2.3.0-BcISmLFYuX48LxJqafTQTN overrides a previously defined package
<no location info>:
    package transformers-compat-0.5.1.4-8ROpHfTW2Zp5hyE7gQe9fh overrides a previously defined package
<no location info>:
    package vector-0.12.0.1-4FlkEWKNqrgLl7wn5Cpq3g overrides a previously defined package
cannot satisfy -package-id hsfm-0.0.0.1-Lfx0tX0IEiFEatectPJIJW
    (use -v for more information)

Activity

  1. jwiegley commented on May 15, 2018

    @jwiegley

    I'm encountering this same problem using hdevtools, Cabal and Nix.

  2. hasufell commented on May 15, 2018

    @hasufell
    ContributorAuthor

    project seems abandoned

  3. jwiegley commented on May 15, 2018

    @jwiegley

    Which is really too bad, because when it works, it's crazy fast.

  4. ch1bo commented on May 17, 2018

    @ch1bo
    Member

    Let's call the project not abandoned..but maybe on life support :p

    I ran into a similar problem yesterday and plan to look into this and related issues.

    As you are using cabal-install, which version of hdevtools are you using? Can you post the hdevtools version output and maybe ghc -info?

  5. jwiegley commented on May 17, 2018

    @jwiegley
    [nix-shell:~/bae/micromht-fiat-deliverable/atif-fiat]$ hdevtools --version
    hdevtools: version 0.1.6.1 (ghc-8.2.2-x86_64-darwin, cabal-2.0.1.0)
    
    [nix-shell:~/bae/micromht-fiat-deliverable/atif-fiat]$ ghc --info
     [("Project name","The Glorious Glasgow Haskell Compilation System")
     ,("GCC extra via C opts"," -fwrapv -fno-builtin")
     ,("C compiler command","/nix/store/8b0gj3bmcy5bh1zcnhn0146199b3m5kb-clang-wrapper-5.0.1/bin/cc")
     ,("C compiler flags"," -m64 -fno-stack-protector")
     ,("C compiler link flags","  -m64")
     ,("C compiler supports -no-pie","YES")
     ,("Haskell CPP command","/nix/store/8b0gj3bmcy5bh1zcnhn0146199b3m5kb-clang-wrapper-5.0.1/bin/cc")
     ,("Haskell CPP flags","-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs")
     ,("ld command","/nix/store/jxmp27m26646f67faji9v94d5471ma8y-cctools-binutils-darwin-wrapper/bin/ld")
     ,("ld flags"," -arch x86_64")
     ,("ld supports compact unwind","YES")
     ,("ld supports build-id","NO")
     ,("ld supports filelist","YES")
     ,("ld is GNU ld","NO")
     ,("ar command","/nix/store/kdff2gim6417493yha769kh00n63lnrw-cctools-binutils-darwin/bin/ar")
     ,("ar flags","clqs")
     ,("ar supports at file","NO")
     ,("touch command","touch")
     ,("dllwrap command","/bin/false")
     ,("windres command","/bin/false")
     ,("libtool command","libtool")
     ,("perl command","/nix/store/lizm7q36j5sf5524bw9gsykflv9i2l7z-perl-5.24.3/bin/perl")
     ,("cross compiling","NO")
     ,("target os","OSDarwin")
     ,("target arch","ArchX86_64")
     ,("target word size","8")
     ,("target has GNU nonexec stack","False")
     ,("target has .ident directive","True")
     ,("target has subsections via symbols","True")
     ,("target has RTS linker","YES")
     ,("Unregisterised","NO")
     ,("LLVM llc command","llc")
     ,("LLVM opt command","opt")
     ,("Project version","8.2.2")
     ,("Project Git commit id","0156a3d815b784510a980621fdcb9c5b23826f1e")
     ,("Booter version","8.2.1")
     ,("Stage","2")
     ,("Build platform","x86_64-apple-darwin")
     ,("Host platform","x86_64-apple-darwin")
     ,("Target platform","x86_64-apple-darwin")
     ,("Have interpreter","YES")
     ,("Object splitting supported","NO")
     ,("Have native code generator","YES")
     ,("Support SMP","YES")
     ,("Tables next to code","YES")
     ,("RTS ways","l debug thr thr_debug thr_l thr_p dyn debug_dyn thr_dyn thr_debug_dyn l_dyn thr_l_dyn")
     ,("RTS expects libdw","NO")
     ,("Support dynamic-too","YES")
     ,("Support parallel --make","YES")
     ,("Support reexported-modules","YES")
     ,("Support thinning and renaming package flags","YES")
     ,("Support Backpack","YES")
     ,("Requires unified installed package IDs","YES")
     ,("Uses package keys","YES")
     ,("Uses unit IDs","YES")
     ,("Dynamic by default","NO")
     ,("GHC Dynamic","YES")
     ,("GHC Profiled","NO")
     ,("Leading underscore","YES")
     ,("Debug on","False")
     ,("LibDir","/nix/store/czvig6mv3dm5bm04ryz304cg10sw4hd4-ghc-8.2.2-with-packages/lib/ghc-8.2.2")
     ,("Global Package DB","/nix/store/czvig6mv3dm5bm04ryz304cg10sw4hd4-ghc-8.2.2-with-packages/lib/ghc-8.2.2/package.conf.d")
     ]
    
  6. ch1bo commented on May 17, 2018

    @ch1bo
    Member

    While I am trying to reproduce the error using the HSFM project - currently having dependency resolution problems using cabal-install..

    Is it possible that the "cannot satisfy -package-id ..." error appears whenever the package/dependency structure of the .cabal file changes and is not satisfied, but hdevtools does not report it like a normal call to ghc via cabal or stack does? For example when i remove a build-depend by hand which ghc reports like:

    /home/nage_se/******/src/Deployment.hs:7:1: error:
        Could not find module ‘Control.Exception.Safe’
        Perhaps you meant
          Control.Exception.Base (from base-4.10.1.0)
          Control.Exception (from base-4.10.1.0)
        Use -v to see a list of the files searched for.
      |
    7 | import Control.Exception.Safe (MonadThrow)
      | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    
    
    --  While building custom Setup.hs for package cloud-deployment-0.1.0 using:
          /home/nage_se/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.0.1.0_ghc-8.2.2 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.0.1.0 build lib:cloud-deployment exe:deployment-server --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
        Process exited with code: ExitFailure 1
    

    hdevtools reports

    hdevtools check src/Deployment.hs
    cannot satisfy -package-id cloud-deployment-0.1.0-98Ltlc1B21nGuGLNbEpWRA
        (use -v for more information)
    

    I'll give it a try with changing library/executable sections, but that would mean that the maybe the internal ghc session is not correctly re-configured and/or errors are not reported properly to the user?

  7. ch1bo commented on May 17, 2018

    @ch1bo
    Member

    Somewhat good news - I can reproduce the error appearing also when ghc normally reports build errors and I am on it.

    Edit: Seems like the hdevtools server does not initialize the ghc session properly with build errors. Only after having everything set up against a working codebase, hdevtools can handle failing code and report on it. So a preliminary workaround to keep using hdevtools is to type check the code once when it is correctly building and keep the domain socket open (by default .hdevtools.sock) to type check "broken" code.

  8. hasufell commented on May 17, 2018

    @hasufell
    ContributorAuthor

    While I am trying to reproduce the error using the HSFM project - currently having dependency resolution problems using cabal-install..

    sidenote: what exactly? works perfectly here in a new sandbox. Also mind the instructions in the README:

    cabal sandbox init
    cabal install alex happy
    export PATH="$(pwd)/.cabal-sandbox/bin:$PATH"
    cabal install gtk2hs-buildtools
    cabal install
  9. jwiegley commented on May 17, 2018

    @jwiegley

    Just to note: I get the -package-id problem even in cases where there are no problems reported by either cabal or ghc.

  10. AesaKamar commented on Jul 13, 2018

    @AesaKamar

    Any updates with this, and more generally, hdevtools's integration with nix builds?

  11. hasufell commented on Mar 11, 2019

    @hasufell
    ContributorAuthor

    hdevtools's integration with nix builds?

    This ticket is not about nix.

    @ch1bo I'm still running into this error and there were no build errors in the project. (library+executable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions