Re: ghc-options: -threaded breaks some arches

Cabal developers,
Joachim Breitner
Am Sonntag, den 16.08.2009, 17:47 +0100 schrieb Neil Mitchell:
trying to build hlint does not work on some architectures (at least alpha, s390, mips) where no threaded RTS is available. An example build log is available at http://buildd.debian.org/build.php?arch=alpha&pkg=hlint&ver=1.6.4-1
This is caused by ghc-options: -fno-warn-overlapping-patterns -threaded in your hlint.cabal file. [..] If not, would it be possible to make this option dependent on the availability of a threaded RTS (either by direct support in cabal for checking it, similar to os(..) checks, or by passing a "-fthreaded" flag to setup configure)?
Yes, of course. What suits you? Any os checks would go wrong, so an -fnothreaded flag seems sensible? I'd still like threading to be the default.
that would be a start, thanks.
Of course I’d prefer if cabal had automatic support for this. I guess is does not ATM, so for now the flag is ok, and I’m hereby telling the Cabal people about this :-)
Did a trac ticket ever get created for this? This affects Darcs 2.3.0, so I'm about to add an -f-threaded to darcs.cabal for 2.4.0, because I don't know how to tell Cabal "use -threaded iff you can".

On Thu, 2009-10-29 at 18:55 +1100, Trent W. Buck wrote:
Of course I’d prefer if cabal had automatic support for this. I guess is does not ATM, so for now the flag is ok, and I’m hereby telling the Cabal people about this :-)
Did a trac ticket ever get created for this? This affects Darcs 2.3.0, so I'm about to add an -f-threaded to darcs.cabal for 2.4.0, because I don't know how to tell Cabal "use -threaded iff you can".
Looks like there's no ticket for it. If you write a patch now then we can probably get it into Cabal-1.8.x to be released with ghc-6.12.1. Otherwise it will almost certainly languish with the 100+ other open tickets. What you'd want to do is in the configure step for GHC to run "ghc --info" and parse the result into a name/value pair list and keep that in the Compiler data structure. Then during compile, if the package uses -threaded in the ghc-options and "RTS ways" does not include "thr" (or perhaps "Support SMP" is not "YES") then issue a warning and omit the flag. Duncan
participants (2)
-
Duncan Coutts
-
twb@cybersource.com.au