composer-patches icon indicating copy to clipboard operation
composer-patches copied to clipboard

"composer install" needs to be called twice when a dependency adds a patch

Open prudloff-insite opened this issue 3 years ago • 2 comments

Say we have a package A that declares patches for package B.

If we install a new version of package A that contains new patches for package B, here is what happens when we deploy on our CI:

  • At the first composer install, the new version of package A is installed but no new patch is applied.
  • If we launch composer install again, the new patches are applied to package B.

I suppose this happens because the patches are collected before the package is updated.

prudloff-insite avatar Jul 12 '21 16:07 prudloff-insite

I was experiencing this issue on 1.7.0 but updating this package to 1.7.1 resolved it!

briantschu avatar Aug 04 '21 16:08 briantschu

We were indeed using 1.7.0. I tried using 1.7.1 but I can still reproduce the issue.

prudloff-insite avatar Aug 16 '21 12:08 prudloff-insite

This doesn't happen in main anymore.

cweagans avatar Feb 07 '23 21:02 cweagans

I can still reproduce with 37e1b296d8100845c7b10c143cc3e96552d41ab1 (and Composer 2.3.10).

How I reproduce:

  1. Pull a commit that contains composer.lock changes updating a package that declares patches. The package has updated some of its packages since the latest release.
  2. Call composer install: the module is installed but does not update the patches it declares.
  3. Call composer install again: now the patches are applied

prudloff-insite avatar Mar 20 '23 16:03 prudloff-insite