Edit: Here's the link to the original Composer issue report: https://github.com/composer/composer/issues/7203
Running composer update --dry-run
is a very helpful tool for seeing how dependencies will resolve before actually running the update. But it doesn't work properly for project drupal/drupal. Its output doesn't match composer update
, rendering it ineffective.
To reproduce the problem: Extract drupal-8.5.0.tar.gz, then run composer install
and additional packages will be installed, ones listed under require-dev that weren't included in the tarball. Next, run composer update
and all packages (including dev) will be up to date. Here's where it gets weird. Run composer update --dry-run
and you get this:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 34 removals
- Uninstalling symfony/phpunit-bridge (v3.4.6)
- Uninstalling symfony/dom-crawler (v3.4.6)
- Uninstalling symfony/css-selector (v3.4.6)
- Uninstalling symfony/browser-kit (v3.4.6)
- Uninstalling squizlabs/php_codesniffer (2.9.1)
- Uninstalling sebastian/version (1.0.6)
- Uninstalling sebastian/recursion-context (1.0.5)
- Uninstalling sebastian/global-state (1.1.1)
- Uninstalling sebastian/exporter (1.2.2)
- Uninstalling sebastian/environment (1.3.8)
- Uninstalling sebastian/diff (1.4.3)
- Uninstalling sebastian/comparator (1.2.4)
- Uninstalling phpunit/phpunit-mock-objects (2.3.8)
- Uninstalling phpunit/phpunit (4.8.36)
- Uninstalling phpunit/php-token-stream (1.4.12)
- Uninstalling phpunit/php-timer (1.0.9)
- Uninstalling phpunit/php-text-template (1.2.1)
- Uninstalling phpunit/php-file-iterator (1.4.5)
- Uninstalling phpunit/php-code-coverage (2.2.4)
- Uninstalling phpspec/prophecy (1.7.5)
- Uninstalling phpdocumentor/type-resolver (0.3.0)
- Uninstalling phpdocumentor/reflection-docblock (3.2.2)
- Uninstalling phpdocumentor/reflection-common (1.0.1)
- Uninstalling mikey179/vfsStream (v1.6.5)
- Uninstalling jcalderonzumba/mink-phantomjs-driver (v0.3.3)
- Uninstalling jcalderonzumba/gastonjs (v1.2.0)
- Uninstalling instaclick/php-webdriver (1.4.5)
- Uninstalling fabpot/goutte (v3.2.2)
- Uninstalling drupal/coder (8.2.12)
- Uninstalling doctrine/instantiator (1.0.5)
- Uninstalling behat/mink-selenium2-driver (dev-master 93474c6)
- Uninstalling behat/mink-goutte-driver (v1.2.1)
- Uninstalling behat/mink-browserkit-driver (v1.3.2)
- Uninstalling behat/mink (dev-master 04ab7af)
It seems to want to uninstall a bunch of dev packages, many of which it just installed. But when you actually run composer update
without the --dry-run tag, you get:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
> Drupal\Core\Composer\Composer::preAutoloadDump
> Drupal\Core\Composer\Composer::ensureHtaccess
I brought this to the Composer developers, thinking there may be a composer bug that causes --dry-run to have a different output than a real update. But it appears the issue is with a Drupal script. Running composer update --no-scripts
gives you this:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 0 updates, 35 removals
- Removing webmozart/assert (1.3.0)
- Removing symfony/phpunit-bridge (v3.4.6)
- Removing symfony/dom-crawler (v3.4.6)
- Removing symfony/css-selector (v3.4.6)
- Removing symfony/browser-kit (v3.4.6)
- Removing squizlabs/php_codesniffer (2.9.1)
- Removing sebastian/version (1.0.6)
- Removing sebastian/recursion-context (1.0.5)
- Removing sebastian/global-state (1.1.1)
- Removing sebastian/exporter (1.2.2)
- Removing sebastian/environment (1.3.8)
- Removing sebastian/diff (1.4.3)
- Removing sebastian/comparator (1.2.4)
- Removing phpunit/phpunit-mock-objects (2.3.8)
- Removing phpunit/phpunit (4.8.36)
- Removing phpunit/php-token-stream (1.4.12)
- Removing phpunit/php-timer (1.0.9)
- Removing phpunit/php-text-template (1.2.1)
- Removing phpunit/php-file-iterator (1.4.5)
- Removing phpunit/php-code-coverage (2.2.4)
- Removing phpspec/prophecy (1.7.5)
- Removing phpdocumentor/type-resolver (0.3.0)
- Removing phpdocumentor/reflection-docblock (3.2.2)
- Removing phpdocumentor/reflection-common (1.0.1)
- Removing mikey179/vfsstream (v1.6.5)
- Removing jcalderonzumba/mink-phantomjs-driver (v0.3.3)
- Removing jcalderonzumba/gastonjs (v1.2.0)
- Removing instaclick/php-webdriver (1.4.5)
- Removing fabpot/goutte (v3.2.2)
- Removing drupal/coder (8.2.12)
The package has modified files:
D coder_sniffer/Drupal/Test/Array/ArrayUnitTest.inc
D coder_sniffer/Drupal/Test/Array/ArrayUnitTest.inc.fixed
D coder_sniffer/Drupal/Test/Array/ArrayUnitTest.php
D coder_sniffer/Drupal/Test/Array/DisallowLongArraySyntaxUnitTest.php
D coder_sniffer/Drupal/Test/Array/disallow_long_array_d7/DisallowLongArraySyntaxUnitTest.1.inc
D coder_sniffer/Drupal/Test/Array/disallow_long_array_d7/disallow_long_array_d7.info
D coder_sniffer/Drupal/Test/Array/disallow_long_array_d8/DisallowLongArraySyntaxUnitTest.2.inc
D coder_sniffer/Drupal/Test/Array/disallow_long_array_d8/DisallowLongArraySyntaxUnitTest.2.inc.fixed
D coder_sniffer/Drupal/Test/Array/disallow_long_array_d8/disallow_long_array_d8.info.yml
D coder_sniffer/Drupal/Test/Classes/ClassCreateInstanceUnitTest.inc
237 more files modified, choose "v" to view the full list
Discard changes [y,n,v,d,?]? y
- Removing doctrine/instantiator (1.0.5)
- Removing behat/mink-selenium2-driver (dev-master 93474c6)
- Removing behat/mink-goutte-driver (v1.2.1)
- Removing behat/mink-browserkit-driver (v1.3.2)
- Removing behat/mink (dev-master 04ab7af)
Writing lock file
Generating autoload files
This may work as designed, but the inability to use --dry-run is certainly a hamper on assessing module versions and dependencies with our web developer and his clients. I appreciate any and all help in solving this!