explicitly fail if the compile failed

Fix and tests by Gareth Tunley
ship 0.23