Skip to content

Globally installed Drush 11 (no Drupal) depends on symfony/http-kernel but does not require it #5156

@AlexSkrypnyk

Description

@AlexSkrypnyk

Describe the bug
Fresh install of Composer

PHP 8.1.5 (cli) (built: Apr 16 2022 00:14:18) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.5, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.5, Copyright (c), by Zend Technologies
Composer version 2.3.6 2022-06-01 21:57:13

Checked several times - installing Drush 11 and then calling drush --version ends up with


Fatal error: Uncaught Error: Class "Symfony\Component\HttpKernel\Kernel" not found in /Users/____/.composer/vendor/drush/drush/src/Preflight/Preflight.php:208
Stack trace:
#0 /Users/____/.composer/vendor/drush/drush/src/Runtime/Runtime.php(84): Drush\Preflight\Preflight->loadSymfonyCompatabilityAutoloader()
#1 /Users/____/.composer/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/____/.composer/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#3 /Users/____/.composer/vendor/drush/drush/drush(4): require('/Users/o_o/.com...')
#4 /Users/____/.composer/vendor/bin/drush(117): include('/Users/o_o/.com...')
#5 {main}
  thrown in /Users/____/.composer/vendor/drush/drush/src/Preflight/Preflight.php on line 208

Checked dependencies - no deps on symfony/http-kernel in ccomposer.json but the deps was introduced in #5108

https://github.com/drush-ops/drush/pull/5108/files#diff-fcb54a74a331c6112bd5cf5e32f08a4d0a39f42c16833b899b4fac0339d453c7R204

There are no other packages installed globally - only drush 11.

{
    "require": {
        "drush/drush": "^11.0"
    }
}

To Reproduce

composer global install drush/drush
drush --version

Expected behavior
Drush to print version

Actual behavior


Fatal error: Uncaught Error: Class "Symfony\Component\HttpKernel\Kernel" not found in /Users/____/.composer/vendor/drush/drush/src/Preflight/Preflight.php:208
Stack trace:
#0 /Users/____/.composer/vendor/drush/drush/src/Runtime/Runtime.php(84): Drush\Preflight\Preflight->loadSymfonyCompatabilityAutoloader()
#1 /Users/____/.composer/vendor/drush/drush/src/Runtime/Runtime.php(51): Drush\Runtime\Runtime->doRun(Array, Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 /Users/____/.composer/vendor/drush/drush/drush.php(72): Drush\Runtime\Runtime->run(Array)
#3 /Users/____/.composer/vendor/drush/drush/drush(4): require('/Users/o_o/.com...')
#4 /Users/____/.composer/vendor/bin/drush(117): include('/Users/o_o/.com...')
#5 {main}
  thrown in /Users/____/.composer/vendor/drush/drush/src/Preflight/Preflight.php on line 208

Workaround
Explicitly install symfony/http-kernel globally

System Configuration

Q A
Drush version? 11.0.9
Drupal version? NONE
PHP version 8.1
OS? Mac/Linux

Additional information
Attaching "pure"composer.lock - no deps on symfony/http-kernel declared and the package itself is not present.

composer.lock.txt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions