Homebrew/homebrew — pull request #30393 by dakcarto (2014-06-23 22:35:16+00:00)
Title: Add env variable to build bottles that were not poured

This adds support for an undocumented env variable named `HOMEBREW_BUILD_MISSING_BOTTLE` (similar to `HOMEBREW_BUILD_BOTTLE`) to do a bottle build for any formula that was not poured, or failed to pour. Unlike when setting `HOMEBREW_BUILD_BOTTLE`, any formula that has an appropriate bottle, and is successfully poured, will be used, everything else is attempted to be built as bottle, instead of _every_ install being compiled.

This advanced-usage variable helps in two types of use cases:

* **Tap Managers** - When managing bottles for a third-party tap, where currently there is no build bot to automate generation of bottles, maintainers can just always leave the variable set. After testing or upgrading a formula change, the maintainer merely needs to issue `brew bottle `, instead of adding the `--build-bottle` option for every compile or reinstall/upgrade.

* **Stack Distributions** - When building a large number of domain specific formula, e.g. geospatial stack, where quite a few formulae might not yet have bottles, it aids a stack packager in plans to archive and roll out the `HOMEBREW_PREFIX` directory to many Macs. This scenario is common in educational, enterprise and governmental distributed stack installs. Also, it is handy for instances where users are offered to download a huge archive to 'try out' a stack or as specific dependencies for building software, unarchiving it to the `HOMEBREW_PREFIX` under which the stack was built.

Ultimately, it is about leveraging existing upstream bottle installs, while automating local bottle builds. Obviously, some optimization is lost, but this is for users strictly concerned about bottle generation.

I am unsure if this is the best approach for integrating such an env variable, or whether there is a better means of generating a log of which formulae where built as bottles (instead of just stdout lines), to further automate bottle archive generation.

Any other suggestions about achieving the same automated building of missing bottles are welcome.