flag to compile a single module?
I was just thinking that it would be great jhc would compile just a single module (and its dependencies, of course) when that module was requested (instead of complaining about a lack of a main function). This would be handy for testing, but also could enable parallel builds, assuming that jhc won't trash the ho cache if two builds are run simultaneously (which is important anyhow... e.g. if building two versions of the same code at the same time). I'm imagining one could just request either a module or a hs file: jhc Foo.Bar or jhc Foo/Bar.hs Or am I missing something and is this already possible? David
On 09/09/2009, at 9:32 PM, David Roundy wrote:
I was just thinking that it would be great jhc would compile just a single module (and its dependencies, of course) when that module was requested (instead of complaining about a lack of a main function). This would be handy for testing, but also could enable parallel builds, assuming that jhc won't trash the ho cache if two builds are run simultaneously (which is important anyhow... e.g. if building two versions of the same code at the same time).
I'm imagining one could just request either a module or a hs file:
jhc Foo.Bar
or
jhc Foo/Bar.hs
Or am I missing something and is this already possible?
I think it's halfway there - compiling with '-D_JHC_STANDALONE=0' will make JHC not emit a main function. mark
On Wed, Sep 09, 2009 at 07:32:26AM -0400, David Roundy wrote:
I was just thinking that it would be great jhc would compile just a single module (and its dependencies, of course) when that module was requested (instead of complaining about a lack of a main function). This would be handy for testing, but also could enable parallel builds, assuming that jhc won't trash the ho cache if two builds are run simultaneously (which is important anyhow... e.g. if building two versions of the same code at the same time).
Hmmm.. I thought this worked with the '-c' option. If not, it is a bug. It would allow parallel compilations with 'make' if you told it about the module dependencies. (which you can extract with --annotate-source right now, but I am adding a better way) John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
Ah yes, that was what I was looking for... (feeling silly).
David
On Wed, Sep 9, 2009 at 5:22 PM, John Meacham
Hmmm.. I thought this worked with the '-c' option. If not, it is a bug. It would allow parallel compilations with 'make' if you told it about the module dependencies. (which you can extract with --annotate-source right now, but I am adding a better way)
John
should this work? """ 9:24 ~/projects % cat test.hs module Test where l = 1000 9:24 ~/projects % jhc -c test.hs jhc -c test.hs jhc 0.7.3 (-n 0.7.2-28 ) Finding Dependencies... Using Ho Cache: '/Users/mwotton/.jhc/cache' Test [test.hs] Typechecking... [1 of 1] Test (.............................................) Compiling... [1 of 1] Test <..................................................> jhc: src/FrontEnd/Representation.hs:98:9-24: No instance nor default method for class operation Data.Binary.put """ mark On 10/09/2009, at 7:47 AM, David Roundy wrote:
Ah yes, that was what I was looking for... (feeling silly).
David
On Wed, Sep 9, 2009 at 5:22 PM, John Meacham
wrote: Hmmm.. I thought this worked with the '-c' option. If not, it is a bug. It would allow parallel compilations with 'make' if you told it about the module dependencies. (which you can extract with --annotate- source right now, but I am adding a better way)
John
jhc mailing list jhc@haskell.org http://www.haskell.org/mailman/listinfo/jhc
On Thu, Sep 10, 2009 at 09:25:39AM +1000, Mark Wotton wrote:
should this work?
""" 9:24 ~/projects % cat test.hs module Test where
l = 1000 9:24 ~/projects % jhc -c test.hs jhc -c test.hs jhc 0.7.3 (-n 0.7.2-28 ) Finding Dependencies... Using Ho Cache: '/Users/mwotton/.jhc/cache' Test [test.hs] Typechecking... [1 of 1] Test (.............................................) Compiling... [1 of 1] Test <..................................................> jhc: src/FrontEnd/Representation.hs:98:9-24: No instance nor default method for class operation Data.Binary.put """
That is a known bug, if you add an explicit type signature for 'l' then it will compile just fine. I believe it is related to a bug dealing with defaulting. It is one of my failing regression tests. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
participants (4)
-
David Roundy -
David Roundy -
John Meacham -
Mark Wotton