darcs

Issue 2492 build regression with 2.10.3

Title build regression with 2.10.3
Priority Status wont-fix
Milestone Resolved in
Superseder Nosy List fx
Assigned To
Topics

Created on 2016-02-08.15:40:49 by fx, last changed 2016-03-06.13:14:55 by gh.

Messages
msg19019 (view) Author: fx Date: 2016-02-08.15:40:47
On Ubuntu 14.04 (ghc 7.6.3), "cabal install darcs-2.10.3" fails as
follows (after purging ~/.cabal), but it works with 2.10.2.

  Linking /tmp/darcs-2.10.3-10113/darcs-2.10.3/dist/setup/setup ...
  /usr/lib/ghc/unix-2.6.0.1/libHSunix-2.6.0.1.a(execvpe.o): In function `pPrPr_disableITimers':
  (.text+0x300): multiple definition of `pPrPr_disableITimers'
  /home/dlove/.cabal/lib/unix-2.7.1.0/ghc-7.6.3/libHSunix-2.7.1.0.a(ghcrts.o):ghcrts.c:(.text+0x0): first defined here
  collect2: error: ld returned 1 exit status
  Failed to install darcs-2.10.3
  cabal: Error: some packages failed to install:
  darcs-2.10.3 failed during the configure step. The exception was:
  ExitFailure 1

I don't know what other info might be relevant.
msg19020 (view) Author: gh Date: 2016-02-08.17:50:22
Thanks Dave,

I reproduced the bug on a machine with Ubuntu 14.04 (after deleting
.cabal and .ghc).

I found this, seems like we are not alone in the universe:

https://stackoverflow.com/questions/30687926/should-ghc-be-linking-different-versions-of-the-same-libraries

So, the useful piece of data here is that Darcs 2.10.2 compiles. Then
I guess a workaround for this problem would be to add some condition
on the GHC version in the darcs.cabal , something like:

if GHC < 7.10)
 then
    that-package < X
 else
    that-package < Y

(with X < Y)

But I haven't managed to make it work yet :-(

A cheap trick for the moment would be to compile the code of
darcs-2.10.3 with the darcs.cabal from darcs-2.10.2 .

Guillaume
msg19021 (view) Author: ganesh Date: 2016-02-08.17:59:51
Dave, did you also purge ~/.ghc ? That's where your installed 
packages would live that could be messing up your install.

I suspect that passing --constraint 'unix<2.7' , or using a sandbox 
(start with 'cabal sandbox init' in some throwaway directory) would 
also help. With cabal sandbox you would need to copy the resulting 
binary out of .cabal-sandbox/bin to somewhere on your PATH.
msg19022 (view) Author: ganesh Date: 2016-02-08.18:00:38
Sorry, I missed that Guillaume did try purging .ghc - that's quite 
surprising. Does a sandbox help for you?
msg19023 (view) Author: fx Date: 2016-02-08.21:00:52
Ganesh Sittampalam <bugs@darcs.net> writes:

> Ganesh Sittampalam <ganesh@earth.li> added the comment:
>
> Dave, did you also purge ~/.ghc ? That's where your installed 
> packages would live that could be messing up your install.

Yes, I did, sorry.

> I suspect that passing --constraint 'unix<2.7' ,

That produces

  cabal: The following packages are likely to be broken by the reinstalls:
  process-1.1.0.2
  haskell98-2.0.0.2
  ghc-7.6.3
  Cabal-1.16.0
  bin-package-db-0.0.0.0
  directory-1.2.0.1
  hpc-0.6.0.0
  Use --force-reinstalls if you want to install anyway.

> or using a sandbox 
> (start with 'cabal sandbox init' in some throwaway directory) would 
> also help. With cabal sandbox you would need to copy the resulting 
> binary out of .cabal-sandbox/bin to somewhere on your PATH.

cabal doesn't have a sandbox command.  I guess that means it's too old.
Sorry I don't know much about this stuff.

