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

Composer install fails with contrib project and bad patch #127

Closed
steveoliver opened this issue May 25, 2017 · 5 comments
Closed

Composer install fails with contrib project and bad patch #127

steveoliver opened this issue May 25, 2017 · 5 comments

Comments

@steveoliver
Copy link

steveoliver commented May 25, 2017

I have a Commerce 2.x project from composer create-project drupalcommerce/project-base mystore --stability dev (install docs) that is requiring one project (commerce_shipping currently, but any one of the commerce contrib projects produced similar errors), and with one failing-to-apply patch to commerce.

The problem is that with a commerce + contrib + bad patch composer.json file, I can composer update but I cannot afterwards composer install. IF I either a.) remove the contrib requirement, or b.) fix the patch, I can composer install after a composer update.

Here is the "bad patch" composer.json and "good patch" composer.json.

Steps to reproduce:

  1. composer update && composer install with bad-patch composer.json. Should fail with error:

Your requirements could not be resolved to an installable set of packages.

Problem 1
- drupal/commerce_price 2.x-dev requires drupal/commerce == 2.9999999.9999999.9999999-dev -> no matching package found.
- drupal/commerce_price 2.x-dev requires drupal/commerce == 2.9999999.9999999.9999999-dev -> no matching package found.
- Installation request for drupal/commerce_price 2.x-dev -> satisfiable by drupal/commerce_price[2.x-dev].

Potential causes:

Read https://getcomposer.org/doc/articles/troubleshooting.md for further common problems.

  1. composer update && composer install with the good-patch composer.json. Should succeed.
  2. composer update && composer install with the bad-patch composer.json, but commerce_shipping require removed.

I've seen patches not apply without composer failing. I don't expect dependency errors to arise from composer patches that don't apply. I'd expect to see them regardless of patch failures.

Am I the only one, or can others reproduce this?

@steveoliver
Copy link
Author

If we do want composer to fail with bad patches, I think the solution to this issue is to report the actual error--bad patches--instead of a version constraint message.

@mglaman
Copy link

mglaman commented Sep 1, 2017

Can reproduce. If composer update drupal/project has patch and fails, next composer install freaks out with 2.9999999.9999999.9999999-dev constraint.

@mglaman
Copy link

mglaman commented Sep 1, 2017

Generally running the update again fixes it (assuming patch failure was a fluke.(

@cweagans
Copy link
Owner

cweagans commented Jun 2, 2018

Added to the 2.0.0 roadmap (#93)

@cweagans cweagans mentioned this issue Jun 2, 2018
36 tasks
@cweagans
Copy link
Owner

cweagans commented Feb 7, 2023

I think this was probably a composer bug. Things have changed significantly since then, so I'm going to assume this is no longer an issue. Please let me know if that's not the case.

@cweagans cweagans closed this as completed Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants