darcs

Issue 2463 Building darcs on powerpc

Title Building darcs on powerpc
Priority Status resolved
Milestone Resolved in 2.12.0
Superseder Nosy List ganesh, nomeata
Assigned To
Topics

Created on 2015-07-15.17:49:35 by nomeata, last changed 2015-07-31.21:41:43 by noreply.

Files
File name Uploaded Type Edit Remove
Num-constraint nomeata, 2015-07-15.19:14:08 text/x-patch
Messages
msg18691 (view) Author: nomeata Date: 2015-07-15.17:49:34
Hi,

building darcs on powerpc fails with

[  3 of 233] Compiling Storage.Hashed.Utils ( hashed-storage/Storage/Hashed/Utils.hs, dist-ghc/build/Storage/Hashed/Utils.o )

hashed-storage/Storage/Hashed/Utils.hs:104:12:
    Could not deduce (Num a) arising from the literal `255'
    from the context (Bits a)
      bound by the type signature for bytemask :: Bits a => a
      at hashed-storage/Storage/Hashed/Utils.hs:103:13-25
    Possible fix:
      add (Num a) to the context of
        the type signature for bytemask :: Bits a => a
    In the expression: 255
    In an equation for `bytemask': bytemask = 255
make: *** [build-ghc-stamp] Error 1

I believe this fixes it:

Index: darcs/hashed-storage/Storage/Hashed/Utils.hs
===================================================================
--- darcs.orig/hashed-storage/Storage/Hashed/Utils.hs	2015-07-09 18:48:56.000000000 +0200
+++ darcs/hashed-storage/Storage/Hashed/Utils.hs	2015-07-15 19:35:55.341427506 +0200
@@ -100,7 +100,7 @@
 #endif
 
 #ifdef BIGENDIAN
-bytemask :: (Bits a) => a
+bytemask :: (Num a, Bits a) => a
 bytemask = 255
 
 xlate32 a = ((a .&. (bytemask `shift`  0)) `shiftL` 24) .|.

Greetings,
Joachim

-- 


-- 
Joachim “nomeata” Breitner
  mail@joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata@joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata@debian.org
msg18692 (view) Author: nomeata Date: 2015-07-15.19:14:08
Hi,

Am Mittwoch, den 15.07.2015, 17:49 +0000 schrieb Joachim Breitner:
> I believe this fixes it:

not quite, but the attached patch does.

Greetings,
Joachim


-- 
Joachim “nomeata” Breitner
  mail@joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata@joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata@debian.org
Attachments
msg18698 (view) Author: bfrk Date: 2015-07-16.18:29:07
IIRC, a rather recent change in the standard libraries removed the Num
constraint from Bits. Could/should we make the change as in the patch or
is this something for the new Darcs.Prelude?
msg18700 (view) Author: ganesh Date: 2015-07-16.20:38:06
Is this really a PowerPC-specific thing, or is it just a different 
version of base/GHC in play? It would seem odd for the type-
checker/libraries to be arch-dependent in this way.
msg18701 (view) Author: nomeata Date: 2015-07-16.20:46:27
Hi,

Am Donnerstag, den 16.07.2015, 20:38 +0000 schrieb Ganesh Sittampalam:
> Is this really a PowerPC-specific thing, or is it just a different
> version of base/GHC in play? It would seem odd for the type-
> checker/libraries to be arch-dependent in this way.
> 

not PowerPC, but Endian-specific; the code in question is guarded by an
ifdef, and is hence not exercised on amd64.

Greetings,
Joachim

-- 
Joachim “nomeata” Breitner
  mail@joachim-breitner.dehttp://www.joachim-breitner.de/
  Jabber: nomeata@joachim-breitner.de  • GPG-Key: 0xF0FBF51F
  Debian Developer: nomeata@debian.org
msg18717 (view) Author: noreply Date: 2015-07-31.21:41:41
The following patch sent by Joachim Breitner <mail@joachim-breitner.de> updated issue issue2463 with
status=resolved;resolvedin=2.12.0 HEAD

* resolve issue2463: building darcs on powerpc 
Ignore-this: 46abf6a5106ca28f84f7cb1b6ab5bd13
History
Date User Action Args
2015-07-15 17:49:35nomeatacreate
2015-07-15 19:14:10nomeatasetfiles: + Num-constraint
messages: + msg18692
2015-07-16 18:29:08bfrksetmessages: + msg18698
2015-07-16 20:38:07ganeshsetnosy: + ganesh
messages: + msg18700
2015-07-16 20:46:28nomeatasetmessages: + msg18701
2015-07-31 21:41:43noreplysetstatus: unknown -> resolved
messages: + msg18717
resolvedin: 2.12.0