I cloned the latest 6.x-3.x branch and suddenly everything stopped working. Trying to make any make file produced the following error:
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in
/Users/i4veritas/.drush/drush_make/drush_make.drush.inc, line 180
Debug and verbose:
Undefined variable: build_path drush_make.drush.inc:174 [8.45 sec, [notice]
4.01 MB]
Object of class DrushMakeParserObject could not be converted to int [notice]
drush_make.drush.inc:180 [8.45 sec, 4.01 MB]
Drush command terminated abnormally due to an unrecoverable error. [error]
Error: Unsupported operand types in
/Users/i4veritas/.drush/drush_make/drush_make.drush.inc, line 180
[8.55 sec, 4.01 MB]
Since a checkout of this branch was working a few weeks a go I ran a git bisect and identified the offending commit:
4678d7fd6d6a3ef2eeb90e2449e795f49661357a by Dimitri on August 7th
Comments
Comment #1
Anonymous (not verified) commentedThe undefined variable notice is due because the function signature of drush_make_projects() has changed. It no longer takes $build_path, but that variable is used later in the project array.
Comment #2
ao2 commentedI think the problem is not related to the missing
$build_type, this is just a notice:and could be fixed with:
The real problem is that, since commit 4678d7f, each
$projectin$info['projects']is not an array anymore, but an object of typeDrushMakeParserObject(which extendsArrayObject, something different from the basearray()type) and then the union operator ($project += array(...);) is not defined (Unsupported operand types).I tried with something like:
But this is still not enough to make drush make working again...
@dmitrig01, in future please make sure the repository is in a working state before you push (ideally one should try to keep the code functional even after every commit for rebase to be really effective).
Thanks,
Antonio
Comment #3
ao2 commentedThe attached patch should fix the issue, we have also to convert from
DrushMakeParserObjectto an actual array before iterating over the projects.@dmitrig01 if you take it, please use
git-amso I get in the history as the author, thanks.BTW, I have some more patches stacked in my local tree for 6.x-3.x, I'd like to talk about them sometimes.
Regards,
Antonio
Comment #4
jhedstromThis fixes the issue of the fatal error, and seems to work with both Drush 4 and Drush 5.
Comment #5
matason commentedI was experiencing the fatal error, the patch on #4 fixed it, thanks @ao2
Comment #6
tim.plunkettAlways nice to find a working patch when you hit a bug.
Comment #7
mrfelton commentedCan confirm that this resolves the issue.
Comment #8
geek-merlinThis patch made my day! THX!
Comment #9
drzraf commentedpatch from comment #3 fixed it
Comment #10
webchickAlso confirming fix.
Comment #11
helmo commented[ Powered by #1115636: Issue Macros and Templates - Drush Make]
Drush make is being merged into drush core (discussed in issue:#1310130: Put drush make in drush core)
This means that the issue queue is also moving. The Drush project has a component called 'Make' for this purpose.
We would like to take this opportunity to leave behind old/obsolete issues, allowing us to focus on a stable make command in core. E.g. one of the major tasks ahead is making more use of the Drush core code for handling downloads and decompression.
If you feel that this issue is still relevant, feel free to re-open and move it to the Drush queue.
More information will be posted on the drush_make and drush project pages.