Our CI installs composer packages with dev deps, prepares blobs for release and then removes dev packages to produce release image without them.
Unfortunately, production-dependencies-guard plugin tries to run itself after it's been removed.
$ composer install
# do some work using dev packages………………………………… and then remove them
$ composer install --prefer-dist --no-dev --optimize-autoloader --no-suggest --apcu-autoloader
Loading composer repositories with package information
Installing dependencies from lock file
Package operations: 0 installs, 0 updates, 84 removals
……………………………… lots of packages removed
- Removing localheinz/composer-normalize (0.9.0)
- Removing kalessil/production-dependencies-guard (dev-master)
……………………………… lots of packages removed
Generating optimized autoload files
Fatal error: Uncaught Error: Class 'Kalessil\Composer\Plugins\ProductionDependenciesGuard\Suppliers\FromComposerManifestSupplier' not found in /tmp/build/vendor/kalessil/production-dependencies-guard/src/Guard.php:105
Stack trace:
#0 [internal function]: Kalessil\Composer\Plugins\ProductionDependenciesGuard\Guard->checkGeneric(Object(Composer\Script\Event))
#1 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(176): call_user_func(Array, Object(Composer\Script\Event))
#2 phar:///usr/bin/composer/src/Composer/EventDispatcher/EventDispatcher.php(96): Composer\EventDispatcher\EventDispatcher->doDispatch(Object(Composer\Script\Event))
#3 phar:///usr/bin/composer/src/Composer/Installer.php(324): Composer\EventDispatcher\EventDispatcher->dispatchScript('post-install-cm...', false)
#4 phar:///usr/bin/composer/src/Composer/Command/InstallCommand.php(122): Composer\Installer->run()
#5 phar:///usr/bin/composer/vendor/symfony/console/Command/Command.php(245): Composer\Command\InstallCommand->execute(Object(Sym in /tmp/build/vendor/kalessil/production-dependencies-guard/src/Guard.php on line 105
Our CI installs composer packages with dev deps, prepares blobs for release and then removes dev packages to produce release image without them. Unfortunately,
production-dependencies-guard
plugin tries to run itself after it's been removed.