Patches in `composer.json` do not apply cleanly
Overview
The definition of composer.json
appears to require certain patches; however, these cannot be applied in projects where civicrm-core
is loaded as a dependency.
Reproduction steps
drush dl drupal-8.7.x
cd drupal-8.7.x-dev
## Tangential workarounds
composer update psr/log
composer require 'pear/pear_exception:1.0.1 as 1.0.0' 'cache/integration-tests:dev-master#b97328797ab199f0ac933e39842a86ab732f21f9'
## Enable patching
## https://github.com/cweagans/composer-patches#allowing-patches-to-be-applied-from-dependencies
composer require cweagans/composer-patches:^1.5.0
composer config extra.enable-patching true
## Add CiviCRM
composer require civicrm/civicrm-core:5.22.x-dev
Current behaviour
As part of the output from composer require ...
/ composer install
, we get:
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing zetacomponents/mail (dev-master 4dc71cc): Cloning 4dc71ccbcc from cache
- Applying patches for zetacomponents/mail
tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch (CiviCRM Custom Patches for ZetaCompoents mail)
Could not apply patch! Skipping. The error was: The "tools/scripts/composer/patches/civicrm-custom-patches-zetacompoents-mail.patch" file could not be downloaded: failed to open stream: No such file or directory
...
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing phpoffice/common (0.2.9): Loading from cache
- Applying patches for phpoffice/common
tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch (Fix handling of libxml_disable_entity_loader)
Could not apply patch! Skipping. The error was: The "tools/scripts/composer/patches/phpoffice-common-xml-entity-fix.patch" file could not be downloaded: failed to open stream: No such file or directory
> Drupal\Core\Composer\Composer::vendorTestCodeCleanup
- Installing phpoffice/phpword (0.15.0): Loading from cache
- Applying patches for phpoffice/phpword
tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch (Fix handling of libxml_disable_entity_loader)
Could not apply patch! Skipping. The error was: The "tools/scripts/composer/patches/phpword-libxml-fix-global-handling.patch" file could not be downloaded: failed to open stream: No such file or directory
Additionally, if you manually inspect the files vendor/zetacomponents/mail/src/parser/interfaces/part_parser.php
and vendor/phpoffice/common/src/Common/XMLReader.php
, you can see that the files appear unpatched.
Expected behaviour
The patches should apply.
Alternatively, if the patches are not needed, then perhaps we should remove them?
Environment information
- PHP: 7.2.8
- CMS: Drupal 8.7
- Database: MySQL 5.7