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

When to expect composer 2.7? #11736

Closed
keulinho opened this issue Nov 29, 2023 · 18 comments
Closed

When to expect composer 2.7? #11736

keulinho opened this issue Nov 29, 2023 · 18 comments
Milestone

Comments

@keulinho
Copy link

Is there already an ETA for 2.7?

Currently 2.6 is not compatible with symfony 7 when you want to excecute composer commands from inside your symfony 7 application.

The issue was already fixed here: c668942
But the change is only to be released with composer 2.7.

As symfony 7 now is also generally available this incompatibility might affect more and more projects.

@matthiaz
Copy link
Contributor

Composer 2.5 does not have the bug, so if you can pin composer to v2.5 (and not 2.6) you should be good to go.
But I agree, 2.7 preferably needs to be rolled out fast.

@keulinho
Copy link
Author

Even though the bug might not be there, composer 2.5 is not marked as compatible with symfony 7 either:

  Problem 1
    - Root composer.json requires composer/composer ~2.5.0 -> satisfiable by composer/composer[2.5.0, ..., 2.5.8].
    - composer/composer[2.5.0, ..., 2.5.8] require symfony/console ^5.4.11 || ^6.0.11 -> found symfony/console[v5.4.11, ..., v5.4.32, v6.0.11, ..., v6.4.0] but it conflicts with your root composer.json require (~7.0.0).

@shawnachieve
Copy link

We're seeing this issue in our CI/CD pipelines which install composer 2.6.x as part of the build process. Installing a clean 2.6 version of composer installs Symfony 7 which breaks all of the composer commands.

Updating our pipeline to install composer 2.5.8 has temporarily resolved the issue.

@arnested
Copy link

arnested commented Dec 1, 2023

There is a fix on the 2.6 branch: 23be508

Would it be possible to tag a new release from the 2.6 branch?

@Seldaek
Copy link
Member

Seldaek commented Dec 8, 2023

See #11741 (comment)

@Seldaek Seldaek closed this as completed Dec 8, 2023
@keulinho
Copy link
Author

Hey @Seldaek thanks for the update and taking care.

Not sure what is still needed for full symfony 7 support, but the decision to only add support in a new minor version is understandable.

However the "fix" to the 2.6 branch does solve only a particular use case, meaning you require symfony and composer at the same time and then get symfony/console v6.x. However another issue still exists that when you require symfony console 7.x explicitly then composer with happily install composer v2.6.5 (the old unfixed version) as that was marked as compatible with symfony console 7.x, leading again to the errors described in #11741.

So in that case limiting the supported symfony console versions to 6.x for composer 2.6.6 only makes things worse IMHO. You can't put the genie back in the bottle.

@Seldaek
Copy link
Member

Seldaek commented Dec 18, 2023

@keulinho for those that need symfony console 7.x there are two options: Require composer/composer ^2.7@dev or stop requiring composer because why are you doing this it's usually the wrong thing to do :D

And the reason I don't want to add it in 2.6 is that to support it we need to add return types which technically is a BC break, I don't think it'll affect anyone but if so I still rather break stuff in a minor than a patch release.

@keulinho
Copy link
Author

As i said that reasoning is understandable.

Our use case is pretty sure uncommen, but i think valid, as we build a framework based on symfony and wanna upgrade to the latest symfony version, therefore we require symfony 7. And as we provide an extension system based on composer we need to require composer in order to run composer commands from inside the application when you install an extension.

Can you give at least a rough ETA for composer 2.7? That would help us to decide if we can continue with the symfony update or if it needs to wait for our next major release.

@Seldaek
Copy link
Member

Seldaek commented Dec 19, 2023

Sorry I have no idea about ETA.. but I guess if this is blocking people I could tag a 2.7 some time in january. We don't have a strict roadmap.

Leaving this open as reminder :)

@Seldaek Seldaek added this to the 2.7 milestone Dec 19, 2023
@Seldaek Seldaek reopened this Dec 19, 2023
@keulinho
Copy link
Author

Thanks for the info, that already helps us a lot!

@Seldaek
Copy link
Member

Seldaek commented Feb 8, 2024

https://github.com/composer/composer/releases/tag/2.7.0 is out

@Seldaek Seldaek closed this as completed Feb 8, 2024
@extasy7610
Copy link

symfony/flex v1.18.7 + composer v2.7.0:
PHP Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /usr/local/var/www/xc-ngrok/next/src/service-tool/vendor/symfony/flex/src/Command/RemoveCommand.php on line 30 Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /usr/local/var/www/xc-ngrok/next/src/service-tool/vendor/symfony/flex/src/Command/RemoveCommand.php on line 30

@xabbuh
Copy link
Contributor

xabbuh commented Feb 9, 2024

@extasy7610 You need to update Symfony Flex (1.18.7 is quite old, the current release is 2.4.4).

@extasy7610
Copy link

@xabbuh, yes, I know. It's already done, thank you. I wrote my comment because there are problems with compatibility with new version of composer

@fredden

This comment was marked as off-topic.

@Seldaek
Copy link
Member

Seldaek commented Feb 9, 2024

This is another issue altogether, it's about the Flex command classes not declaring a return type in this outdated flex version. It has nothing to do with #11839 nor this issue. As @xabbuh wrote you just need to update flex and move on :)

@romainnorberg
Copy link

romainnorberg commented Apr 9, 2024

symfony/flex v1.18.7 + composer v2.7.0: PHP Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /usr/local/var/www/xc-ngrok/next/src/service-tool/vendor/symfony/flex/src/Command/RemoveCommand.php on line 30 Fatal error: Declaration of Symfony\Flex\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Composer\Command\RemoveCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /usr/local/var/www/xc-ngrok/next/src/service-tool/vendor/symfony/flex/src/Command/RemoveCommand.php on line 30

Hi @extasy7610 same as you, I had to rollback composer to an previous version using composer self-update 2.5

Screenshot 2024-04-09 at 15 17 39

@Seldaek
Copy link
Member

Seldaek commented Apr 9, 2024

@romainnorberg you need to update symfony/flex to a more recent version that is compatible with latest Composer & Symfony.

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

9 participants