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
Shipping unprefixed dependencies causes conflicts. #5916
Comments
This is something we have been discussing internally. There are still some details to figure out. I'll write up an issue with the current status and link it here. Related: wp-cli/wp-cli-bundle#134 |
That's good to hear.
Note that while the proposed solution in this issue (shipping the phar in a composer package) would fix dependency conflicts during installation, it would not fix the conflicts during runtime. In order to be able to install wp-cli either as a phar or a composer package without any conflicts, you would need a build step similar to that of the easy-coding-standard package: this github action pre-processes and builds the code, then push a tag containing only the built artifacts (see for example their 12.1.14 release). The resulting composer package has zero dependency, everything is bundled and prefixed in its own vendor directory. |
Yes, indeed, and that's where the discussions are currently stuck, and why I want to create a detailed issue describing the current state to get feedback from contributors like you. Let me find time to write up a detailed issue and then I'll ping you here to continue the discussion. |
Bug Report
The wp-cli phar release currently ships with unprefixed composer dependencies.
Since most wp-cli commands need to load the wordpress application, this can cause conflicts in case a plugin or the application/website itself require the same dependency with different version constraints.
For example:
psr/log:^3.0
, but wp-cli ships withpsr/log:^2.0
symfony/console:^7.0
, but wp-cli ships withsymfony/console:^3.4
An external tool should not impose a specific version of a dependency on the application developper.
In order to get rid of these issues,
wp-cli
should do whatphpunit
does in its phar release: ship all dependencies under a common vendor prefix (using i.e. humbug/php-scoper).The text was updated successfully, but these errors were encountered: