all packaging systems i've worked with are very strict about failing a build if any step in the build fails. drush_make seems to be almost the polar opposite of that at this point -- it plows on through just about everything to complete it's mission. ;)

for instance, you supply a release that doesn't exist for a package, drush_make just skips over it and continues, w/ no error

i would advise making it abort on any errors by default, and maybe having a --continue-on-errors flag which allows the current behavior if people really want it.

Comments

Title:drush_make should abort and clean up if any build errors occurdrush_make should write build errors to stderr and return a non-zero exit status

I talked to dmitrig01 about this a few weeks ago at BADCamp. I definitely support the general aim of this request, but I'd modify it slightly...

It's okay if drush_make keeps trying so that it finds all the errors in a .make file. It should just a) report those as errors and b) exit with a non-zero exit status so that the caller can immediately tell if there were any errors or not.

So, e.g. with the d.o packaging script, it'd be lame if it only showed/reported the *first* bug in your .make file on the release node -- it should show all of the problems so you can fix them. However, the packaging script should definitely have a clean way to grab all the error strings (e.g. drush_make should write them to stderr) and it should know conclusively if the make worked or not based on the exit code.

Then, the command line arg could be --quiet to suppress the output to stderr. And, it's up to the caller to ignore the exit code or not...

p.s. I don't think it's drush_make's job to "clean up", either. Maybe the caller wants to inspect the partial results. Maybe they want to save them. Maybe they want to remove them. I think this is up to the caller, not drush_make. It's drush_make's job to detect and propagate errors. It's the caller's job to decide what to do about it.

you can use --no-clean or --no-tmp if you don't want that. and you can parse the output of drush_make. We're just using drush_log(foo, 'error'), so it's more of a drush request to make it go to stderr.

parsing output of drush_make == #fail. It needs to know there was an error and return with a non-zero exit code (sort of the UNIX shell equivalent of throwing an exception). ;) If we need a separate issue for drush so that drush_log(foo, 'error') gets written to stderr, that's fine, but that doesn't absolve drush_make of responsibility here...

Ok, works for me. How does one return a non-zero error code? I also think that should be drush's realm (returning a non-zero exit code if there were any errors)

Title:drush_make should write build errors to stderr and return a non-zero exit statusdrush_make should return a non-zero exit status on build errors

Title:drush_make should return a non-zero exit status on build errorsReturn a non-zero exit status on errors
Project:Drush Make» Drush
Version:6.x-2.x-dev» All-Versions-2.1

If any errors are triggered, return a non-zero exist status

fyi, we do return non zero on errors as per #434772: Return codes are opposite of most unix utilities.. i don't see a todo here for drush itself. drush_make will get own issue by hunmonk.

Status:Active» Closed (fixed)