New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Globally installed Drush 11 (no Drupal) depends on symfony/http-kernel but does not require it #5156
Comments
Looking at CI config - there are only jobs with Drupal installed - there is no build of the standalone installation. Maybe it can be added to make sure that Drush can be installed without relying on Drupal's dependencies. |
I'm not sure that dependency is deliberate. Might be change that check to survive that package being missing. ping @greg-1-anderson |
Yeah, the reference was added here: Wasn't caught because a global install of Drush 11 is not a recommended configuration. Adding a direct dependency on symfony/http-kernel is reasonable, though. |
A global install of Drush 11 is only going to work with Drupal 9 anyway, so I suppose we could simply assume |
I would prefer that over a new dependency. We dont speak http and I dont want anyone to get ideas that we should. |
I wonder if the Symfony major version exists in some other Symfony project. |
Can we please at least add some check for class existence or some other gate to prevent this. Drush is installed on many systems as global and a version check is a simplest test that a package works. Currently, this fails, which breaks automations. Even installing it as local without any other packages will lead to the same error when calling Thank you for looking into this in a such short notice. |
PRs welcome. I may eventually have time to take this on. |
As an aside, although global installs of Drush are not recommended in general, |
- Remove Global Drush install, no longer recommended and broken. - See: drush-ops/drush#5156 - Adds path for wpcli to be owned by Apache (this errors if not done) - Removes php-pecl-mcrypt, the library is deprecated and the Alpine package has not been updated to PHP 8.1.
For anyone encountering this bug. Do this: |
composer require symfony/http-kernel -W did not work for me. I got this: Using version ^5.4 for symfony/http-kernel Problem 1 You can also try re-running composer require with an explicit version constraint, e.g. "composer require symfony/http-kernel:*" to figure out if any version is installable, or "composer require symfony/http-kernel:^2.1" if you know which you need. Installation failed, reverting ./composer.json and ./composer.lock to their original content. Problem 1 Installation failed, reverting ./composer.json and ./composer.lock to their original content. |
¿Do you fix that issue? I have the same problem |
I have not (yet) fixed the issue. (Disclaimer - I'm in a bit over my head and trying to understand explanations and suggestions from various support sources, so take my thoughts with several grains of salt.) I was told it is better practice to install Composer globally but Drush locally in each project, and use drush-launcher to call/access the drush version that is appropriate for the given project. https://github.com/drush-ops/drush-launcher I installed Composer globally on my BPS without issue and then hit a brick wall with Drush. It seemed to install but wold not init. I've been told now to use drush-launcher but I am not sure whether or not to leave the drush I installed globally but could not init, and exactly what the work flow will be once I move my shared hosting projects into the VPS. I think I am supposed to - in EACH project - do composer require drush/drush and then use drush launcher to launch that version's drush. |
I think what you meant was
|
Please do not use |
A dependency of Symfony is needed for drush, if drush is not installed along with Drupal. |
FYI this constant is not in Drush 12 anymore (not yet released). We can keep this issue open for prior versions. |
C:\xampp\htdocs\silkmark-pressflow>drush updatedb How to fix this |
Describe the bug
Fresh install of Composer
Checked several times - installing Drush 11 and then calling
drush --version
ends up withChecked dependencies - no deps on
symfony/http-kernel
in ccomposer.json
but the deps was introduced in #5108https://github.com/drush-ops/drush/pull/5108/files#diff-fcb54a74a331c6112bd5cf5e32f08a4d0a39f42c16833b899b4fac0339d453c7R204
There are no other packages installed globally - only drush 11.
To Reproduce
Expected behavior
Drush to print version
Actual behavior
Workaround
Explicitly install
symfony/http-kernel
globallySystem Configuration
Additional information
Attaching "pure"
composer.lock
- no deps onsymfony/http-kernel
declared and the package itself is not present.composer.lock.txt
The text was updated successfully, but these errors were encountered: