Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Jan 6, 2020. It is now read-only.

Fix composer update via HHVM#150

Closed
JJK801 wants to merge 9 commits into
sensiolabs:masterfrom
JJK801:patch-1
Closed

Fix composer update via HHVM#150
JJK801 wants to merge 9 commits into
sensiolabs:masterfrom
JJK801:patch-1

Conversation

@JJK801
Copy link
Copy Markdown
Contributor

@JJK801 JJK801 commented Jul 22, 2014

Hi,

When i try to update my dependencies using hhvm (hhvm /usr/local/bin/composer update), i get an error from your script:

sh: 1: /usr/bin/hhvm --php: not found

This is because the --php argument is escaped with the command, this PR fix it (maybe a better way, but i got no time to pend on it)

Thx

@apfelbox
Copy link
Copy Markdown

Shouldn't $self::getPhp() be self::getPhp()?

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oups, i'm gonna fix it :)

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Jul 22, 2014

@apfelbox fixed, thanks :)

@acoquoin
Copy link
Copy Markdown

👍 It's a nice fix, i need it !

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that you might still need to escape the PHP path. That's a tricky issue as you cannot make a difference between what should be esacped and what should not.

I think the problem is more in PhpExecutableFinder where we can return some options like --php.

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Jul 28, 2014

@fabpot my last commit will fix the problem once symfony/symfony#11497 merged

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo here. Your $ key is too sensitive :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be $phpFinder = new PhpExecutableFinder();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not mandatory and not used in the coding style of the file (c.f getPhp function)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh is right. We are using () everywhere... well except here apprentely ;)

@DZunke
Copy link
Copy Markdown

DZunke commented Jul 30, 2014

Thanks @JJK801 !

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you get more than one argument, it won't work. So, this method should return an array instead (see my comment on the PR on symfony/symfony).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@lsmith77
Copy link
Copy Markdown
Contributor

any word when this will be merged and tagged? its preventing us from testing against HHVM with the CMF

@fabpot
Copy link
Copy Markdown
Member

fabpot commented Sep 11, 2014

symfony/symfony#11497 should be merged first, but we are almost there.

Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be guarded with a method_exists check to avoid fatal errors if an older version of Symfony is used (returning an empty array when the method does not eixsts)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Jérémy JOURDIN added 6 commits September 11, 2014 11:25
Hi,

When i try to update my dependencies using hhvm (hhvm /usr/local/bin/composer update), i get an error from your script:

sh: 1: /usr/bin/hhvm --php: not found

This is because the --php argument is escaped with the command, this PR fix it (maybe a better way, but i got no time to pend on it)

Thx
Comment thread Composer/ScriptHandler.php Outdated
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

symfony uses single quotes

fabpot added a commit to symfony/symfony that referenced this pull request Sep 11, 2014
…ments (JJK801)

