Skip to content
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

Drush 10 || 11 throws error when running core-cli, due to incompatibility with psy/psysh:~11 #5141

Closed
marklabrecque opened this issue May 6, 2022 · 2 comments

Comments

@marklabrecque
Copy link

marklabrecque commented May 6, 2022

I get an error thrown by drush when running core-cli subcommand.

To Reproduce
When I run drush core-cli, I get the following error.
PHP Fatal error: Declaration of Drush\Psysh\Shell::hasCommand($input) must be compatible with Psy\Shell::hasCommand(string $input): bool in /var/www/html/vendor/drush/drush/src/Psysh/Shell.php on line 37

Fatal error: Declaration of Drush\Psysh\Shell::hasCommand($input) must be compatible with Psy\Shell::hasCommand(string $input): bool in /var/www/html/vendor/drush/drush/src/Psysh/Shell.php on line 37
[warning] Drush command terminated abnormally.

Expected behavior
I would expect the core-cli command to succeed and drop me into a functioning shell

Actual behavior
See above error.

Workaround
No known workaround.

System Configuration

Q A
Drush version? 11.x/10.x (I tried a number of minor version revisions on both 10 and 11, to same result)
Drupal version? 9.3.12
PHP version 7.4
OS? Linux - arm64

Additional information
Please note, there is already another similar issue for drush 8 that might be related, but enough changed between 8 and 10/11 that it may be a different problem that manifests the same.

See #5134

@greg-1-anderson
Copy link
Member

We have #4919 and #5136 for Drush 8. Seems like an update of the signatures for the Psysh method overrides and an update to composer.json should make it work again. Might be trickier if both new and old versions of psysh need to be supported (e.g. for older versions of Drupal).

PRs welcome. Please ping a maintainer if you think test failures are not related to the PR. Usually, rebasing should fix those sorts of problems.

@damienmckenna
Copy link

damienmckenna commented Jan 28, 2023

This problem was fixed in commit c1b3a1 and was released in 11.0.0-rc3. I ran into this problem on a site that was still tied to Drush 10.3, once I updated to Drush 11 it worked fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants