Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composer install fails on hhvm #1610

Closed
malisetti opened this issue Jun 26, 2015 · 10 comments
Closed

composer install fails on hhvm #1610

malisetti opened this issue Jun 26, 2015 · 10 comments

Comments

@malisetti
Copy link

composer self-update
Updating to version 943107cfe717a74aa791f57b87fa514c88582b0d.
Downloading: connection...������������������������������ Downloading: 100% ���������
Use composer self-update --rollback to return to version ffffab37a294f3383c812d0329623f0a4ba45387

composer install --prefer-dist --no-interaction
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/usr/local/bin/composer self-update" to get the latest version.
[UnexpectedValueException]
Could not parse version constraint ^1.0.0: Invalid version string "^1.0.0"
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

@malisetti
Copy link
Author

I am updating the composer. The before step to install is composer self-update

@manishas
Copy link
Contributor

can you try sudo composer self-update in the before_install section?

@malisetti
Copy link
Author

Still fails with sudo composer self-update in before_install

before_install
sudo composer self-update
Updating to version 943107cfe717a74aa791f57b87fa514c88582b0d.
Downloading: connection...������������������������������ Downloading: 100% ���������
Use composer self-update --rollback to return to version ffffab37a294f3383c812d0329623f0a4ba45387
install
cp app/config/parameters.yml.dist app/config/parameters.yml
composer config -g github-oauth.github.com 64d401d46e5498674e2014b7b8c92ed252eb75b9 -vvv
composer install --prefer-dist --no-interaction
[UnexpectedValueException]
Warning: This development build of composer is over 30 days old. It is recommended to update it by running "/home/shippable/.phpenv/versions/5.4/composer/composer.phar self-update" to get the latest version.
Could not parse version constraint ^1.0.0: Invalid version string "^1.0.0"
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [packages1] ... [packagesN]

@rageshkrishna
Copy link
Contributor

@mseshachalam I took a deeper look at this and found a bug in how we're initializing our hhvm environment. The problem is that all PHP builds are run using phpenv to switch versions, but hhvm doesn't initialize phpenv. As a result, on hhvm builds composer is installed as a system package and needs to be updated with sudo, but on all other PHP versions, you need to avoid using sudo.

We will address this initialization bug very soon.

In the mean time, you should be able to use this workaround to get all your builds running on Shippable:

before_install:
 - if [ "$SHIPPABLE_PHP_RUNTIME" === "hhvm" ]; then sudo composer self-update; else composer self-update; fi;

You can remove all your other composer self-update lines from the YML. Please give this a shot and let me know if it helps you workaround the issue. Thanks!

@malisetti
Copy link
Author

@rageshkrishna i removed all other composer self-update lines from yml and used the given in before_install. It fails in hhvm.

@rageshkrishna
Copy link
Contributor

@mseshachalam I'm very sorry. The command I specified above has a syntax error and wasn't upgrading composer correctly. Because of the error, the command was running without sudo. Your build output has the following syntax error from bash:

/home/shippable/3f57f445-3db2-4bf4-927e-5d37a905355f.sh: line 84: [: ===: binary operator expected 

Please use the following instead:

before_install:
 - if [ "$SHIPPABLE_PHP_RUNTIME" == "hhvm" ]; then sudo composer self-update; else composer self-update; fi;

The only difference is that I fixed the equality check from === to ==. Working in javascript has trained my fingers to automatically spit out === all the time! Sorry about the confusion.

@malisetti
Copy link
Author

Thank you @rageshkrishna It works now.

@malisetti malisetti reopened this Jun 27, 2015
@malisetti
Copy link
Author

@rageshkrishna
Copy link
Contributor

@mseshachalam I'm not a PHP expert so I'm not sure how to repro that error, but we do have a default ini file at /etc/hhvm/php.ini. You can add the line you need with the following command in your YML file:

echo -e "\nhhvm.libxml.ext_entity_whitelist = file,http,https" >> /etc/hhvm/php.ini

@malisetti
Copy link
Author

Thank you @rageshkrishna, Anyway I don't need hhvm. Thank you for the care.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants