You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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.
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.
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.
@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)
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.
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.
Activity
23Skidoo commentedon Apr 19, 2019
/cc @ezyang
andrewthad commentedon Jul 3, 2019
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.andrewthad commentedon Jul 21, 2019
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. Insockets, I only make use of backpack internally.andrewthad commentedon Jul 21, 2019
As a workaround, if I add a cabal.project file to pull the source code from github, everything works fine:
andrewthad commentedon Sep 9, 2019
Hmmm... with
cabal-install-3.0andghc-8.8.1, both released somewhat recently, I get a different error message:And then with
--ghc-options='-dppr-debug':Weird. This more verbose error doesn't even come from the same module.
andrewthad commentedon Sep 9, 2019
Keep in mind, this failure only happens when I use
socketsas a dependency from hackage or when Icabal v2-install sockets. If I insteadcabal unpack sockets && cd sockets-0.5.0.0 && cabal v2-build, everything works fine.vmchale commentedon Sep 29, 2019
@andrewthad I'm having a similar problem when I try to depend on
unpacked-containersfrom Hackage. Somewhat vexingly, when I unpack it and add it to mycabal.projectit works just fine.(I'm also getting a bad interface file warning when I try to run
cabal installbut notcabal build)andrewthad commentedon Sep 30, 2019
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.
ezyang commentedon Oct 27, 2019
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.Compute correct install directories for instantiated Backpack components
Compute correct install directories for instantiated Backpack compone…
DanielG commentedon Mar 25, 2020
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?
Mikolaj commentedon May 28, 2021
@DanielG: am I right the warnings in the docs are gone now?
fgaz commentedon Aug 6, 2021
No, just moved to chapter 6 but #7518 removes it
Mikolaj commentedon Aug 6, 2021
Huh. Thanks. :)
Drop obsolete Backpack warning from Chapter 6. (See: #6005)
Drop obsolete Backpack warning from Chapter 6. (See: #6005)
Merge pull request #7521 from haskell/mergify/bp/3.6/pr-7518