Automated background build in Leksah (no more Ctrl+B) ready for some testing

Hamish Mackenzie hamish at
Sun Mar 22 07:13:08 EDT 2009

Duncan pointed out we can pass ghc options using --ghc-options=.  I have
added a "Include linking in background builds" flag.  The following flags
are passed to turn off linking...

I have set up the default preference as "exclude background linking" on
Windows.  I think this should solve most of the performance problems on
windows.  /usr/bin/true may result in some odd file not found errors though.

I have also fixed a bug in the way I was detecting running builds on Linux
and OSX that prevented Ctrl+B from working in some cases.

2009/3/21 Hamish Mackenzie <hamish at>

> I have pushed a patch to add background build to leksah-head.  Basically
> this works with a timer that runs every 100ms.  If there are changes made to
> any open file it....
>    - interrupts any running build by sending SIGINT (sadly OSX and Linux
>    only at this point)
>    - waits for the old build processes to finish
>    - saves all the modified files
>    - starts a new build
> This patch also changes the way errors are highlighted in the source code
>    - All errors are underlined at once (not just one at time)
>    - The current list of errors is not cleared until the new list is ready
>    - New error list is made available once linking starts (so you don't
>    have to wait for linking to finish jumping to warnings)
> *OSX (tested) and Linux (not tested)*
> As you type it sends a SIGINT to terminate the current build before waiting
> for all child processes to terminate.  Currently it does this as soon as a
> file is modified (well it checks on a 100ms timer).  This means you can hold
> up the build by typing really fast (depending on the speed of your
> computer).  If this is problematic for anyone let me know and I will add an
> option to delay the interruption until at least one compilation has
> completed (by waiting for the second line stating with '[' or 'Linking').
> *
> Windows (tested, but slow)*
> Unfortunately it does not work quite so well on Windows, mainly because the
> equivalent of SIGINT (generateConsoleCtrlEvent) does not seem to be well
> supported by the haskell tools.  In particular if you try running '*runhaskell
> Setup.lhs build*' in a console window and pressing Ctrl+C or Ctrl+Break
> you will see that 9 times out of 10 nothing happens (I mean nothing it does
> not continue building, but it does not terminate either, at least that is
> what I found).  I have a feeling fixing this is not going to be easy
> (hopefully there is a suitable haskell/windows guru who can).
> An alternative to using generateConsoleCtrlEvent would be to pass
> --build-to=Compile to cabal to tell it to skip the linking stage.  Duncan,
> if you get a chance can you take a look the email and updated cabal patch I
> sent on the 21st of Feb.
> Hamish
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the Leksah mailing list