Re: Discovery of source dependencies without --make

2015-12-13 Thread Edward Z. Yang
I missed context, but if you just want the topological graph, depanal will give you a module graph which you can then topsort with topSortModuleGraph (all in GhcMake). Then you can do what you want with the result. You will obviously need accurate targets but frontend plugins and guessTarget will

Re: Discovery of source dependencies without --make

2015-12-13 Thread Thomas Miedema
On Fri, Nov 28, 2014 at 3:41 PM, Lars Hupel wrote: > Let's say the hypothetical feature is selected via the GHC flag > "--topo-sort". It would add a step before regular compilation and > wouldn't affect any other flag: > > ghc -c --topo-sort fileA.hs fileB.hs ... > > This would first read in th

Re: Discovery of source dependencies without --make

2014-11-28 Thread Lars Hupel
> I suppose that if --make found Foo.hi, but no Foo.hs, it could simply > use the Foo.hi. That would do strictly more than now. I don't know > if there would be any disadvantages. > > Augmenting --make's semantics sounds better to me than inventing a > new compilation mode. Sure, that sounds eve

RE: Discovery of source dependencies without --make

2014-11-28 Thread Simon Peyton Jones
kell-users@haskell.org | Subject: Re: Discovery of source dependencies without --make | | > How does that differ from ghc --make? The only difference I can see | is that | > - Modules that --make might find, but not listed on | > the command line, would not be compiled by --topo-

Re: Discovery of source dependencies without --make

2014-11-28 Thread Lars Hupel
> How does that differ from ghc --make? The only difference I can see is that > - Modules that --make might find, but not listed on > the command line, would not be compiled by --topo-sort "--make" always requires a full view on all sources. That is, any imports which cannot be resolved fro

RE: Discovery of source dependencies without --make

2014-11-28 Thread Simon Peyton Jones
| -Original Message- | From: Lars Hupel [mailto:l...@hupel.info] | Sent: 28 November 2014 14:42 | To: Simon Peyton Jones | Cc: glasgow-haskell-users@haskell.org; Andrey Mokhov | Subject: Re: Discovery of source dependencies without --make | | > Rather than explain by deltas from

Re: Discovery of source dependencies without --make

2014-11-28 Thread Lars Hupel
> Rather than explain by deltas from something else, it might be > easier just to write down precisely what you seek. Let's say the hypothetical feature is selected via the GHC flag "--topo-sort". It would add a step before regular compilation and wouldn't affect any other flag: ghc -c --topo-s

Re: Discovery of source dependencies without --make

2014-11-28 Thread Evan Laforge
Here's what I use: http://ofb.net/~elaforge/shake/Shake/HsDeps.hs It's a very dumb but fast parser that figures out dependencies. I use it for my shake build system. Not sure if it's useful, but there it is if it helps. If you have a complicated build setup and you're not using shake, maybe yo

RE: Discovery of source dependencies without --make

2014-11-28 Thread Simon Peyton Jones
l Message- | From: Glasgow-haskell-users [mailto:glasgow-haskell-users- | boun...@haskell.org] On Behalf Of Lars Hupel | Sent: 28 November 2014 08:53 | To: Gershom B | Cc: glasgow-haskell-users@haskell.org | Subject: Re: Discovery of source dependencies without --make | | Hi Gershom, |

Re: Discovery of source dependencies without --make

2014-11-28 Thread Lars Hupel
Hi Gershom, > Is -M perhaps what you’ve been looking for? sadly, no. Firstly, it behaves in the same way as "--make" (i.e. only looks at source files) and secondly, it produces a Makefile as output. (I'd be happy though to use the GHC API if somebody could tell me whether/where this functionalit

Re: Discovery of source dependencies without --make

2014-11-27 Thread Gershom B
Is -M perhaps what you’ve been looking for? https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_guide/separate-compilation.html#makefile-dependencies -g On November 27, 2014 at 5:32:01 AM, Lars Hupel (l...@hupel.info) wrote: > > The only problem I see with that is that error message locati

Re: Discovery of source dependencies without --make

2014-11-27 Thread Lars Hupel
> The only problem I see with that is that error message locations will be > a bit off, since the file being compiled is different from the file > submitted. But since we're in the hacks territory anyway, this could be > fixed up with a simple regex :-) ... or line pragmas :-) I'm currently inves

Re: Discovery of source dependencies without --make

2014-11-27 Thread Roman Cheplyaka
On 25/11/14 12:29, Joachim Breitner wrote: > Dear Lars, > > > Am Dienstag, den 25.11.2014, 10:36 +0100 schrieb Lars Hupel: >> The invocation is similar to this: >> >> ghc -c -outputdir "$OUT" -XTrustworthy Library.hs >> ghc -c -outputdir "$OUT" -i"$OUT" -XSafe "$SUBMISSION" >> ghc -c -ou

Re: Discovery of source dependencies without --make

2014-11-25 Thread Lars Hupel
> the only reason you do these in individual steps is that you need to > pass different flags, or are there other reasons? Not only that – we also want to be able to distinguish compilation errors between "caused by students" and "we broke something". Under the assumption that compilation for libr

Re: Discovery of source dependencies without --make

2014-11-25 Thread Joachim Breitner
Dear Lars, Am Dienstag, den 25.11.2014, 10:36 +0100 schrieb Lars Hupel: > The invocation is similar to this: > > ghc -c -outputdir "$OUT" -XTrustworthy Library.hs > ghc -c -outputdir "$OUT" -i"$OUT" -XSafe "$SUBMISSION" > ghc -c -outputdir "$OUT" -i"$OUT" Test_Suite.hs > ghc-outputd