{"action":"created","issue":{"url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/3590","repository_url":"https://api.github.com/repos/Homebrew/homebrew-php","labels_url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/3590/labels{/name}","comments_url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/3590/comments","events_url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/3590/events","html_url":"https://github.com/Homebrew/homebrew-php/issues/3590","id":178012149,"number":3590,"title":"Brew provide broken composer.phar file - it doesn't work with Ansible","user":{"login":"bocharsky-bw","id":3317635,"avatar_url":"https://avatars.githubusercontent.com/u/3317635?v=3","gravatar_id":"","url":"https://api.github.com/users/bocharsky-bw","html_url":"https://github.com/bocharsky-bw","followers_url":"https://api.github.com/users/bocharsky-bw/followers","following_url":"https://api.github.com/users/bocharsky-bw/following{/other_user}","gists_url":"https://api.github.com/users/bocharsky-bw/gists{/gist_id}","starred_url":"https://api.github.com/users/bocharsky-bw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bocharsky-bw/subscriptions","organizations_url":"https://api.github.com/users/bocharsky-bw/orgs","repos_url":"https://api.github.com/users/bocharsky-bw/repos","events_url":"https://api.github.com/users/bocharsky-bw/events{/privacy}","received_events_url":"https://api.github.com/users/bocharsky-bw/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Homebrew/homebrew-php/labels/help%20wanted","name":"help wanted","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-09-20T09:36:29Z","updated_at":"2016-09-25T14:21:36Z","closed_at":null,"body":"## Description\r\n\r\nBrew provides broken `composer.phar` file. It works in regular use, but does not work with Ansible. If I replace `/usr/local/Cellar/composer/1.2.1/libexec/composer` (which provided by Brew) with the original `composer.phar` downloaded with [these instuctions](https://getcomposer.org/download/) - then original Composer works fine with Ansible. So the problem only in `composer.phar` provided by Brew.\r\n\r\n## Steps to reproduce:\r\n\r\n1. `$ brew install ansible`\r\n2. `$ brew install composer`\r\n3. `$ ansible localhost -m composer -a \"working_dir=./path-to-dir-with-valid-composer-json\"` // it doesn't work, see logs below:\r\n\r\n## Context and Logs\r\nOutput of `$ ansible localhost -m composer -a \"working_dir=./path-to-dir-with-valid-composer-json\"`:\r\n```\r\nLoaded callback minimal of type stdout, v2.0\r\n<127.0.0.1> ESTABLISH LOCAL CONNECTION FOR USER: victor\r\n<127.0.0.1> EXEC /bin/sh -c '( umask 77 && mkdir -p \"` echo $HOME/.ansible/tmp/ansible-tmp-1474021242.83-74316657830341 `\" && echo ansible-tmp-1474021242.83-74316657830341=\"` echo $HOME/.ansible/tmp/ansible-tmp-1474021242.83-74316657830341 `\" ) && sleep 0'\r\n<127.0.0.1> PUT /var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/tmpLAYqVM TO /Users/victor/.ansible/tmp/ansible-tmp-1474021242.83-74316657830341/composer\r\n<127.0.0.1> EXEC /bin/sh -c 'LANG=en_US.UTF-8 LC_ALL=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 /usr/bin/python /Users/victor/.ansible/tmp/ansible-tmp-1474021242.83-74316657830341/composer; rm -rf \"/Users/victor/.ansible/tmp/ansible-tmp-1474021242.83-74316657830341/\" > /dev/null 2>&1 && sleep 0'\r\nAn exception occurred during task execution. The full traceback is:\r\nTraceback (most recent call last):\r\n  File \"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\", line 232, in <module>\r\n    main()\r\n  File \"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\", line 183, in main\r\n    available_options = get_available_options(module=module, command=command)\r\n  File \"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\", line 151, in get_available_options\r\n    command_help_json = json.loads(out)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py\", line 338, in loads\r\n    return _default_decoder.decode(s)\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 366, in decode\r\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\r\n  File \"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\", line 384, in raw_decode\r\n    raise ValueError(\"No JSON object could be decoded\")\r\nValueError: No JSON object could be decoded\r\n\r\nlocalhost | FAILED! => {\r\n    \"changed\": false,\r\n    \"failed\": true,\r\n    \"invocation\": {\r\n        \"module_name\": \"composer\"\r\n    },\r\n    \"module_stderr\": \"Traceback (most recent call last):\\n  File \\\"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\\\", line 232, in <module>\\n    main()\\n  File \\\"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\\\", line 183, in main\\n    available_options = get_available_options(module=module, command=command)\\n  File \\\"/var/folders/5t/qb0jlm4x7g90bp__cnr1lybh0000gn/T/ansible_a_ligN/ansible_module_composer.py\\\", line 151, in get_available_options\\n    command_help_json = json.loads(out)\\n  File \\\"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py\\\", line 338, in loads\\n    return _default_decoder.decode(s)\\n  File \\\"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\\\", line 366, in decode\\n    obj, end = self.raw_decode(s, idx=_w(s, 0).end())\\n  File \\\"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py\\\", line 384, in raw_decode\\n    raise ValueError(\\\"No JSON object could be decoded\\\")\\nValueError: No JSON object could be decoded\\n\",\r\n    \"module_stdout\": \"\",\r\n    \"msg\": \"MODULE FAILURE\",\r\n    \"parsed\": false\r\n}\r\n```\r\n\r\nParameter | Value\r\n--------- | ------------------\r\n**OS X Version:**       | OS X El Capitan 10.11.6\r\n**Homebrew Version:**   | Homebrew 0.9.9 (git revision f87e; last commit 2016-09-20) Homebrew/homebrew-core (git revision a530; last commit 2016-09-20)\r\n**PHP Version in use:** | PHP 7.0.11 (cli) (built: Sep 16 2016 23:09:59) ( NTS )\r\n**Xcode Version:**      | Version 8.0 (8A218a)\r\n\r\n**Output of gcc -v:**\r\n```\r\nConfigured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1\r\nApple LLVM version 8.0.0 (clang-800.0.38)\r\nTarget: x86_64-apple-darwin15.6.0\r\nThread model: posix\r\nInstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin\r\n```\r\n\r\n**Output of php -v:**\r\n```\r\nPHP 7.0.11 (cli) (built: Sep 16 2016 23:09:59) ( NTS )\r\nCopyright (c) 1997-2016 The PHP Group\r\nZend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies\r\n    with Zend OPcache v7.0.10, Copyright (c) 1999-2016, by Zend Technologies\r\n    with blackfire v1.12.0, https://blackfire.io, by Blackfireio Inc.\r\n```\r\n\r\n**Build logs:** _Link to public gist created with `brew gist-logs my-formula`_\r\n"},"comment":{"url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/comments/249424401","html_url":"https://github.com/Homebrew/homebrew-php/issues/3590#issuecomment-249424401","issue_url":"https://api.github.com/repos/Homebrew/homebrew-php/issues/3590","id":249424401,"user":{"login":"benjifisher","id":1170799,"avatar_url":"https://avatars.githubusercontent.com/u/1170799?v=3","gravatar_id":"","url":"https://api.github.com/users/benjifisher","html_url":"https://github.com/benjifisher","followers_url":"https://api.github.com/users/benjifisher/followers","following_url":"https://api.github.com/users/benjifisher/following{/other_user}","gists_url":"https://api.github.com/users/benjifisher/gists{/gist_id}","starred_url":"https://api.github.com/users/benjifisher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benjifisher/subscriptions","organizations_url":"https://api.github.com/users/benjifisher/orgs","repos_url":"https://api.github.com/users/benjifisher/repos","events_url":"https://api.github.com/users/benjifisher/events{/privacy}","received_events_url":"https://api.github.com/users/benjifisher/received_events","type":"User","site_admin":false},"created_at":"2016-09-25T14:21:36Z","updated_at":"2016-09-25T14:21:36Z","body":"@josegonzalez:  done.\r\n\r\nI do not know ruby, but it seems that I can override `AbstractPhpPhar::phar_wrapper` in the derived `Composer` class.  In the discussion above, I added `libexec/composer.php` and changed the symlink, but the PR simply replaces `libexec/composer`."}}
{"actor":{"display_login":"benjifisher"}}