This PR was submitted for the master branch but it was merged into the 2.3 branch instead (closes #11497).

Discussion
----------

Use separated function to resolve command and related arguments

Hi,

This PR split command and related arguments resolution into two distinct functions.

It will help to solve the HHVM issue sensiolabs/SensioDistributionBundle#150 .

Thanks,

Jérémy

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | yes
| BC breaks?    | yes
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | ~
| License       | MIT
| Doc PR        | ~

Commits
-------

ee75af0 Use separated function to resolve command and related arguments
@FlorianKoerner
Copy link
Copy Markdown

👍

@fabpot
Copy link
Copy Markdown
Member

fabpot commented Sep 24, 2014

Thank you @JJK801.

@fabpot fabpot closed this in 10b53fe Sep 24, 2014
fabpot added a commit that referenced this pull request Sep 24, 2014
This PR was squashed before being merged into the 3.0.x-dev branch (closes #150).

Discussion
----------

Fix composer update via HHVM

Hi,

When i try to update my dependencies using hhvm (hhvm /usr/local/bin/composer update), i get an error from your script:

sh: 1: /usr/bin/hhvm --php: not found

This is because the --php argument is escaped with the command, this PR fix it (maybe a better way, but i got no time to pend on it)

Thx

Commits
-------

b901596 Fix composer update via HHVM
@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Sep 24, 2014

@fabpot my pleasure

@FlorianKoerner
Copy link
Copy Markdown

Will it be fixed for 2.3.x too?

@sroze
Copy link
Copy Markdown

sroze commented Sep 25, 2014

I'm still having the issue with hhvm /usr/local/bin/composer install because Composer is loading first its packaged version of Process component from its PHAR.
@JJK801 Did you experiment that issue ? And so, do you have any idea how to solve it ?

@chasen
Copy link
Copy Markdown

chasen commented Sep 29, 2014

I have updated my composer json to use the dev-master build of the SensioDistributionBundle. My composer.lock confirms I am using the latest commit:

"name": "sensio/distribution-bundle",
    "version": "dev-master",
    "target-dir": "Sensio/Bundle/DistributionBundle",
     "source": {
         "type": "git",
        "url": "https://github.com/sensiolabs/SensioDistributionBundle.git",
        "reference": "e20461e4f8e1afd68f36cf90bdccc06f7aa6a6c2"
php -v
HipHop VM 3.3.0 (rel)
Compiler: tags/HHVM-3.3.0-0-g0a3cfb87b8a353fc7e1d15374f4adc413e37aba9
Repo schema: 9a391d9a03e15fccba1cde6d35c05b7cdd380238
Extension API: 20140829
composer version: 31eadc6920cd1866bc061fb0087798c37e2b7d14

running: composer update
results in:

sh: 1: /usr/bin/hhvm --php: not found
Script Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception

  [RuntimeException]
  An error occurred when generating the bootstrap file.

Am i missing something or did this PR not fix the issue?

@sroze
Copy link
Copy Markdown

sroze commented Sep 29, 2014

@chasen I'm having the same issue, have a look on my previous comment. As workaround I'm using composer with --no-scripts argument and then clear cache by hand with hhvm.

@FlorianKoerner
Copy link
Copy Markdown

My Solution:

Replace all

"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap"

with

"php vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php"

in your composer.json

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Sep 30, 2014

@sroze @chasen @FlorianKoerner Which version of SensioDistributionBundle are you using ? this PR is only merged for 3.0.6 tag for now

@FlorianKoerner
Copy link
Copy Markdown

Will it be fixed for 2.3.x too?

3.0.6 is incompatible with Symfony 2.3.x - so I can not use your solution.

@chasen
Copy link
Copy Markdown

chasen commented Sep 30, 2014

@JJK801 I have tried it with 3.0.6 and with commit ID e20461e and neither worked.

@sroze
Copy link
Copy Markdown

sroze commented Sep 30, 2014

@JJK801 Sure to have dev-master of SensioDistributionBundle as well as dev-master of Symfony but still not working because of this:

Composer is loading first its packaged version of Process component from its PHAR.

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Sep 30, 2014

@sroze @FlorianKoerner @chasen as @sroze said, it seems to be a composer issue (pointing to symfony/process 2.5.4 but PR was tagged in 2.5.5), i'm gonna make a PR to fix it.

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Sep 30, 2014

@sroze @chasen the composer PR composer/composer#3318 fix the problem.

@FlorianKoerner about the 2.3.x merge, i'm not maintainer of this projet, ask @fabpot about it or just update your symfony.

@stof
Copy link
Copy Markdown
Contributor

stof commented Sep 30, 2014

see #168 for the Symfony 2.3 support

@joshuataylor
Copy link
Copy Markdown

Confirming that the composer self-update fixed this issue with the above changes, awesome thanks.

@JJK801
Copy link
Copy Markdown
Contributor Author

JJK801 commented Oct 1, 2014

thanks for the feedback @joshuataylor

lsmith77 added a commit to symfony-cmf/Testing that referenced this pull request Oct 3, 2014
@estani
Copy link
Copy Markdown

estani commented Oct 8, 2014

A workaround in case updating is not an option: composer/composer#3172

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.