I'll try reverting to the old .cabal tomorrow.  Thanks.
msg19024 (view) Author: gh Date: 2016-02-09.09:37:00
I investigated if it was worth it asking Ubuntu people to backport a
new version of ghc so that Trusty (14.04) has unix 2.7.0.1 , but
apparently, it will *not* happen.

unix 2.7.0.1 appears only in Ubuntu Wily (15.04) with ghc 7.8 ( see
http://packages.ubuntu.com/wily/amd64/ghc/filelist ).

How about using stack to install a newer ghc in your working copy?
msg19025 (view) Author: fx Date: 2016-02-09.12:27:30
Guillaume Hoffmann <guillaumh@gmail.com> writes:

> I investigated if it was worth it asking Ubuntu people to backport a
> new version of ghc so that Trusty (14.04) has unix 2.7.0.1 , but
> apparently, it will *not* happen.
>
> unix 2.7.0.1 appears only in Ubuntu Wily (15.04) with ghc 7.8 ( see
> http://packages.ubuntu.com/wily/amd64/ghc/filelist ).
>
> How about using stack to install a newer ghc in your working copy?

Actually, it's not the compiler version.  The build works on Debian
stable, which has the same ghc 7.6.3.  I'll see if I can figure out what
the difference is from my limited knowledge of this stuff.

[I tried "cabal install stack", which couldn't resolve dependencies.]
msg19026 (view) Author: ganesh Date: 2016-02-10.06:06:10
On 08/02/2016 21:00, Dave Love wrote:
> 
> Ganesh Sittampalam <bugs@darcs.net> writes:
> 
> >> I suspect that passing --constraint 'unix<2.7' ,
> 
> That produces
> 
>   cabal: The following packages are likely to be broken by the reinstalls:
>   process-1.1.0.2
>   haskell98-2.0.0.2
>   ghc-7.6.3
>   Cabal-1.16.0
>   bin-package-db-0.0.0.0
>   directory-1.2.0.1
>   hpc-0.6.0.0
>   Use --force-reinstalls if you want to install anyway.

Hmm, that's strange. Can you provide the output of "ghc-pkg list" ?
Also, look at the version of "unix" it lists and pass that in a
constraint instead of 'unix<2.7', e.g. --constraint 'unix==2.6.0.1'. If
it lists multiple versions then pick the first.

If this still happens and you're not doing this as root, it should be
safe enough to try --force-reinstalls.

>> or using a sandbox 
>> (start with 'cabal sandbox init' in some throwaway directory) would 
>> also help. With cabal sandbox you would need to copy the resulting 
>> binary out of .cabal-sandbox/bin to somewhere on your PATH.

> cabal doesn't have a sandbox command.  I guess that means it's too old.
> Sorry I don't know much about this stuff.

You could try cabal install cabal-install to get a new one, but there's
always the risk that'll cause more hassle.I don't know if that wouldn't
have the same problem.

Cheers,

Ganesh
msg19036 (view) Author: fx Date: 2016-02-16.21:52:02
It turns out that "cabal install" in the unpacked 2.10.3 source
directory works.  It's just "cabal install darcs-2.10.3" that doesn't.
History
Date User Action Args
2016-02-08 15:40:49fxcreate
2016-02-08 17:50:24ghsetmessages: + msg19020
2016-02-08 17:59:53ganeshsetmessages: + msg19021
2016-02-08 18:00:40ganeshsetmessages: + msg19022
2016-02-08 21:00:53fxsetmessages: + msg19023
2016-02-09 09:37:01ghsetmessages: + msg19024
2016-02-09 12:27:32fxsetmessages: + msg19025
2016-02-10 06:06:12ganeshsetmessages: + msg19026
2016-02-16 21:52:04fxsetmessages: + msg19036
2016-03-06 13:14:55ghsetstatus: unknown -> wont-fix