[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: haskell-skein and exotic architectures


On Mon, Jan 02, 2012 at 11:10:47PM -0200, Felipe Almeida Lessa wrote:
> Hey!
> On Mon, Jan 2, 2012 at 9:07 PM, Iain Lane <laney@debian.org> wrote:
> > I just implemented this in Debian as a patch, which I've attached and it
> > would be nice if you could incorporate upstream. I don't see how the
> > static list solution can work for biendian architectures like arm (the
> > Debian LE arm porterbox 'abel.debian.org' returns 'arm' for
> > System.Info.arch) and mips, but you could add s390 to BE.
> >
> > Sorry for the silence; I must admit this fell off the radar. :-(
> Your patch as it is seems to break configuration for ppc and sparc (or
> at least turn it very fragile).  On these architectures, both
> 'arch(i386) || arch(x86_64) || !flag(be)' and 'arch(ppc) ||
> arch(sparc) || flag(be)' will be True by default, the former because
> of '!flag(be)' and the latter because of 'arch(ppc) || arch(sparc)'.
> This leads to something like -DSKEIN_NEED_SWAP=0 -DSKEIN_NEED_SWAP=1.
> So unfortunately I can't accept it.

Ah, indeed. Everything is OK if you always specify the flag (as we do
for our distro builds), but if you don't then the logic isn't right.

> There are three options:
>  - Use only flag be.  This is bad IMHO because every user of a BE arch
> would need to manually install skein with given flag.  Debian and
> other distros could automate this for their packages, but a lot of
> people use cabal-install.
>  - Manually add arches to that list, which was what I suggested initially.

I believe you could add s390 to the BE list.

>  - Use two flags: force-endian and big-endian.  Then big-endian would
> be taken into account only if force-endian was True, and it would be
> False by default.

Could work. Or you could have two flags le and be both defaulting to
false and then make the first conditional arch(i386) | … | flag(le) and
the second … | flag(be). And then make it an error to have them both
true at once (if that is possible).

> Regarding biendian archs, I admit I don't know how they work, so I
> can't be of much help =(.

Some arches have big and little-endian variants, and it seems like
System.Info.arch (the thing that Cabal uses AFAIK) doesn't distinguish
between them, so you can't use conditionals in cabal files for such


Iain Lane                                  [ iain@orangesquash.org.uk ]
Debian Developer                                   [ laney@debian.org ]
Ubuntu Developer                                   [ laney@ubuntu.com ]
PhD student                                       [ ial@cs.nott.ac.uk ]

Attachment: signature.asc
Description: Digital signature

Reply to: