hechoendrupal / drupal-console-extend-plugin

Drupal Console Extend Composer Plugin
131 stars 31 forks source link

Uninstalling this package throws an exception #2

Closed rbayliss closed 7 years ago

rbayliss commented 7 years ago

Steps to reproduce

Using the following minimal composer.json, run composer install followed by composer install --no-dev. Observe a fatal error: The "" directory does not exist is thrown during uninstallation.

Suggested Resolution

As a temporary fix, exit Drupal\Console\Composer\Plugin\Extender::processPackages() immediately if $directory doesn't exist. As a permanent fix, use the PackageEvent to determine the paths to vendor and the package root instead of hard-coding them.

rbayliss commented 7 years ago

Err, and the composer.json:

{
    "name": "rbayliss/console-extend-plugin-error-demo",
    "type": "project",
    "minimum-stability": "dev",
    "prefer-stable": true,
    "require-dev": {
        "drupal/console": "^1.0.0-rc16"
    },
    "require": {}
}
rbayliss commented 7 years ago

For anybody affected by this, I've rolled the temporary fix in a fork. You can use it by adding the following to the "repositories" in composer.json:

{
    "type": "vcs",
    "url": "https://github.com/rbayliss/drupal-console-extend-plugin.git"
}

And the following to your require-dev:

"drupal/console-extend-plugin": "dev-temp_fix_uninstall_error as 0.4.1",

I'll be submitting the permanent fix as a PR shortly.

grasmash commented 7 years ago

I'm hitting this issue pretty frequently.

jmolivas commented 7 years ago

PR #3 merged and new released tagged 0.5.0 @rbayliss does this fix the issue?

thom8 commented 7 years ago

@jmolivas I think this might have broken https://github.com/drupal-composer/drupal-project

After a clean install I'm getting

ubuntu@box1107:~/drupal-project$ composer validate
PHP Warning:  Uncaught ErrorException: require_once(ExtenderManager.php): failed to open stream: No such file or directory in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code:16
Stack trace:
#0 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code(16): Composer\Util\ErrorHandler::handle(2, 'require_once(Ex...', 'phar:///usr/loc...', 16, Array)
#1 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code(16): require_once()
#2 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195): eval()
#3 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(261): Composer\Plugin\PluginManager->registerPackage(Object(Composer\Package\CompletePackage))
#4 phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(76): Composer\Plugin\PluginManager->loadRepository(Object(Composer\Repository\InstalledFilesystemRepository))
#5 phar:///usr/local/bin/composer/src/Composer/Factory.php(377): Com in phar:///usr/local/bin/composer/src/Composer/Plugin/PluginManager.php(195) : eval()'d code on line 16
thom8 commented 7 years ago

Here's a example CI build -- https://circleci.com/gh/thom8/drupal-project/18

just trying to revert to 0.4.0 and run a test

thom8 commented 7 years ago

Yeah fixed by reverting to 0.4.0 -- https://circleci.com/gh/thom8/drupal-project/20

webflo commented 7 years ago

@thom8 Please review #8 Thanks!

jmolivas commented 7 years ago

@rbayliss @grasmash @thom8 @webflo PR #8 merged and new released tagged https://github.com/hechoendrupal/drupal-console-extend-plugin/releases/tag/0.6.0

webflo commented 7 years ago

Thanks 👍

thom8 commented 7 years ago

And builds are working, thanks @jmolivas

jmolivas commented 7 years ago

Closing this one. Feel free to re-open if still happening after updating to the latest version.

Nice work all. I just marge the PR and tag a new release ;)