wikimedia / composer-merge-plugin

Merge one or more additional composer.json files at Composer runtime
MIT License
923 stars 160 forks source link

Call to undefined method Wikimedia\Composer\Merge\V2\PluginState::shouldMergeReplace() breaking deployments after upgrade to 2.1 #266

Open mlncn opened 1 year ago

mlncn commented 1 year ago

Our local composer update works fine but the composer install in our deployment process is breaking with that shouldMergeReplace() is undefined error.

Upgrading wikimedia/composer-merge-plugin (v2.0.1 => v2.1.0)

is in the list of changes.

Locking it to 2.0.1 fixes the error. Other changes such as upgrading composer/installers from v1.12.0 to v2.2.0 did not help, though i know when dealing with composer meta things (installers, merge plugin, etc) it can take two cycles of composer, which maybe is why our build process doesn't work, but for now reporting the error because seems no one else has, and our workaround of holding it at 2.0.1.

mlncn commented 1 year ago

Stacktrace output from failed pipeline:

Generating optimized autoload files
In ExtraPackage.php line 175:

  [Error]                                                                      
  Call to undefined method Wikimedia\Composer\Merge\V2\PluginState::shouldMer  
  geReplace()                                                                  

Exception trace:
  at /builds/agaric/sites/mass-design/mass/vendor/wikimedia/composer-merge-plugin/src/ExtraPackage.php:175
 Wikimedia\Composer\Merge\V2\ExtraPackage->mergeInto() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code:280
 Wikimedia\Composer\Merge\V2\MergePlugin_composer_tmp1->mergeFile() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code:250
 Wikimedia\Composer\Merge\V2\MergePlugin_composer_tmp1->mergeFiles() at phar:///usr/bin/composer/src/Composer/Plugin/PluginManager.php(274) : eval()'d code:211
 Wikimedia\Composer\Merge\V2\MergePlugin_composer_tmp1->onInstallUpdateOrDump() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:206
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:129
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar:///usr/bin/composer/src/Composer/Autoload/AutoloadGenerator.php:189
 Composer\Autoload\AutoloadGenerator->dump() at phar:///usr/bin/composer/src/Composer/Installer.php:349
 Composer\Installer->run() at phar:///usr/bin/composer/src/Composer/Command/InstallCommand.php:146
 Composer\Command\InstallCommand->execute() at phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php:298
 Symfony\Component\Console\Command\Command->run() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:1040
 Symfony\Component\Console\Application->doRunCommand() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:301
 Symfony\Component\Console\Application->doRun() at phar:///usr/bin/composer/src/Composer/Console/Application.php:377
 Composer\Console\Application->doRun() at phar:///usr/bin/composer/vendor/symfony/console/Application.php:171
 Symfony\Component\Console\Application->run() at phar:///usr/bin/composer/src/Composer/Console/Application.php:141
 Composer\Console\Application->run() at phar:///usr/bin/composer/bin/composer:88
 require() at /usr/bin/composer:29
RishiKulshreshtha commented 1 year ago

Facing the exact same issue, subscribing! +1