I'm trying to upgrade to Drupal 8.9.1 from 8.7.14, and after some pain, I finally got things working, but then my build failed in my CircleCI process. I tracked it down to what seems to be drupal/core-dev
. It seems that having composer/composer
as a local package messes things up when you do composer install --no-dev
, which I didn't try until my build ran in CircleCI. I was able to reproduce the issue locally though when running composer install --no-dev
in my local dev environment. I was following this info for this part of the upgrade/migration: https://www.drupal.org/docs/updating-drupal/migrate-composer-project-for...
I haven't done this yet, but I'm going to simply try removing drupal/core-dev
from my project. The site that I'm in charge of doing dev for was originally set up by a 3rd-party vendor, and they had the webflo/drupal-core-require-dev
package in there. So, I figured I might need to keep the new one, but I haven't tested it yet.
I guess, another potential workaround could be to specify the exact instance of Composer (global vs. local), but I would imagine that's only possible if it's always installed in the same place across envs where it's used, so not ideal.
Steps to Reproduce
- Put
drupal/core-dev
as a required dependency for development along with the rest of a normal Drupal 8.9.1 project. - Run
composer install
to do a normal install (which you might do as part of your CI process to run tests first) - Run
composer install --no-dev
Expected Behavior
Simply run composer install --no-dev
as normal without errors.
What Actually Happened
Error happened, which seems to be from composer/composer
getting removed as a dev dependency. I'm not super familiar with the inner workings of Composer, but from what I can tell from that error, the composer/composer
package is the Composer instance being used when running composer install --no-dev
but in the middle of that process we remove composer/composer
package.
I could also confirm that when I do run the normal install (composer install
), my version of Composer is 1.10.8, which matches what gets installed by drupal/core-dev
package. Also, which composer
points to the "local" package version.
If I run composer install --no-dev
, after it fails, the version and which
of Composer point to my globally installed version.
I'm using Lando for local dev. This occurred in my CircleCI build as well, so I have no reason to suspect this has anything to do with Lando.
"composer install --no-dev -vvv" with Error:
lando 00:23:59 VERBOSE ==> starting bootstrap at level engine...
lando 00:23:59 VERBOSE ==> config bootstrap beginning...
lando 00:23:59 DEBUG ==> emitting event pre-bootstrap-config
lando 00:23:59 DEBUG ==> plugin lando-core loaded from /snapshot/lando/build/cli/plugins/lando-core/index.js
lando 00:23:59 DEBUG ==> plugin lando-events loaded from /snapshot/lando/build/cli/plugins/lando-events/index.js
lando 00:23:59 DEBUG ==> plugin lando-networking loaded from /snapshot/lando/build/cli/plugins/lando-networking/index.js
lando 00:23:59 DEBUG ==> plugin lando-pantheon loaded from /snapshot/lando/build/cli/plugins/lando-pantheon/index.js
lando 00:23:59 DEBUG ==> plugin lando-proxy loaded from /snapshot/lando/build/cli/plugins/lando-proxy/index.js
lando 00:23:59 DEBUG ==> plugin lando-recipes loaded from /snapshot/lando/build/cli/plugins/lando-recipes/index.js
lando 00:23:59 DEBUG ==> plugin lando-services loaded from /snapshot/lando/build/cli/plugins/lando-services/index.js
lando 00:23:59 DEBUG ==> plugin lando-sharing loaded from /snapshot/lando/build/cli/plugins/lando-sharing/index.js
lando 00:23:59 DEBUG ==> plugin lando-test loaded from /snapshot/lando/build/cli/plugins/lando-test/index.js
lando 00:23:59 DEBUG ==> plugin lando-tooling loaded from /snapshot/lando/build/cli/plugins/lando-tooling/index.js
lando 00:23:59 DEBUG ==> emitting event post-bootstrap-config
lando 00:23:59 VERBOSE ==> building proxy config...
lando 00:23:59 VERBOSE ==> config bootstrap completed.
lando 00:23:59 VERBOSE ==> tasks bootstrap beginning...
lando 00:23:59 DEBUG ==> emitting event pre-bootstrap-tasks
lando 00:23:59 DEBUG ==> autoloaded task config
lando 00:23:59 DEBUG ==> autoloaded task destroy
lando 00:23:59 DEBUG ==> autoloaded task info
lando 00:23:59 DEBUG ==> autoloaded task list
lando 00:23:59 DEBUG ==> autoloaded task logs
lando 00:23:59 DEBUG ==> autoloaded task poweroff
lando 00:23:59 DEBUG ==> autoloaded task rebuild
lando 00:23:59 DEBUG ==> autoloaded task restart
lando 00:23:59 DEBUG ==> autoloaded task share
lando 00:23:59 DEBUG ==> autoloaded task start
lando 00:23:59 DEBUG ==> autoloaded task stop
lando 00:23:59 DEBUG ==> autoloaded task version
lando 00:23:59 DEBUG ==> autoloaded task init
lando 00:23:59 DEBUG ==> autoloaded task ssh
lando 00:23:59 DEBUG ==> emitting event post-bootstrap-tasks
lando 00:23:59 VERBOSE ==> tasks bootstrap completed.
lando 00:23:59 VERBOSE ==> engine bootstrap beginning...
lando 00:23:59 DEBUG ==> emitting event pre-bootstrap-engine
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-core/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-pantheon/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-proxy/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-recipes/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-services/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> automoved scripts from /snapshot/lando/build/cli/plugins/lando-sharing/scripts to /home/tom/.lando/scripts and set to mode 755
lando 00:23:59 DEBUG ==> emitting event post-bootstrap-engine
lando 00:23:59 VERBOSE ==> engine bootstrap completed.
lando 00:23:59 VERBOSE ==> bootstrap completed.
lando 00:23:59 DEBUG ==> emitting event post-bootstrap
lando 00:23:59 VERBOSE ==> docker-engine exists: true
lando 00:23:59 VERBOSE ==> docker-compose exists: true
lando 00:23:59 DEBUG ==> emitting event cli-answers
lando 00:23:59 DEBUG ==> emitting event cli-composer-answers
lando 00:23:59 DEBUG ==> emitting event cli-run
lando 00:23:59 DEBUG ==> emitting event cli-composer-run
lando 00:23:59 DEBUG ==> emitting event pre-composer
lando 00:23:59 DEBUG ==> process pid4 running /usr/bin/docker exec centrifyd8_appserver_1 composer cstdio=[inherit, pipe, pipe], silent=false, mode=attach, detached=false
lando 00:24:00 DEBUG ==> engine is up.
lando 00:24:00 DEBUG ==> docker is running.
Reading ./composer.json
Loading config file /var/www/.composer/auth.json
Loading config file ./composer.json
Checked CA file /etc/ssl/certs/ca-certificates.crt: valid
Executing command (/app): git branch --no-color --no-abbrev -v
Reading /var/www/.composer/composer.json
Loading config file /var/www/.composer/auth.json
Loading config file /var/www/.composer/composer.json
Loading config file /var/www/.composer/auth.json
Reading /var/www/.composer/auth.json
Reading /app/vendor/composer/installed.json
Reading /var/www/.composer/vendor/composer/installed.json
Loading plugin zaporylie\ComposerDrupalOptimizations\Plugin
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'
lando 00:24:00 VERBOSE ==> checking docker version compatibility...
lando 00:24:00 DEBUG ==> compatibility results name=compose, link=https://docs.docker.com/compose/install/#install-compose-on-linux-systems, wants=1.23.0 - 1.25.5, version=1.25.5, semversion=1.25.5, semmin=1.23.0, semmax=1.25.5, dockerVersion=true, satisfied=true, name=engine, link=https://docs.docker.com/engine/install/, wants=18.09.3 - 19.04.0, version=19.03.6, semversion=19.3.6, semmin=18.9.3, semmax=19.4.0, dockerVersion=true, satisfied=true
Loading plugin rvtraveller\QuicksilverComposerInstaller\QuicksilverComposerInstallerPlugin
Loading plugin Drupal\Composer\Plugin\Scaffold\Plugin
Loading plugin Drupal\Console\Composer\Plugin\Extender
Loading plugin cweagans\Composer\Patches
Loading plugin Composer\Installers\Plugin
Loading plugin Hirak\Prestissimo\Plugin
Running 1.10.8 (2020-06-24 21:23:30) with PHP 7.4.7 on Linux / 5.3.0-7648-generic
Reading ./composer.lock
Gathering patches for root package.
Removing package drupal/entity_browser so that it can be re-installed and re-patched.
- Removing drupal/entity_browser (2.5.0)
Deleting web/modules/contrib/entity_browser - deleted
Loading composer repositories with package information
Installing dependencies from lock file
Reading ./composer.lock
Resolving dependencies through SAT
Looking at all rules.
Dependency resolution completed in 0.006 seconds
Analyzed 704 packages to resolve dependencies
Analyzed 2424 rules to resolve dependencies
Package operations: 1 install, 0 updates, 50 removals
Installs: drupal/entity_browser:2.5.0
Removals: theseer/tokenizer, symfony/phpunit-bridge, symfony/lock, symfony/browser-kit, squizlabs/php_codesniffer, seld/phar-utils, seld/jsonlint, sebastian/version, sebastian/resource-operations, sebastian/recursion-context, sebastian/object-reflector, sebastian/object-enumerator, sebastian/global-state, sebastian/exporter, sebastian/environment, sebastian/diff, sebastian/comparator, sebastian/code-unit-reverse-lookup, phpunit/phpunit-mock-objects, phpunit/phpunit, phpunit/php-token-stream, phpunit/php-timer, phpunit/php-text-template, phpunit/php-file-iterator, phpunit/php-code-coverage, phpspec/prophecy, phar-io/version, phar-io/manifest, overtrue/phplint, n98/junit-xml, myclabs/deep-copy, mikey179/vfsstream, justinrainbow/json-schema, jcalderonzumba/mink-phantomjs-driver, jcalderonzumba/gastonjs, fabpot/goutte, drupal/drupal-extension, drupal/core-dev, drupal/coder, doctrine/instantiator, composer/xdebug-handler, composer/spdx-licenses, composer/composer, composer/ca-bundle, behat/transliterator, behat/mink-goutte-driver, behat/mink-extension, behat/mink-browserkit-driver, behat/gherkin, behat/behat
- Removing theseer/tokenizer (1.1.3)
- Removing symfony/phpunit-bridge (v3.4.42)
- Removing symfony/lock (v3.4.42)
- Removing symfony/browser-kit (v3.4.42)
- Removing squizlabs/php_codesniffer (3.5.5)
- Removing seld/phar-utils (1.1.0)
- Removing seld/jsonlint (1.8.0)
- Removing sebastian/version (2.0.1)
- Removing sebastian/resource-operations (1.0.0)
- Removing sebastian/recursion-context (3.0.0)
- Removing sebastian/object-reflector (1.1.1)
- Removing sebastian/object-enumerator (3.0.3)
- Removing sebastian/global-state (2.0.0)
- Removing sebastian/exporter (3.1.2)
- Removing sebastian/environment (3.1.0)
- Removing sebastian/diff (2.0.1)
- Removing sebastian/comparator (2.1.3)
- Removing sebastian/code-unit-reverse-lookup (1.0.1)
- Removing phpunit/phpunit-mock-objects (5.0.10)
- Removing phpunit/phpunit (6.5.14)
- Removing phpunit/php-token-stream (2.0.2)
- 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 (5.3.2)
- Removing phpspec/prophecy (v1.10.3)
- Removing phar-io/version (1.0.1)
- Removing phar-io/manifest (1.0.1)
- Removing overtrue/phplint (2.0.2)
- Removing n98/junit-xml (1.0.0)
- Removing myclabs/deep-copy (1.10.1)
- Removing mikey179/vfsstream (v1.6.8)
- Removing justinrainbow/json-schema (5.2.10)
- Removing jcalderonzumba/mink-phantomjs-driver (v0.3.3)
- Removing jcalderonzumba/gastonjs (v1.2.0)
- Removing fabpot/goutte (v3.2.3)
- Removing drupal/drupal-extension (v3.4.1)
- Removing drupal/core-dev (8.9.1)
- Removing drupal/coder (8.3.9)
Executing command (/app/vendor/drupal/coder): git show-ref --head -d
Executing command (/app/vendor/drupal/coder): git status --porcelain --untracked-files=no
Executing command (CWD): rm -rf '/app/vendor/drupal/coder'
- Removing doctrine/instantiator (1.3.1)
- Removing composer/xdebug-handler (1.4.2)
- Removing composer/spdx-licenses (1.5.3)
- Removing composer/composer (1.10.8)
- Removing composer/ca-bundle (1.2.7)
- Removing behat/transliterator (v1.3.0)
- Removing behat/mink-goutte-driver (v1.2.1)
- Removing behat/mink-extension (2.3.1)
- Removing behat/mink-browserkit-driver (v1.3.4)
- Removing behat/gherkin (v4.6.2)
- Removing behat/behat (v3.7.0)
Gathering patches for root package.
Gathering patches for dependencies. This might take a minute.
Found 16 patches for drupal/core.
Found 1 patches for drupal/adminimal_admin_toolbar.
Found 1 patches for drupal/block_class.
Found 1 patches for drupal/contact_storage.
Found 1 patches for drupal/ctools.
Found 1 patches for drupal/entity_block.
Found 3 patches for drupal/entity_browser.
Found 1 patches for drupal/entity_embed.
Found 1 patches for drupal/facets.
Found 3 patches for drupal/material_admin.
Found 5 patches for drupal/panels.
Found 1 patches for drupal/responsive_preview.
Found 1 patches for drupal/textfield_counter.
Found 1 patches for drupal/video_embed_field.
Found 1 patches for drupal/zurb_foundation.
Found 1 patches for lite.
Found 1 patches for drupal/panelizer.
Found 1 patches for drupal/libraries.
Found 1 patches for drupal/autosave_form.
- Installing drupal/entity_browser (2.5.0):
Failed: [ErrorException] 0: include(/app/vendor/composer/../composer/composer/src/Composer/Util/Url.php): failed to open stream: No such file or directory
In ClassLoader.php line 444:
[ErrorException]
include(/app/vendor/composer/../composer/composer/src/Composer/Util/Url.php): failed to open stream: No such file or directory
Exception trace:
at /app/vendor/composer/ClassLoader.php:444
Composer\Util\ErrorHandler::handle() at /app/vendor/composer/ClassLoader.php:444
include() at /app/vendor/composer/ClassLoader.php:444
Composer\Autoload\includeFile() at /app/vendor/composer/ClassLoader.php:322
Composer\Autoload\ClassLoader->loadClass() at n/a:n/a
spl_autoload_call() at /app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php:270
Composer\Downloader\FileDownloader->processUrl() at /app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php:127
Composer\Downloader\FileDownloader->doDownload() at /app/vendor/composer/composer/src/Composer/Downloader/FileDownloader.php:97
Composer\Downloader\FileDownloader->download() at /app/vendor/composer/composer/src/Composer/Downloader/ArchiveDownloader.php:38
Composer\Downloader\ArchiveDownloader->download() at /app/vendor/composer/composer/src/Composer/Downloader/ZipDownloader.php:77
Composer\Downloader\ZipDownloader->download() at /app/vendor/composer/composer/src/Composer/Downloader/DownloadManager.php:216
Composer\Downloader\DownloadManager->download() at /app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php:197
Composer\Installer\LibraryInstaller->installCode() at /app/vendor/composer/composer/src/Composer/Installer/LibraryInstaller.php:101
Composer\Installer\LibraryInstaller->install() at /app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php:173
Composer\Installer\InstallationManager->install() at /app/vendor/composer/composer/src/Composer/Installer/InstallationManager.php:160
Composer\Installer\InstallationManager->execute() at /app/vendor/composer/composer/src/Composer/Installer.php:611
Composer\Installer->doInstall() at /app/vendor/composer/composer/src/Composer/Installer.php:232
Composer\Installer->run() at /app/vendor/composer/composer/src/Composer/Command/InstallCommand.php:122
Composer\Command\InstallCommand->execute() at /app/vendor/symfony/console/Command/Command.php:255
Symfony\Component\Console\Command\Command->run() at /app/vendor/symfony/console/Application.php:987
Symfony\Component\Console\Application->doRunCommand() at /app/vendor/symfony/console/Application.php:255
Symfony\Component\Console\Application->doRun() at /app/vendor/composer/composer/src/Composer/Console/Application.php:281
Composer\Console\Application->doRun() at /app/vendor/symfony/console/Application.php:148
Symfony\Component\Console\Application->run() at /app/vendor/composer/composer/src/Composer/Console/Application.php:113
Composer\Console\Application->run() at /app/vendor/composer/composer/bin/composer:62
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...
lando 00:24:01 DEBUG ==> process pid4 finished with exit code 1