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

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

Closed
naderman opened this issue Feb 3, 2014 · 6 comments
Closed
Milestone

Comments

@naderman
Copy link
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
Copy link
Member Author

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
Copy link
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
Copy link
Member Author

naderman commented Feb 3, 2014

Yeah that would probably help quite a bit, sounds good

@Seldaek
Copy link
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.

@starrychloe
Copy link

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
Copy link

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

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