-
-
Notifications
You must be signed in to change notification settings - Fork 179
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
Add support for composer 2 #617
Conversation
79d8cca
to
87a1084
Compare
@jderusse for the command instances, I think we can declare the flex class itself as the command provider. This would allow us to keep the injection of the configuration and flex |
That's a good idea @maxhelias , I totally missed that feature I implemented ^^ Unfortunaly, it does not works for some command (require, install, update). Composer prevent overriding internal methods (https://github.com/composer/composer/blob/master/src/Composer/Console/Application.php#L180) One solution could be to declare the command with name "symfony:require" and alias "require" (aliases are not (yet) checked, and will override the composer's command) side note: Composer improved a lots dependencies resolution. TruncatedPackage is maybe not needed anymore? Do you have good project to benchmark? |
yep, that's why we used this technic. Then, better have the same strategy for all commands.
it's not only for performance, but to enforce the version of nested dependencies. So yes, it's needed. |
hey, what's happening with this one? any eta? |
Well, as I discussed in the issue, enforcing constraints should be doable with a listener on the pool building in Composer 2. This would remove the need for TruncatedPackageRepository. And for commands, adding support for aliases in |
The
Hmm composer does not inject the EventDispatcher in PR rebased |
This is needed for PHP 8 on Symfony Flex (and so in all other versions of Symfony). #624 |
@jderusse could you please rebase ? |
6d1e73c
to
f90d97a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is now compatible with composer 1 and 2.
I think it's ready to merge: the code for composer 1 didn't change, and the one for composer 2 is experimental anyway as long as composer 2 also is.
f90d97a
to
5632886
Compare
5632886
to
d790a5c
Compare
Thank you @jderusse. |
This PR add compatibility with
composer-plugin-api: ^2.0
and fixes #661Maintaining compatibility with both 1.x and 2.0 was too complex.
I think we need to release a version 2.0 of flex compatible with composer 2.
ParallelDownloader
(no more needed with composer 2)TruncateRepository
by eventListener onPluginEvents::PRE_POOL_CREATE
note: I didn't change the way commands are added to the application, current plugin's contract expect a class name, while we currently inject command instances (with config and flex itself injected inside) in the application.