haskell, hledger
June 4, 2013

Bugfix, planning, autoweb

Yesterday.

Today:

Fixed a build failure from last night’s late session, caught by Peter’s build bot, which is being very helpful. It’s like having R2D2 at my back! I do worry a little about the gratuitous added carbon footprint from a bunch of builds on every github commit.

Loaded up the 0.22 release backlog with a bunch of items on the planning board. (Scroll over to the right).

Did the first backlog item, removing some troublesome friction in hledger-web development. When I’m working on hledger[-web] and need rapid compiler feedback, I use the “auto” rules - make auto, make auto-test, or make autoweb. These watch for file changes and recompile as needed, using searchpath. Searchpath is old, but still works well and can build from multiple packages, unlike cabal-based autobuilders. So it’s very useful when I’m tweaking things in hledger-lib for hledger-web. (I’d use yesod devel if I was just working just in hledger-web, and changing routes, templates, or the cabal file).

The problem: when compiling hledger-web, hledger and hledger-lib together, how to enable the hairy yesodish language extensions only for hledger-web code, and not for hledger-lib and hledger, which don’t compile with them (and seem to get obfuscated if I make them compile).

The solution: wrestle with ghc, sp, cabal; identify required and incompatible language extensions by trial and error; specify the compatible ones in the makefile, and add the rest as source file pragmas. Now my trusty autoweb runs again!

~/src/hledger$ make autoweb
sp --no-exts --no-default-map ghc  -O0  hledger-web/app/main.hs -o bin/hledger-webdev -rtsopts -W -fwarn-tabs -fno-warn-unused-do-bind -fno-warn-name-shadowing  -ihledger-lib -ihledger -ihledger-web -ihledger-web/app -L/usr/lib  -optP-include -optPhledger/dist/build/autogen/cabal_macros.h -DPATCHLEVEL=2 -DDEVELOPMENT -DVERSION='\"0.21.1dev\"'  -XCPP -XMultiParamTypeClasses -XOverloadedStrings -XQuasiQuotes -XRecordWildCards -XTemplateHaskell  --run -B --port 5001 --base-url http://localhost:5001 -f webtest.j
[ 1 of 52] Compiling Hledger.Data.Types ( hledger-lib/Hledger/Data/Types.hs, hledger-lib/Hledger/Data/Types.o )
[ 2 of 52] Compiling Hledger.Data.FormatStrings ( hledger-lib/Hledger/Data/FormatStrings.hs, hledger-lib/Hledger/Data/FormatStrings.o )
...
Loading package yesod-static-1.2.0 ... linking ... done.
[40 of 52] Compiling Foundation       ( hledger-web/Foundation.hs, hledger-web/Foundation.o )

hledger-web/Foundation.hs:106:37: Not in scope: `css_bootstrap_css'

Hmm. That didn’t happen on the other machine. Never mind, something for tomorrow.

Finally, realised I need to do yet another release including this morning’s build fix. This time I waited to see green lights on the buildbot before uploading.