Skip to content

Problems using cabal-install with backpack #6005

Closed

Description

@vmchale

Hi,

I'm trying to use cabal with a backpack-ified library, viz. archive-tar (which provides a signature for archive-sig. Unfortunately, the build fails with

Installing   archive-sig-0.1.0.0 (lib)

Failed to build archive-sig-0.1.0.0. The failure occurred during the final
install step.
Build log (
/home/vanessa/.cabal/logs/ghc-8.6.4/archive-sig-0.1.0.0-63b09de7c791f4fc3a113a853baaa9866da61a06d6904f7a1606df18d4d93fe8.log
):
Configuring library for archive-sig-0.1.0.0..
Preprocessing library for archive-sig-0.1.0.0..
Building library instantiated with Archive = <Archive>
for archive-sig-0.1.0.0..
[1 of 2] Compiling Archive[sig]     ( src/Archive.hsig, nothing )
[2 of 2] Compiling Archive.Generic  ( src/Archive/Generic.hs, nothing )
Installing library in /home/vanessa/.cabal/store/ghc-8.6.4/incoming/new-24224/home/vanessa/.cabal/store/ghc-8.6.4/archive-sig-0.1.0.0-63b09de7c791f4fc3a113a853baaa9866da61a06d6904f7a1606df18d4d93fe8/lib
cabal: '/opt/ghc/bin/ghc' exited with an error:
Failed to load interface for ‘Data.DList’
no unit id matching
‘dlist-0.8.0.6-8fa4f62b6f8ca69e1a8182b60bd05c108ae5778932e24195d5646fce42a11a17’
was found

cabal: Failed to build archive-sig-0.1.0.0 (which is required by exe:atspkg
from ats-pkg-3.2.5.12). See the build log above for details.

You can see a branch with a failing project here. I'm happy to provide more debug information.

Thanks!

