From 0ea9eafcafda3ead6b385673c62c78a2cf38cd17 Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Tue, 2 Jun 2020 10:01:02 +0200 Subject: [PATCH] Add rules for aliased packages when an alias is added, fixes #8902 --- src/Composer/DependencyResolver/RuleSetGenerator.php | 1 + .../Test/Fixtures/installer/github-issues-8902.test | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Composer/DependencyResolver/RuleSetGenerator.php b/src/Composer/DependencyResolver/RuleSetGenerator.php index ffb88d56c..12bd17783 100644 --- a/src/Composer/DependencyResolver/RuleSetGenerator.php +++ b/src/Composer/DependencyResolver/RuleSetGenerator.php @@ -165,6 +165,7 @@ class RuleSetGenerator $this->addedPackagesByNames[$name][] = $package; } } else { + $workQueue->enqueue($package->getAliasOf()); $this->addRule(RuleSet::TYPE_PACKAGE, $this->createRequireRule($package, array($package->getAliasOf()), Rule::RULE_PACKAGE_ALIAS, $package)); } diff --git a/tests/Composer/Test/Fixtures/installer/github-issues-8902.test b/tests/Composer/Test/Fixtures/installer/github-issues-8902.test index c92dda83b..407dff3af 100644 --- a/tests/Composer/Test/Fixtures/installer/github-issues-8902.test +++ b/tests/Composer/Test/Fixtures/installer/github-issues-8902.test @@ -34,11 +34,11 @@ Your requirements could not be resolved to an installable set of packages. Problem 1 - Root composer.json requires beyondcode/laravel-dump-server ^1.3 -> satisfiable by beyondcode/laravel-dump-server[1.4.0]. - - beyondcode/laravel-dump-server 1.4.0 requires symfony/var-dumper ^5.0 -> satisfiable by symfony/var-dumper[dev-master]. - - Root composer.json requires laravel/framework ^6.8 -> satisfiable by laravel/framework[6.8.14]. + - You can only install one version of a package, so only one of these can be installed: symfony/var-dumper[dev-master, 4.4.0]. + - don't install symfony/var-dumper 5.2.x-dev|install symfony/var-dumper dev-master - laravel/framework 6.8.14 requires symfony/var-dumper ^4.3.4 -> satisfiable by symfony/var-dumper[4.4.0]. - etc... - + - beyondcode/laravel-dump-server 1.4.0 requires symfony/var-dumper ^5.0 -> satisfiable by symfony/var-dumper[5.2.x-dev (alias of dev-master)]. + - Root composer.json requires laravel/framework ^6.8 -> satisfiable by laravel/framework[6.8.14]. --EXPECT--