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

Composer 2.6.5 failing to install due to symfony7 release #11741

Closed
matthiaz opened this issue Dec 1, 2023 · 3 comments
Closed

Composer 2.6.5 failing to install due to symfony7 release #11741

matthiaz opened this issue Dec 1, 2023 · 3 comments

Comments

@matthiaz
Copy link
Contributor

matthiaz commented Dec 1, 2023

When you try to install composer it will fail with the following error:

Fatal error: Declaration of Composer\Command\InitCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /app/.global/composer/composer/vendor/composer/composer/src/Composer/Command/InitCommand.php on line 85
          W: PHP Fatal error:  Declaration of Composer\Command\InitCommand::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output) must be compatible with Symfony\Component\Console\Command\Command::execute(Symfony\Component\Console\Input\InputInterface $input, Symfony\Component\Console\Output\OutputInterface $output): int in /app/.global/composer/composer/vendor/composer/composer/src/Composer/Command/InitCommand.php on line 85
        
        E: Error building project: `composer` could not be run.

There is a bug fix in composer 2.7 and even in 2.6 but neither has been released:
Please release the bug fix: 23be508

The only work around is to pin composer to 2.5, which is far from ideal because it's a step back and potentially breaks other things.

Also mentioned in #11736

@Seldaek
Copy link
Member

Seldaek commented Dec 8, 2023

I tagged 2.6.6 which fixes this by removing the symfony/console requirement. It will not allow using symfony 7 though as it locks you to symfony/console 5.4 or 6.x.

I'm not sure what your environment is but I assume you are running Composer within a project that has Symfony 7 installed, so I don't know if this will help..

Proper symfony 7 support will have to wait for Composer 2.7.

@apfelbox
Copy link

apfelbox commented Dec 9, 2023

I had the same error on deploying to Platform.sh: when building, they recommend installing the most recent composer via their outdated preinstalled composer and there I ran into this issue.

Composer 2.6.5 allowed to install Symfony 7 components but failed instantly, as it isn't yet compatible with it yet.

@matthiaz
Copy link
Contributor Author

This has been resolved in 2.6.6 👍

Kanti added a commit to pluswerk/grumphp-config that referenced this issue Feb 2, 2024
Kanti added a commit to pluswerk/grumphp-config that referenced this issue Feb 2, 2024
)

* 🐛 fix symfony version incompatibility with securitychecker_enlightn

* Update composer.json

fix composer/composer#11741
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

3 participants