[xbuild] Log build errors and raise events even if a build fails.