whenjobs [previous posting] was an attempt to implement workflow management for libguestfs builds initially, then for other stuff. It’s not worked out too well, so time to start thinking about what to replace it with.
If you concentrate on the narrow task of how to build, test and deploy libguestfs, then it could be broken down into goals (here written in pseudocode):
goal (the tarball is available on the website) goal (the website has been updated)
and rules for how to fulfil those goals:
rule (the tarball is available on the website) := requires (the tarball has been tested); rsync tarball ssh://website.example.com/ rule (the tarball has been tested) := rule (the tarball has been built); tar zxf tarball; cd libguestfs-*; ./configure; make; make check; set_flag (the tarball has been tested)
So far so similar to make. But I tried to encode something like this into (GNU) make and didn’t get too far.
One problem is that make can only test the existence of local files. It can’t test any condition more complex than “local file exists” or “local file is newer than other local file”. Which is why people use “stamp” files frequently, although even those have limits.
Another problem is that make patterns are limited to basically file extensions. ie. You can write:
but not a lot else. I also tried Peter Miller’s cook and although it’s certainly cleaner than make, it too is really about doing local software builds.
What it’d be nice to write is something like this:
let guestfs_version = ` git describe --abbrev=0 --tags --match '1.*' ` let make_url v = sprintf "http://libguestfs.org/download/1.23-development/%s.tar.gz" v let http_exists url = // some function that checks URL exists goal (http_exists (make_url guestfs_version)) rule (http_exists url when prefixed url "http://libguestfs.org/download/") ( let v = get_version_from_url url in require (tested v); rsync tarball ssh://website.example.com/ )