Page MenuHomePhabricator

Minor cleanup in Makefiles
Closed, ResolvedPublic

Description

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

awight created this task.Jun 26 2017, 7:22 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 26 2017, 7:22 PM

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

datasets/enwiki.draft_quality.201601.tsv.bz2: \
        sql/draft_quality.variables.sql
    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 https://www.gnu.org/software/make/manual/html_node/Errors.html#Errors

Halfak closed this task as Resolved.Jul 12 2017, 10:48 PM