
Hi, Simon — Is it licit to have source files in base depend on preprocessing by hsc2hs? My suspicion is "no", but I want to be sure. Thanks, Bryan.

On 27/12/09 20:59, Bryan O'Sullivan wrote:
On Sun, Dec 27, 2009 at 10:55 AM, Bryan O'Sullivan
mailto:bos@serpentine.com> wrote: Is it licit to have source files in base depend on preprocessing by hsc2hs? My suspicion is "no", but I want to be sure.
Never mind, I found a ".hsc" source file in base, so it must be okay after all :-)
hsc2hs in base leads to problems with bootstrapping from HC files, so in the past we've tried to avoid it. However, there are .hsc files in other packages that also cause problems, so we really need to solve this problem another way (probably by processing .hsc files on the target system when bootstrapping). Upshot: don't worry about adding more .hsc files to base. Cheers, Simon

Quoth "Bryan O'Sullivan"
On Sun, Dec 27, 2009 at 10:55 AM, Bryan O'Sullivan
wrote: Is it licit to have source files in base depend on preprocessing by hsc2hs? My suspicion is "no", but I want to be sure.
Never mind, I found a ".hsc" source file in base, so it must be okay after all :-)
I guess it depends on your definition of "okay". It's awkward for the `unregisterised' port process, where you build .hc files on a supported host with similar hardware, because the .hc files will have been hsc2hs processed on the wrong platform when you compile them. So just for example if 1) the layout of struct rusage is different between the two hosts, and 2) the initial bootstrap ghc uses those functions in System/CPUTime.hsc while trying to build itself, there's going to be trouble. Strictly speaking, though, that isn't so much a problem with hsc2hs per se, rather with .hsc files that include platform-dependent C definitions. If you provide the C source also, and hsc2hs sees only platform-independent definitions from your source, then I don't see how that would be a problem. In the above example I suppose that would mean a `struct ghc_rusage' or something. Donn Cave, donn@avvanta.com
participants (3)
-
Bryan O'Sullivan
-
Donn Cave
-
Simon Marlow