Activity

  1. 23Skidoo commented on Apr 19, 2019

    @23Skidoo
    Member
  2. andrewthad commented on Jul 3, 2019

    @andrewthad
    Contributor

    I’m getting the same problem when I try to build sockets-0.4.0.0. I can build the library fine if I just clone of the source and build it. However, installing the library from hackage doesn’t work. I’m using cabal-install 3.0 from hvr’s ppa. The build failure I get mentions A missing unit I’d for attoparsec. However, sockets does not depend on attoparsec even transitively.

  3. andrewthad commented on Jul 21, 2019

    @andrewthad
    Contributor

    This is even worse than I originally thought it was. If I have any project that depends on sockets-0.5.0.0, both cabal-install 2.4 and cabal-install 3.0 fail while they are trying to build the dependencies. In sockets, I only make use of backpack internally.

  4. andrewthad commented on Jul 21, 2019

    @andrewthad
    Contributor

    As a workaround, if I add a cabal.project file to pull the source code from github, everything works fine:

    packages: .
    source-repository-package
      type: git
      location: https://github.com/andrewthad/sockets
      tag: d550360722e5ec9c47d4da76d706bddc05d9bcf3
    
  5. andrewthad commented on Sep 9, 2019

    @andrewthad
    Contributor

    Hmmm... with cabal-install-3.0 and ghc-8.8.1, both released somewhat recently, I get a different error message:

    src-stream-send-two/Stream/Send/Two/Indefinite.hs:23:1: error:
        Bad interface file: /home/amartin/.cabal/store/ghc-8.8.1/sockets-0.5.0.0-8deb27ba191e1ebe09e786e4a880b7a965bd7465558cee0fb50028ed98339700/lib/Stream/Send/Indefinite.hi
            Something is amiss; requested module  sockets-0.5.0.0:Stream.Send.Indefinite differs from name found in the interface file sockets-0.5.0.0:sockets-stream-send[Socket.Buffer=<Socket.Buffer>,Socket.Interrupt=<Socket.Interrupt>,Stream.Send=<Stream.Send>]:Stream.Send.Indefinite (if these names look the same, try again with -dppr-debug)
    

    And then with --ghc-options='-dppr-debug':

    [1 of 4] Compiling Socket.Buffer[sig] ( dist/build/sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a+PEViGB1yV4A3ZHux7RJB2/autogen/Socket/Buffer.hsig, dist/build/sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a+PEViGB1yV4A3ZHux7RJB2/Socket/Buffer.o )
    [2 of 4] Compiling Datagram.Send[sig] ( src-datagram-send/Datagram/Send.hsig, dist/build/sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a+PEViGB1yV4A3ZHux7RJB2/Datagram/Send.o )
    [3 of 4] Compiling Socket.Interrupt[sig] ( dist/build/sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a+PEViGB1yV4A3ZHux7RJB2/autogen/Socket/Interrupt.hsig, dist/build/sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a+PEViGB1yV4A3ZHux7RJB2/Socket/Interrupt.o )
    
    <no location info>: error:
        • Identifier ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.tokenToDatagramReceiveException{v r2bM}’ has conflicting definitions in the module
          and its hsig file
          Main module: Socket.Interruptible.tokenToDatagramReceiveException{v} ::
                         sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
                         -> base:Data.Either.Either{tc 32I}
                              (sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Datagram.ReceiveException{tc r2c4}
                                 'sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible{d r2c2})
                              ()
          Hsig file:  Socket.Interruptible.tokenToDatagramReceiveException{v} ::
                        sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
                        -> base:Data.Either.Either{tc 32I}
                             (sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.Datagram.ReceiveException{tc r3vE}
                                sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Intr{tc r2bU})
                             ()
          The two types are different
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    
    <no location info>: error:
        • Identifier ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.tokenToDatagramSendException{v r2bO}’ has conflicting definitions in the module
          and its hsig file
          Main module: Socket.Interruptible.tokenToDatagramSendException{v} ::
                         sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
                         -> base:Data.Either.Either{tc 32I}
                              (sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Datagram.SendException{tc r2c7}
                                 'sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible{d r2c2})
                              ()
          Hsig file:  Socket.Interruptible.tokenToDatagramSendException{v} ::
                        sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
                        -> base:Data.Either.Either{tc 32I}
                             (sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.Datagram.SendException{tc r3vF}
                                sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Intr{tc r2bU})
                             ()
          The two types are different
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    
    <no location info>: error:
        • Identifier ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.tokenToStreamReceiveException{v r2bP}’ has conflicting definitions in the module
          and its hsig file
          Main module: Socket.Interruptible.tokenToStreamReceiveException{v} ::
                         sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
                         -> ghc-prim:GHC.Types.Int{(w) tc 3u}
                         -> base:Data.Either.Either{tc 32I}
                              (sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Stream.ReceiveException{tc r2c9}
                                 'sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible{d r2c2})
                              ()
          Hsig file:  Socket.Interruptible.tokenToStreamReceiveException{v} ::
                        sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
                        -> ghc-prim:GHC.Types.Int{(w) tc 3u}
                        -> base:Data.Either.Either{tc 32I}
                             (sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.Stream.ReceiveException{tc r3vG}
                                sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Intr{tc r2bU})
                             ()
          The two types are different
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    
    <no location info>: error:
        • Identifier ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.tokenToStreamSendException{v r2bQ}’ has conflicting definitions in the module
          and its hsig file
          Main module: Socket.Interruptible.tokenToStreamSendException{v} ::
                         sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
                         -> ghc-prim:GHC.Types.Int{(w) tc 3u}
                         -> base:Data.Either.Either{tc 32I}
                              (sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Stream.SendException{tc r2cb}
                                 'sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible{d r2c2})
                              ()
          Hsig file:  Socket.Interruptible.tokenToStreamSendException{v} ::
                        sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
                        -> ghc-prim:GHC.Types.Int{(w) tc 3u}
                        -> base:Data.Either.Either{tc 32I}
                             (sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.Stream.SendException{tc r3vH}
                                sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Intr{tc r2bU})
                             ()
          The two types are different
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    
    <no location info>: error:
        • Identifier ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.wait{v r2bR}’ has conflicting definitions in the module
          and its hsig file
          Main module: Socket.Interruptible.wait{v} ::
                         base:GHC.Conc.Sync.TVar{tc r2c0} ghc-prim:GHC.Types.Bool{(w) tc 38}
                         -> base:GHC.Conc.Sync.TVar{tc r2c0}
                              sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
                         -> ghc-prim:GHC.Types.IO{tc 31Q}
                              sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.EventManager.Token{tc r2c3}
          Hsig file:  Socket.Interruptible.wait{v} ::
                        sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Interrupt{tc r2bS}
                        -> base:GHC.Conc.Sync.TVar{tc r2c0}
                             sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
                        -> ghc-prim:GHC.Types.IO{tc 31Q}
                             sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.EventManager.Token{tc r3vD}
          The two types are different
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    
    <no location info>: error:
        • Type constructor ‘sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible.Intr{tc r2bU}’ has conflicting definitions in the module
          and its hsig file
          Main module: type Socket.Interruptible.Intr{tc} =
                         'sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible{d r2c2}
                         :: sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptibility{tc r2c1}
          Hsig file:  data Socket.Interruptible.Intr{tc} :: sockets-0.5.0.0-bbd8bdf0db2ae3424d9505dac0d27500805a7b7ad9736fac7b9bb66d989f3753:Socket.Interruptibility{tc r3vC}
          The types have different kinds
        • while checking that sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible implements signature Socket.Interrupt in sockets-0.5.0.0-8abe8c2dc62f922b6a95bb7b36ab50ee88eda17f689e33d1be4e039d99b4de0a[Datagram.Send=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Connected.MutableBytes,Socket.Buffer=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.MutableBytes,Socket.Interrupt=sockets-0.5.0.0-c0bfffbf31a0c6875b2b21aa40f666df2d540878970063d8789c720020afb82c:Socket.Interruptible]
    cabal: Failed to build lib:sockets-datagram-send from sockets-0.5.0.0 (which
    

    Weird. This more verbose error doesn't even come from the same module.

  6. andrewthad commented on Sep 9, 2019

    @andrewthad
    Contributor

    Keep in mind, this failure only happens when I use sockets as a dependency from hackage or when I cabal v2-install sockets. If I instead cabal unpack sockets && cd sockets-0.5.0.0 && cabal v2-build, everything works fine.

  7. vmchale commented on Sep 29, 2019

    @vmchale
    ContributorAuthor

    @andrewthad I'm having a similar problem when I try to depend on unpacked-containers from Hackage. Somewhat vexingly, when I unpack it and add it to my cabal.project it works just fine.

    (I'm also getting a bad interface file warning when I try to run cabal install but not cabal build)

  8. andrewthad commented on Sep 30, 2019

    @andrewthad
    Contributor

    Interesting. It seems like this is an even bigger problem than I had assumed it was. If this isn't going to be addressed any time soon, it's probably worth mentioning in the user manual that libraries that use backpack in any capacity should not be uploaded to hackage for the time being.

  9. ezyang commented on Oct 27, 2019

    @ezyang
    Contributor

    I've root caused the problem: it indeed is because we are loading the wrong interface, because Cabal is installing package files which point at the wrong location. In the package conf for an instantiated package, I see that it provides import-dirs (and other directories) which point at the indefinite package. Still looking for where the error in code lies.

  10. added a commit that references this issue on Oct 28, 2019
    fa9fa1c
  11. added a commit that references this issue on Nov 3, 2019
    129775a
  12. DanielG commented on Mar 25, 2020

    @DanielG
    Collaborator

    FYI the docs still seem to have a warning about this issue: https://cabal.readthedocs.io/en/latest/nix-local-build.html#cabal-v2-sdist that should probably be removed if this is fixed?

  13. Mikolaj commented on May 28, 2021

    @Mikolaj
    Member

    @DanielG: am I right the warnings in the docs are gone now?

  14. fgaz commented on Aug 6, 2021

    @fgaz
    Member

    No, just moved to chapter 6 but #7518 removes it

  15. Mikolaj commented on Aug 6, 2021

    @Mikolaj
    Member

    Huh. Thanks. :)

  16. added a commit that references this issue on Aug 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions