Improve error output when package fails to build.
New error message is: cabal: Failed to build p-1.0 (which is required by exe:e4 from p-1.0, exe:e3 from p-1.0 and others). Fixes #4081. TODO: Use these utility functions in other appropriate places. Signed-off-by: Edward Z. Yang <email@example.com>