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

Neos.Flow: InstallerScripts class for composer is not compatible with composer 2 #2120

Closed
robert-heinig opened this issue Sep 13, 2020 · 2 comments

Comments

@robert-heinig
Copy link

robert-heinig commented Sep 13, 2020

In
https://github.com/neos/flow-development-collection/blob/master/Neos.Flow/composer.json
there is a dependency to "composer/composer": "^1.9" but composer did not complain while upgrading a Neos 5.2 to 5.3 with composer 2 RC1.

In
https://github.com/neos/flow-development-collection/blob/master/Neos.Flow/Classes/Composer/InstallerScripts.php
wihtin the method postPackageUpdateAndInstall() the call $operation->getJobType() is used 4 times.
This method getJobType was renamed to getOperationType within composer 2:
composer/composer@5bdc0fc#diff-fbab13faf7a9485e442e629e12f0f31a

With the composer dependency to ^1.9 not seeming to work properly I'm not sure how to solve this issue correctly.
A check with method_exists() is a possibility, but that seems not to be a nice solution.

Within my Neos project I'm using cweagans/composer-patches and a composer patch file that renames the method.

@albe
Copy link
Member

albe commented Sep 13, 2020

Thanks for bringing this up! Since we're likely to have to support composer 1.x & 2.x for some time and the installer scripts is basically glue code between the infrastructure software and us, something like the method_exists() check is probably okay.

So if anyone is willing to play around, feel free to start a PR!
First thing would be to make the composer require a "^1.9 || ^2.0".

Note: Our composer plugin is already supposed to be composer 2.x compatible as of neos/composer-plugin#13

See composer/composer#8726
https://github.com/composer/composer/blob/master/UPGRADE-2.0.md#for-integrators-and-plugin-authors

@kdambekalns
Copy link
Member

Fixed with latest release(s), see also #2187

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants