Repository navigation
Closed
Description
I get that error on cabal build
Preprocessing executable 'cabal' for cabal-install-1.20.0.0...
Linking dist/dist-sandbox-83973e47\build\cabal\cabal.exe ...
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x40de): undefined reference to `shutdownWinSock'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x4176): undefined reference to `shutdownWinSock'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x455c): undefined reference to `initWinSock'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x45d0): undefined reference to `getWSErrorDescr'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x472c): undefined reference to `getWSErrorDescr'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x4873): undefined reference to `shutdownWinSock'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x116d5): undefined reference to `newAcceptParams'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x116e9): undefined reference to `acceptDoProc'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x1172f): undefined reference to `acceptNewSock'
C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o):fake:(.text+0x117aa): undefined reference to `getWSErrorDescr'
c:/users/sqlserver/ghc/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: C:\Users\sqlserver\cabal-1.20\cabal-install\.cabal-sandbox\x86_64-windows-ghc-7.8.2\network-2.4.2.2/libHSnetwork-2.4.2.2.a(Socket.o): bad reloc address 0x0 in section `.data'
c:/users/sqlserver/ghc/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.6.3/../../../../x86_64-w64-mingw32/bin/ld.exe: final link failed: Invalid operation
collect2: ld returned 1 exit status
Failed to install cabal-install-1.20.0.0
cabal.exe: Error: some packages failed to install:
cabal-install-1.20.0.0 failed during the building phase. The exception was:
ExitFailure 1
System:
OS: Windows 7 (64bits)
GHC: 7.8.2
cabal-install: cabal-install version 1.18.0.1 using version 1.18.0 of the Cabal library
Metadata
Metadata
Assignees
Labels
No labels
Activity
23Skidoo commentedon Apr 17, 2014
Sounds like either a GHC or a user configuration bug. But it looks like you're using the correct
ldexecutable...YoEight commentedon Apr 17, 2014
Do you need more information ? Have you got any idea on what kind of misconfiguration can lead to that behaviour ?
23Skidoo commentedon Apr 17, 2014
I'll try to reproduce this on my machine. Usually stuff like this means that you have an incompatible
gccorldexecutable in thePATHoverriding the one(s) that came with GHC.If you can paste the full output of
cabal build -v3, that could be helpful.YoEight commentedon Apr 17, 2014
23Skidoo commentedon Apr 17, 2014
Will try to look at this tomorrow.
tibbe commentedon Apr 18, 2014
This might be a network package issue that we fixed in the latest release of network: haskell/network#132
I will backport that fix to older versions of network and make a release that works.
tibbe commentedon Apr 18, 2014
@YoEight I've uploaded a new version of network. Could you please try
Note that building network requires that you have msys/mingw installed.
When we actually release 1.20, we will provide a downloaded cabal-install binary so you shouldn't have to build from source. I appreciate any testing we can get before then however.
YoEight commentedon Apr 18, 2014
@tibbe I get that message during install:
tibbe commentedon Apr 18, 2014
I've verified that the network tarbal itself is fine, so the problem is elsewhere. Which GHC version are you using? There's an issue with old
~/.cabal/configfiles and GHC 7.8 (#1787). Could you try:This will make cabal write a completely fresh config file.
P.S. You can also look at the output of
cabal install -v3to see if it mentions anything more about exactly what is corrupted.P.S.S. I don't have a Windows install so it's a bit hard for me to debug this. Perhaps @23Skidoo could help.
YoEight commentedon Apr 18, 2014
I have no
.cabal/configin my directoryI'm using ghc 7.8.2 32bits. I also got a working 64bits version but not in $PATH
tibbe commentedon Apr 18, 2014
@YoEight do you have a GHC 7.6 you could try with?
You do have a
configfile somewhere (perhaps underC:\Program Files). If you can find it and remove it you can try my above possible fix.YoEight commentedon Apr 18, 2014
@tibbe
I have untar the file manually and can know compile cabal-1.20.0 with ghc 7.8.2. Do you still want me to try with 7.6 ?You were right I had
C:\Program Files(x86)\Haskell, and now I can run your commandYoEight commentedon Apr 18, 2014
@tibbe Unfortunately, now I get this message:
YoEight commentedon Apr 18, 2014
@tibbe I ran this command in a Cygwin64 environment because on regular
cmdI gottibbe commentedon Apr 18, 2014
@awson do you know what's going with the linking errors above? I merged your fixes into the 2.4 branch and released them as network-2.4.2.3.
6 remaining items
awson commentedon Apr 18, 2014
@tibbe Nope. @YoEight used cygwin64 in that comment. See #1785 (comment).
tibbe commentedon Apr 18, 2014
@awson Oh I see. Should we change network to recognize Cygwin as well you think?
tibbe commentedon Apr 18, 2014
@YoEight for now I think your best bet is to use MinGW+MSYS (not MinGW + cmd).
awson commentedon Apr 18, 2014
@tibbe I think we should. Since we have no cygwin runtime for GHC, we are able to use cygwin only as a build environment and we would always get mingw runtime based results.
Thus we should treat 'cygwin_' exactly as 'mingw_' when configuring.
But it is absolutely necessary to make 'configure' to pick GHC-supplied mingw-based gcc+runtime or compatible one and not cygwin's one. Being Windows developer myself, I know almost nothing about 'configure'-related machinery but it looks this is not the case for network package now.
OTOH, depending on MSYSTEM environment variable, MSys2 shell when launched picks up different gcc+runtime (if installed) and makes 'uname' report different info. If cygwin would have similar mechanisms they could be used.
23Skidoo commentedon Apr 18, 2014
The
gcc/ld/etc paths should be picked fromghc --infooutput, like we already do in Cabal. Cabal already passes thegccpath to theconfigurescript with--with-gcc, but IIUC this is a non-standard interface and we really should be using./configure CC=/path/to/gcc.tibbe commentedon Apr 18, 2014
I'm happy to merge patches to network and cabal. I don't have a Windows machine/VM to test on so I'll have to rely on you guys to fix these issues.
tibbe commentedon Apr 18, 2014
@YoEight it seems there might be a problem with parallel builds on Windows. Try passing
-j1tocabal install.@ppseafield sent me the following email:
tibbe commentedon Apr 20, 2014
Marked as duplicate of #1784.
YoEight commentedon Apr 20, 2014
@tibbe Let me know if I can help with my Win box
tibbe commentedon Apr 20, 2014
@YoEight Thanks. We've got the issue fixed (by turning of library stripping on Windows). Will make the 1.20 release today.
WillSewell commentedon Aug 8, 2014
I am getting this same issue.
I tried
cabal install --constraint="network == 2.4.2.3" http://johantibell.com/files/Cabal-1.20.0.0-rc2.tar.gz http://johantibell.com/files/cabal-install-1.20.0.0-rc2.tar.gzand
cabal install -j1 cabal-installand both give me the same error. I am trying to run this in cygwin. Is there anything I can do?
YoEight commentedon Aug 11, 2014
@WillSewell from experience, cygwin doesn't play very well with ghc or cabal. I suggest to stick to msys
WillSewell commentedon Aug 17, 2014
@YoEight Thank you. That seemed to do it for me, but I had to uninstall + re-install everything first.