[plt-scheme] ANN: Sake, a build tool

From: Neil Van Dyke (neil at neilvandyke.org)
Date: Wed Sep 3 07:10:46 EDT 2008

Noel Welsh wrote at 09/02/2008 10:15 PM:
> I've just released a Make-like build tool called Sake to Planet.  I'

The ability to write Make actions in Scheme code is a win.  Make-like 
tools fill some gaps that the "setup-plt", "planet", and DrScheme tools 
can't fully cover.  I'm going to make (ha) an advertorial sales pitch 
here, for anyone unfamiliar with Make...

A client of mine recently moved to GNU Make for development of a large 
system that's implemented predominantly in PLT Scheme.  The Make setup 
has been a big win over the previous setup of poorly-documented, 
effort-intensive, error-prone process and collection of shell scripts 
that had redundant information and weren't always in sync.

Make rules now automate everything from initializing a development 
database, to incrementally compiling the system (using "setup-plt" as 
much as possible), to generating config files and the template home 
page, to (re)configuring and (re)starting an Apache server specifically 
for that particular source code workspace on TCP ports private to it 
(generating SSL certificate as necessary), to starting the right 
DrScheme version with the right environment variables, to sending 
Firefox to the appropriate URL for this server.  Options specific to a 
source code workspace -- to override the defaults specifying feature 
sets, network, and database -- are controlled via a "Makefile-options" 
file in which Make variables are set, and those settings in one place 
percolate throughout the system.  "Makefile-options" settings also 
permit a production server to be run from a source code workspace if 
necessary, which has been handy for demos.  We capture additional 
conveniences in the Makefile as needed, like a target to report which 
PLaneT versions we're using, and for the simplest case of checking out a 
new source workspace from branches in several SCM repositories.

We invoke Make from both Emacs and from Bash.  Bash does command-line 
argument completion for Make targets, which is especially nice for 
descriptive targets like "create-foo-demo-database".

All this is a yawn to some C programmers.  "Make: It's Not Just For C 
Programmers Anymore."

The only shortcoming I've noticed with this use of GNU Make is that we 
can't easily embed Scheme code to implement actions.  The Scheme code is 
in external files, and we have to pass various information from Make to 
the Scheme process, which can be a hassle.  Therefore, the Makefile uses 
embedded Bourne shell tricks, "sed", and "grep" when sometimes embedded 
Scheme would be better.  This seems like one good contribution for Sake 
to make to Make.

-- 
http://www.neilvandyke.org/



Posted on the users mailing list.