Page MenuHomePhabricator

Minor cleanup in Makefiles
Closed, ResolvedPublic


There are some shortcuts we can take in the big number-crunching makefiles. One obvious win is to use GNU make's automatic variables, to avoid repeating filenames and possibly introducing typos.

In the bigger picture, we should think about improvements like code-generating the Makefiles from more concise configuration. This would let us apply new best practices to all wiki models, as they evolve.

Event Timeline

Some nastiness I just discovered: many commands will overwrite their output on failure. E.g.,

datasets/enwiki.draft_quality.201601.tsv.bz2: \
    echo 'SET @start="201601", @end="201602";' | \
    cat - $< | \
    $(mysqlc) enwiki | bzip2 -c > $@

We can configure makefiles to delete the target on error by using the pseudo-target .DELETE_ON_ERROR:, see