composer-patches
composer-patches copied to clipboard
Packages (targeted by patches) reinstalled on fresh install
The current logic has been built so that when there are patches that have not yet been applied, the packages that they target are re-installed beforehand - even when there are no patches applied previously that would call such a re-install.
Pre-requisites
- Have a project that uses the plugin
- Have patches defined that target some package
- Have no vendor folder (clean install)
- Have composer.lock (just makes the repetition faster)
To Reproduce
Steps to reproduce the behaviour:
- composer install -vvv
Expected
- packages are installed
- log contains information about patches being collected
- patches are applied
Actual
- packages are installed
- log contains information about patches being collected
- patched packages are again re-installed (note: unzipped from cache, not re-downloaded, but still)
- patches are applied
Notes
This has always been the way the plugin works, but can give extra speed boost when avoided if possible.
Unfortunately I can't recall what exactly caused this to be the way it got implemented, but I do remember being more frugal about resets to cause some edge-case issues when using bundled patches. The test-coverage in terms of scenarios has to be greatly improved before this can be properly tightened up.
Most fool-proof solution:
Start tracking the - are patches applied or not based on comparing if the file-tree has changes - to see if the actual code has changes or not (rather than relying on information at installed.json).
If nothing has changed for a specific package (or the check can even be done against specific files), skip the planned reset.