Pool::isPackageAcceptable optimisation breaks whatProvides() in Problem class #2661

Closed
naderman opened this Issue Feb 3, 2014 · 6 comments

Projects

None yet

4 participants

@naderman
Member
naderman commented Feb 3, 2014

The problem class uses the following code to inform the user that a package with a particular name does not exist at all. However since we no longer even load packages into the pool which cannot be useful in solving the dependency question (via isPackageAcceptable), whatProvides will incorrectly return no results, even if the package exists but was skipped when adding the repository.

            if (!$this->pool->whatProvides($job['packageName'])) {
                return "\n    - The requested package ".$job['packageName'].' could not be found in any version, there may be a typo in the package name.';
            }

We should probably keep around a simple list of names of all packages for errors, or provide a mechanism to retroactively search all repositories in an error case.

@naderman
Member
naderman commented Feb 3, 2014

@Seldaek which solution do you think is better? I guess keeping the list of names would just use up memory unnecessarily?

@stof
Contributor
stof commented Feb 3, 2014

@naderman I think improving the suggestions of solution would need something more generic. For instance, we should be able to decide whether the message concerning the minimum stability should be displayed (it should be displayed only if the package exists at a lower stability).
Supporting this case as well would lead toward the second solution, with a system dedicated to explaining error cases

@naderman
Member
naderman commented Feb 3, 2014

Yeah that would probably help quite a bit, sounds good

@Seldaek
Member
Seldaek commented Feb 20, 2014

Yeah I'd agree that the whole error reporting has to be overhauled to be able to inspect the state of everything a bit more.

@Seldaek Seldaek added the Feature label Feb 20, 2014
@francoispluchino francoispluchino referenced this issue in fxpio/composer-asset-plugin Sep 30, 2014
Closed

Memory Issues #43

@Seldaek Seldaek added a commit to Seldaek/composer that referenced this issue Mar 27, 2016
@Seldaek Seldaek Improve solver error reporting, fixes #5086, fixes #2575, fixes #2661 a519ea0
@Seldaek Seldaek closed this in 623c0dc Apr 1, 2016
@andrey1s andrey1s referenced this issue in fxpio/composer-asset-plugin Apr 1, 2016
Merged

add params whatProvides #205

@starrychloe

This is broken again: http://stackoverflow.com/questions/36818363/composer-is-broken-class-fxp-composer-assetplugin-repository-npmrepository-does

I'm using fxp/composer-asset-plugin (v1.1.4) and Composer version 1.0.2 2016-04-21 12:30:18.

@starrychloe

Had to remove vendor/ and composer.lock and ~/.composer, then re-install fxp/composer-asset-plugin globally, then composer install would work.

http://stackoverflow.com/a/36672628/148844

@janatzend janatzend added a commit to janatzend/ZendServerSDK that referenced this issue May 2, 2016
@janatzend janatzend added fix to composer/composer#2661 e52b39d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment