Skip to content

Hadrian: Refactor file patterns to prepare for upcoming Shake changes to ?==

Summary

Currently Shake uses the special characters *, **, and // for FilePattern matching with ?==. In the future, support for // will be dropped from Shake as it moves over to a new implementation of ?== from System.FilePattern.

The current patterns need to be refactored and future patterns should use only * and ** for a smooth transition.

For those used to //, the conversion is roughly the following (courtesy of @ndmitchell):

  • //a ==> **/a
  • a// ==> a/**
  • a//b ==> a/**/b

Performance

My hardware has been fairly inconsistent with build times recently so it's hard to get accurate times, but this change should be relatively performance neutral and may provide speedups in the future when the ?== change gets pushed upstream.

Using the following to get clean build times and zero build times:

hadrian/build.stack.sh clean
hadrian/build.stack.sh -c -j --flavour=quickest
hadrian/build.stack.sh -c -j --flavour=quickest
Clean build mean Zero build mean
No change 25m51s 4.8s
New pattern format 25m42s 5.2s

A fairly low number of trials went into producing these numbers, so they shouldn't be taken as anything but an indication that the performance should be roughly the same.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information