cweagans / composer-patches

Simple patches plugin for Composer
https://www.cweagans.net/project/composer-patches
BSD 3-Clause "New" or "Revised" License
1.53k stars 240 forks source link

Cannot apply patch on ssh chroot environment #592

Open dearste opened 2 months ago

dearste commented 2 months ago

Verification

What were you trying to do (and why)?

run composer install on ssh chroot access.

What happened? What did you expect to happen?

[Exception] Cannot apply patch

Full contents of composer.json

"extra": {
        "magento-force": true,
        "composer-exit-on-patch-failure": true,
        "patches": {
            "mageworx/module-xmlsitemap": {
                "Fix Zend deprecation": "patches/fix-zend-deprecation.patch"
            },
            "brandung/cash-on-delivery-fee": {
                "Fix PHP 8.1 compatibilty for Invoice": "patches/cash-on-delivery-invoice.patch",
                "Fix PHP 8.1 compatibilty for Creditmemo": "patches/cash-on-delivery-creditmemo.patch"
            },
            "mageplaza/magento-2-blog-extension": {
                "Customer creation bug, conflicts with the Amasty checkout module": "patches/blog-amasty.patch"
            },
            "klarna/module-payments": {
                "Conversion from int to string issue": "patches/klarna-payment.patch"
            },
            "klarna/module-backend": {
                "Fix Klarna shipment processing issue": "patches/fix-klarna-shipment.patch"
            }
        }
    }

Full contents of patches.lock.json

{
    "_hash": "747722c7916b3fe444481f2556d7f78bd57a92055d35fbb8c56f7015dcf7fd01",
    "patches": {
        "mageworx/module-xmlsitemap": [
            {
                "package": "mageworx/module-xmlsitemap",
                "description": "Fix Zend deprecation",
                "url": "patches/fix-zend-deprecation.patch",
                "sha256": "bac48416fa16a938f9ee3f0f8750633659299e3b175f69e3aa93653dccce0f95",
                "depth": 1,
                "extra": {
                    "provenance": "root"
                }
            }
        ],
        "brandung/cash-on-delivery-fee": [
            {
                "package": "brandung/cash-on-delivery-fee",
                "description": "Fix PHP 8.1 compatibilty for Invoice",
                "url": "patches/cash-on-delivery-invoice.patch",
                "sha256": "e59184e794397b89207a124a67271c3d5112c9387c8c78316e8d73ee4deacd20",
                "depth": 1,
                "extra": {
                    "provenance": "root"
                }
            },
            {
                "package": "brandung/cash-on-delivery-fee",
                "description": "Fix PHP 8.1 compatibilty for Creditmemo",
                "url": "patches/cash-on-delivery-creditmemo.patch",
                "sha256": "4d7b1f274fdb78e7123a0a364b271e113f097d65d52226ad561d21a072d0630c",
                "depth": 1,
                "extra": {
                    "provenance": "root"
                }
            }
        ],
        "mageplaza/magento-2-blog-extension": [
            {
                "package": "mageplaza/magento-2-blog-extension",
                "description": "Customer creation bug, conflicts with the Amasty checkout module",
                "url": "patches/blog-amasty.patch",
                "sha256": "fa4784fbd6579b20f3ac4d95c9ca15140974b842ca45dda018d0c8342b20cee3",
                "depth": 1,
                "extra": {
                    "provenance": "root"
                }
            }
        ],
        "klarna/module-payments": [
            {
                "package": "klarna/module-payments",
                "description": "Conversion from int to string issue",
                "url": "patches/klarna-payment.patch",
                "sha256": "e0abd304623ac4fb29c0c1cafdce25b83ddba3e00323166ba169d8da79dafc62",
                "depth": 1,
                "extra": {
                    "provenance": "root"
                }
            }
        ]
    }
}

Full output of composer patches-doctor

not available

Full output of relevant Composer command with the -vvv flag added

No patches found for klarna/module-admin-settings
> post-package-install: Magento\InventoryComposerInstaller\Plugin->onPackageChange
> post-package-install: cweagans\Composer\Plugin\Patches->patchPackage
  - Patching klarna/module-payments
    - Downloading and applying patch patches/klarna-payment.patch (Conversion from int to string issue)
      - Downloading patch patches/klarna-payment.patch
      - Found cached patch at /.config/composer/cache/patches/e0abd304623ac4fb29c0c1cafdce25b83ddba3e00323166ba169d8da79dafc62.patch
      - Applying downloaded patch /.config/composer/cache/patches/e0abd304623ac4fb29c0c1cafdce25b83ddba3e00323166ba169d8da79dafc62.patch
      - Applying patch /.config/composer/cache/patches/e0abd304623ac4fb29c0c1cafdce25b83ddba3e00323166ba169d8da79dafc62.patch (depth: 1)
Executing command (CWD): git --version
cweagans\Composer\Patcher\GitPatcher usable: no
Executing command (CWD): git --version
cweagans\Composer\Patcher\GitInitPatcher usable: no
cweagans\Composer\Patcher\FreeformPatcher usable: yes
Required configuration for FreeformPatcher not present. Skipping.

In Patches.php line 288:

  [Exception]                                                                  
  No available patcher was able to apply patch patches/klarna-payment.patch t  
  o klarna/module-payments                                                     

Exception trace:
  at /public_html/deployment/versions/1453573049-7826002453/vendor/cweagans/composer-patches/src/Plugin/Patches.php:288
 cweagans\Composer\Plugin\Patches->apply() at /public_html/deployment/versions/1453573049-7826002453/vendor/cweagans/composer-patches/src/Plugin/Patches.php:361
 cweagans\Composer\Plugin\Patches->patchPackage() at phar:///bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:215
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar:///bin/composer/src/Composer/EventDispatcher/EventDispatcher.php:150
cweagans commented 2 months ago

What version of git do you have installed in your chroot?