Closed tobiasbaehr closed 4 years ago
@tobiasbaehr Thanks for the detailed report. I'm at a conference right now, but either @Potherca or me will look at this soon.
The main thing which surprises me is that Composer would try to run a plugin which it has just uninstalled. In that respect, I wonder if this is not a Composer bug instead of a bug in the plugin.
The other thing which surprised me when you originally reported it, is that PHPCS would be reported as unavailable as it is a require
-ment of this plugin, so if the plugin is installed, PHPCS should always be available.
Anyway, need to get back to the conference now. I will try to have a look at this later tonight or at some point tomorrow.
I've created automated reproduction scenarios for this bug (in BASH).
Tomorrow I'll work on a fix.
I've implemented a fix in MR #104. As soon as it has been reviewed and approved I can deploy a new release to get this fix out the door so @tobiasbaehr can verify it resolves things on his end.
I can confirm that #104 works for me.
composer install --no-interaction --optimize-autoloader --ansi --no-progress --no-dev -vv;echo $?
Required tags were not explicitly set so the zaporylie/composer-drupal-optimizations set default based on project's composer.json content.
extra.commerce-drupal-optimizations.require.symfony/symfony: '>3.4'
No patches supplied.
Loading composer repositories with package information
Installing dependencies from lock file
Dependency resolution completed in 0.003 seconds
Analyzed 362 packages to resolve dependencies
Analyzed 1174 rules to resolve dependencies
Package operations: 0 installs, 0 updates, 5 removals
Removals: squizlabs/php_codesniffer, drupal/stage_file_proxy, drupal/devel, drupal/coder, dealerdirect/phpcodesniffer-composer-installer
- Removing squizlabs/php_codesniffer (3.5.3)
Deleting /.../vendor/squizlabs/php_codesniffer - deleted
- Removing drupal/stage_file_proxy (1.0.0-rc2)
Deleting web/modules/contrib/stage_file_proxy - deleted
- Removing drupal/devel (2.1.0)
Deleting web/modules/contrib/devel - deleted
- Removing drupal/coder (8.3.7)
- Removing dealerdirect/phpcodesniffer-composer-installer (dev-master 2a57571)
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Generating optimized autoload files
Running PHPCodeSniffer Composer Installer
PHPCodeSniffer Composer Installer is uninstalled
0
Thanks for testing @tobiasbaehr !
Problem/Motivation
When dealerdirect/phpcodesniffer-composer-installer + package which has phpcs rules are uninstalled while
composer install --no-dev
the dealerdirect/phpcodesniffer-composer-installer exit with the exitcode 1, which breaks a CI.Expected behaviour
Do nothing in this case.
Actual behaviour
Steps to reproduce
Run
composer install --no-interaction --optimize-autoloader --ansi --no-progress --no-dev -vv;echo $?
to remove the dev-deps and the see the exit code.Proposed changes
Environment
Output of
vendor/bin/phpcs --config-show
:Tested against
master
branch?master
branch.