-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
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
run-script uses libraries bundled in composer.phar instead of versions specified by project #8907
Comments
If running
|
This is a known issue and one of the reasons we try to keep our dependency count very low.. It is also a reason that Composer scripts should keep their dependencies low. IMO it is not fixable. Fixing it would require that we take composer requirements into account when installing the project dependencies, as otherwise we could not with certainty run with the project autoloader. And that would just be crazy as for most projects this conflict is not a problem at all. It should be mitigated to some extent post-2.0 once we can bump our php requirement and thus also bump our bundled dependencies to latest versions. Right now we bundle symfony 2.8 packages as that is the only way to support php 5.3 in the phar. That's unfortunately very much outdated. |
Is there a way to have scripts opt to run in a separate process and load the local project's autoloader? |
No there isn't a way to do that sorry. |
So, no solution so far so this issue and that's it? |
I've discovered, if developing any Composer scripts, when running
composer run-script [script-name]
, those scripts will use libraries bundled incomposer.phar
instead of the vendor directory. This means you might get out-of-date libraries and unexpected errors.I have a full, working example available at https://github.com/ramsey/composer-scripts-issue.
I have also posted my scripts below, using your template.
My
composer.json
:Output of
composer diagnose
:When I run this command:
I get the following output:
And I expected this to happen:
Foo.php
contains:I have a
.gitignore
in the same directory that contains:The text was updated successfully, but these errors were encountered: