cweagans / composer-patches

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

Running "composer update nothing" removes patches #369

Closed wissem closed 1 year ago

wissem commented 3 years ago

I have the following composer.json:

{
    "name": "magento/project-community-edition",
    "description": "eCommerce Platform for Growth (Community Edition)",
    "type": "project",
    "license": [
        "OSL-3.0",
        "AFL-3.0"
    ],
    "config": {
        "preferred-install": "dist",
        "sort-packages": true
    },
    "require": {
        "cweagans/composer-patches": "^1.6",
        "magento/data-migration-tool": "2.4.2"
    },
    "replace": {
        "magento/module-customer-sample-data": "*",
        "magento/module-sales-rule-sample-data": "*"
    },
    "conflict": {
        "gene/bluefoot": "*"
    },
    "autoload": {
        "psr-4": {
            "Magento\\Framework\\": "lib/internal/Magento/Framework/",
            "Magento\\Setup\\": "setup/src/Magento/Setup/",
            "Magento\\": "app/code/Magento/",
            "Zend\\Mvc\\Controller\\": "setup/src/Zend/Mvc/Controller/"
        },
        "psr-0": {
            "": [
                "app/code/",
                "generated/code/"
            ]
        },
        "exclude-from-classmap": [
            "**/dev/**",
            "**/update/**",
            "**/Test/**"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "Magento\\Sniffs\\": "dev/tests/static/framework/Magento/Sniffs/",
            "Magento\\Tools\\": "dev/tools/Magento/Tools/",
            "Magento\\Tools\\Sanity\\": "dev/build/publication/sanity/Magento/Tools/Sanity/",
            "Magento\\TestFramework\\Inspection\\": "dev/tests/static/framework/Magento/TestFramework/Inspection/",
            "Magento\\TestFramework\\Utility\\": "dev/tests/static/framework/Magento/TestFramework/Utility/"
        }
    },
    "version": "2.4.2-p1",
    "minimum-stability": "stable",
    "extra": {
        "magento-force": "override",
        "patches": {
            "magento/magento2-base": {
                "magento2#26292": "patches/magento-magento2-26292.diff",
                "Oh Polly Setup Console Command List": "patches/ohpolly/ohpolly-setup-console-commandlist.diff"
            },
            "magento/module-catalog-url-rewrite": {
                "magento2#29365": "patches/magento-magento2-29365.diff"
            },
            "amasty/product-tabs": {
                "Fix less": "patches/amasty/product-tab/less.patch"
            },
            "magento/module-customer": {
                "Fix issue 31920 JS error in the customer data" : "patches/magento-magento2-31940.patch"
            },
            "magento/data-migration-tool": {
                "Fix issue with delta log query for table with `processed` field." : "patches/magento-magento2-data-migration-fix.diff"
            },
            "paypal/module-braintree-core": {
                "Fix braintree:migrate command" : "patches/fix-braintree-migrate-command.patch"
            },
            "klarna/module-kp": {
                "Fix error when vieweing migrated Klarna order from admin" : "patches/fix-migrated-klarna-order-admin-view-error.patch"
            },
            "magento/framework": {
                "Show error 500 page on app bootstrap error": "patches/app-bootstrap-error-500.patch"
            },
            "magento/module-search": {
                "Fix suggest SQL query for empty query parameter": "patches/magento-search-suggest-query-fix.patch"
            },
            "magento/module-sales-rule": {
                "Fix date format issue": "patches/fix-sales-rule-date-format.patch"
            },
            "laminas/laminas-mail": {
                "Error code in socket exception": "patches/laminas-mail-error-code-exception.patch"
            }
        }
    },
    "repositories": {
        "private-packagist": {
            "type": "composer",
            "url": "https://repo.magento.com"
        }
    }
}

(You'll need to create an an account at https://marketplace.magento.com/ and create access key credentials)

Running composer update nothing -vvv on an already up to date composer.lock file, I get the following output:

composer update nothing -vvv ``` Reading ./composer.json (/Users/wissem/dev/packagist/cweagons-bug/composer.json) Loading config file /Users/wissem/.composer/config.json Loading config file /Users/wissem/.composer/auth.json Loading config file ./composer.json (/Users/wissem/dev/packagist/cweagons-bug/composer.json) Checked CA file /usr/local/etc/openssl@1.1/cert.pem: valid Failed to initialize global composer: Composer could not find the config file: /Users/wissem/.composer/composer.json Reading /Users/wissem/dev/packagist/cweagons-bug/vendor/composer/installed.json Loading plugin cweagans\Composer\Patches (from cweagans/composer-patches) Running 2.1.3 (2021-06-09 16:31:20) with PHP 7.4.14 on Darwin / 19.5.0 > pre-update-cmd: cweagans\Composer\Patches->checkPatches Gathering patches for root package. Removing package laminas/laminas-mail so that it can be re-installed and re-patched. - Removing laminas/laminas-mail (2.14.1) Executing async command (CWD): rm -rf '/Users/wissem/dev/packagist/cweagons-bug/vendor/laminas/laminas-mail' Removing package magento/data-migration-tool so that it can be re-installed and re-patched. - Removing magento/data-migration-tool (2.4.2) Executing async command (CWD): rm -rf '/Users/wissem/dev/packagist/cweagons-bug/vendor/magento/data-migration-tool' Removing package magento/framework so that it can be re-installed and re-patched. - Removing magento/framework (103.0.2-p1) Executing async command (CWD): rm -rf '/Users/wissem/dev/packagist/cweagons-bug/vendor/magento/framework' Reading ./composer.lock (/Users/wissem/dev/packagist/cweagons-bug/composer.lock) Loading composer repositories with package information Downloading https://repo.magento.com/packages.json [401] https://repo.magento.com/packages.json Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html Authentication required (repo.magento.com): Username: Password: Using HTTP basic authentication with username "1fa82dd3e06d2e82f2ac0dff4e5cfbac" Downloading https://repo.magento.com/packages.json [200] https://repo.magento.com/packages.json Do you want to store credentials for repo.magento.com in /Users/wissem/.composer/auth.json ? [Yn] n Writing /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/packages.json into cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/p-provider-ce.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/provider-magento$data-migration-tool.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/provider-magento$framework.json from cache Downloading https://repo.packagist.org/packages.json [200] https://repo.packagist.org/packages.json Writing /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-colinmollenhour~credis.json from cache Downloading https://repo.packagist.org/p2/colinmollenhour/credis.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-colinmollenhour~php-redis-session-abstract.json from cache Downloading https://repo.packagist.org/p2/colinmollenhour/php-redis-session-abstract.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~ca-bundle.json from cache Downloading https://repo.packagist.org/p2/composer/ca-bundle.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~composer.json from cache Downloading https://repo.packagist.org/p2/composer/composer.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~metadata-minifier.json from cache Downloading https://repo.packagist.org/p2/composer/metadata-minifier.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~semver.json from cache Downloading https://repo.packagist.org/p2/composer/semver.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~spdx-licenses.json from cache Downloading https://repo.packagist.org/p2/composer/spdx-licenses.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~xdebug-handler.json from cache Downloading https://repo.packagist.org/p2/composer/xdebug-handler.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-container-interop~container-interop.json from cache Downloading https://repo.packagist.org/p2/container-interop/container-interop.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-cweagans~composer-patches.json from cache Downloading https://repo.packagist.org/p2/cweagans/composer-patches.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~guzzle.json from cache Downloading https://repo.packagist.org/p2/guzzlehttp/guzzle.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~promises.json from cache Downloading https://repo.packagist.org/p2/guzzlehttp/promises.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~psr7.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-justinrainbow~json-schema.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-code.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-console.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-crypt.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-diactoros.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-escaper.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-eventmanager.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-filter.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-form.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-http.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-hydrator.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-inputfilter.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-loader.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mail.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-math.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mime.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mvc.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-psr7bridge.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-servicemanager.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-stdlib.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-uri.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-validator.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-zendframework-bridge.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-magento~zendframework1.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-monolog~monolog.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-paragonie~random-compat.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~container.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~http-message.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~log.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-ralouphie~getallheaders.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-ramsey~uuid.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-react~promise.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-seld~jsonlint.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-seld~phar-utils.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~console.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~filesystem.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~finder.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-ctype.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-idn.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-normalizer.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-mbstring.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php72.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php73.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php80.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~process.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~service-contracts.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-tedivm~jshrink.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-true~punycode.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-wikimedia~less.php.json from cache [304] https://repo.packagist.org/p2/colinmollenhour/credis.json [304] https://repo.packagist.org/p2/colinmollenhour/php-redis-session-abstract.json [304] https://repo.packagist.org/p2/composer/ca-bundle.json [304] https://repo.packagist.org/p2/composer/composer.json [304] https://repo.packagist.org/p2/composer/metadata-minifier.json [304] https://repo.packagist.org/p2/composer/semver.json Downloading https://repo.packagist.org/p2/guzzlehttp/psr7.json if modified Downloading https://repo.packagist.org/p2/justinrainbow/json-schema.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-code.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-console.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-crypt.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-diactoros.json if modified [304] https://repo.packagist.org/p2/composer/spdx-licenses.json [304] https://repo.packagist.org/p2/composer/xdebug-handler.json [304] https://repo.packagist.org/p2/container-interop/container-interop.json [304] https://repo.packagist.org/p2/cweagans/composer-patches.json [304] https://repo.packagist.org/p2/guzzlehttp/guzzle.json Downloading https://repo.packagist.org/p2/laminas/laminas-escaper.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-eventmanager.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-filter.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-form.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-http.json if modified [304] https://repo.packagist.org/p2/guzzlehttp/promises.json Downloading https://repo.packagist.org/p2/laminas/laminas-hydrator.json if modified [304] https://repo.packagist.org/p2/guzzlehttp/psr7.json [304] https://repo.packagist.org/p2/justinrainbow/json-schema.json [304] https://repo.packagist.org/p2/laminas/laminas-code.json Downloading https://repo.packagist.org/p2/laminas/laminas-inputfilter.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-loader.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-mail.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-console.json [304] https://repo.packagist.org/p2/laminas/laminas-crypt.json [304] https://repo.packagist.org/p2/laminas/laminas-diactoros.json Downloading https://repo.packagist.org/p2/laminas/laminas-math.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-mime.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-mvc.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-escaper.json [304] https://repo.packagist.org/p2/laminas/laminas-eventmanager.json [304] https://repo.packagist.org/p2/laminas/laminas-filter.json [304] https://repo.packagist.org/p2/laminas/laminas-form.json [304] https://repo.packagist.org/p2/laminas/laminas-http.json Downloading https://repo.packagist.org/p2/laminas/laminas-psr7bridge.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-servicemanager.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-stdlib.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-uri.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-validator.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-hydrator.json Downloading https://repo.packagist.org/p2/laminas/laminas-zendframework-bridge.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-inputfilter.json [304] https://repo.packagist.org/p2/laminas/laminas-loader.json [304] https://repo.packagist.org/p2/laminas/laminas-mail.json Downloading https://repo.packagist.org/p2/magento/zendframework1.json if modified Downloading https://repo.packagist.org/p2/monolog/monolog.json if modified Downloading https://repo.packagist.org/p2/paragonie/random_compat.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-math.json [304] https://repo.packagist.org/p2/laminas/laminas-mime.json [304] https://repo.packagist.org/p2/laminas/laminas-mvc.json Downloading https://repo.packagist.org/p2/psr/container.json if modified Downloading https://repo.packagist.org/p2/psr/http-message.json if modified Downloading https://repo.packagist.org/p2/psr/log.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-psr7bridge.json [304] https://repo.packagist.org/p2/laminas/laminas-servicemanager.json [304] https://repo.packagist.org/p2/laminas/laminas-stdlib.json [304] https://repo.packagist.org/p2/laminas/laminas-uri.json [304] https://repo.packagist.org/p2/laminas/laminas-validator.json [304] https://repo.packagist.org/p2/laminas/laminas-zendframework-bridge.json Downloading https://repo.packagist.org/p2/ralouphie/getallheaders.json if modified Downloading https://repo.packagist.org/p2/ramsey/uuid.json if modified Downloading https://repo.packagist.org/p2/react/promise.json if modified Downloading https://repo.packagist.org/p2/seld/jsonlint.json if modified Downloading https://repo.packagist.org/p2/seld/phar-utils.json if modified Downloading https://repo.packagist.org/p2/symfony/console.json if modified [304] https://repo.packagist.org/p2/magento/zendframework1.json [304] https://repo.packagist.org/p2/monolog/monolog.json [304] https://repo.packagist.org/p2/paragonie/random_compat.json Downloading https://repo.packagist.org/p2/symfony/filesystem.json if modified Downloading https://repo.packagist.org/p2/symfony/finder.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-ctype.json if modified [304] https://repo.packagist.org/p2/psr/container.json [304] https://repo.packagist.org/p2/psr/http-message.json [304] https://repo.packagist.org/p2/psr/log.json Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-idn.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-mbstring.json if modified [304] https://repo.packagist.org/p2/ralouphie/getallheaders.json [304] https://repo.packagist.org/p2/ramsey/uuid.json [304] https://repo.packagist.org/p2/react/promise.json [304] https://repo.packagist.org/p2/seld/jsonlint.json [304] https://repo.packagist.org/p2/seld/phar-utils.json [304] https://repo.packagist.org/p2/symfony/console.json Downloading https://repo.packagist.org/p2/symfony/polyfill-php72.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-php73.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-php80.json if modified Downloading https://repo.packagist.org/p2/symfony/process.json if modified Downloading https://repo.packagist.org/p2/symfony/service-contracts.json if modified Downloading https://repo.packagist.org/p2/tedivm/jshrink.json if modified [304] https://repo.packagist.org/p2/symfony/filesystem.json [304] https://repo.packagist.org/p2/symfony/finder.json [304] https://repo.packagist.org/p2/symfony/polyfill-ctype.json Downloading https://repo.packagist.org/p2/true/punycode.json if modified Downloading https://repo.packagist.org/p2/wikimedia/less.php.json if modified [304] https://repo.packagist.org/p2/symfony/polyfill-intl-idn.json [304] https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json [304] https://repo.packagist.org/p2/symfony/polyfill-mbstring.json [304] https://repo.packagist.org/p2/symfony/polyfill-php72.json [304] https://repo.packagist.org/p2/symfony/polyfill-php73.json [304] https://repo.packagist.org/p2/symfony/polyfill-php80.json [304] https://repo.packagist.org/p2/symfony/process.json [304] https://repo.packagist.org/p2/symfony/service-contracts.json [304] https://repo.packagist.org/p2/tedivm/jshrink.json [304] https://repo.packagist.org/p2/true/punycode.json [304] https://repo.packagist.org/p2/wikimedia/less.php.json Updating dependencies Generating rules Resolving dependencies through SAT Looking at all rules. Dependency resolution completed in 0.000 seconds Analyzed 164 packages to resolve dependencies Analyzed 363 rules to resolve dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Package operations: 3 installs, 0 updates, 0 removals Installs: laminas/laminas-mail:2.14.1, magento/framework:103.0.2-p1, magento/data-migration-tool:2.4.2 Reading /Users/wissem/Library/Caches/composer/files/laminas/laminas-mail/5e3cfa14356aa14b1a0ccf86dd9dcb47fe707af1.zip from cache - Loading laminas/laminas-mail (2.14.1) from cache Reading /Users/wissem/Library/Caches/composer/files/magento/framework/8937e0b7ee717499287775f3ca6698a7fb328af3.zip from cache - Loading magento/framework (103.0.2-p1) from cache Reading /Users/wissem/Library/Caches/composer/files/magento/data-migration-tool/57cc7c23e90a8d490735cf82a179f79f68948555.zip from cache - Loading magento/data-migration-tool (2.4.2) from cache > pre-package-install: cweagans\Composer\Patches->gatherPatches Gathering patches for root package. Gathering patches for dependencies. This might take a minute. Found 2 patches for magento/magento2-base. Found 1 patches for magento/module-catalog-url-rewrite. Found 1 patches for amasty/product-tabs. Found 1 patches for magento/module-customer. Found 1 patches for magento/data-migration-tool. Found 1 patches for paypal/module-braintree-core. Found 1 patches for klarna/module-kp. Found 1 patches for magento/framework. Found 1 patches for magento/module-search. Found 1 patches for magento/module-sales-rule. Found 1 patches for laminas/laminas-mail. - Installing laminas/laminas-mail (2.14.1): Extracting archive Executing async command (CWD): '/usr/bin/unzip' -qq '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/tmp-d3927ebfbad614a1b839b395fe2e347a' -d '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/fb621ebe' > pre-package-install: cweagans\Composer\Patches->gatherPatches Patches already gathered. Skipping - Installing magento/framework (103.0.2-p1): Extracting archive Executing async command (CWD): '/usr/bin/unzip' -qq '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/tmp-5ef2ed609ae837db8a289c4268ca5d80.zip' -d '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/84a2e1d7' > pre-package-install: cweagans\Composer\Patches->gatherPatches Patches already gathered. Skipping - Installing magento/data-migration-tool (2.4.2): Extracting archive Executing async command (CWD): '/usr/bin/unzip' -qq '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/tmp-08580c13269638436c026389d65b95d2.zip' -d '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/4543e19a' Executing async command (CWD): rm -rf '/Users/wissem/dev/packagist/cweagons-bug/vendor/composer/fb621ebe' > post-package-install: cweagans\Composer\Patches->postInstall - Applying patches for laminas/laminas-mail patches/laminas-mail-error-code-exception.patch (Error code in socket exception) Reading patches/laminas-mail-error-code-exception.patch Reading patches/laminas-mail-error-code-exception.patch Could not apply patch! Skipping. The error was: The "patches/laminas-mail-error-code-exception.patch" file could not be downloaded: failed to open stream: No such file or directory > post-package-install: cweagans\Composer\Patches->postInstall - Applying patches for magento/framework patches/app-bootstrap-error-500.patch (Show error 500 page on app bootstrap error) Reading patches/app-bootstrap-error-500.patch Reading patches/app-bootstrap-error-500.patch Could not apply patch! Skipping. The error was: The "patches/app-bootstrap-error-500.patch" file could not be downloaded: failed to open stream: No such file or directory > post-package-install: cweagans\Composer\Patches->postInstall - Applying patches for magento/data-migration-tool patches/magento-magento2-data-migration-fix.diff (Fix issue with delta log query for table with `processed` field.) Reading patches/magento-magento2-data-migration-fix.diff Reading patches/magento-magento2-data-migration-fix.diff Could not apply patch! Skipping. The error was: The "patches/magento-magento2-data-migration-fix.diff" file could not be downloaded: failed to open stream: No such file or directory Downloading https://packagist.org/downloads/ [201] https://packagist.org/downloads/ Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead. Package laminas/laminas-console is abandoned, you should avoid using it. Use laminas/laminas-cli instead. Generating autoload files 34 packages you are using are looking for funding. Use the `composer fund` command to find out more ```

As you can see, this is trying to install packages and applying / removing package patches but it shouldn't.

What I expected But what I would expect (and what happens currently if I don't require `cweagans/composer-patches`): ``` Reading ./composer.json (/Users/wissem/dev/packagist/cweagons-bug-no-patches/composer.json) Loading config file /Users/wissem/.composer/config.json Loading config file /Users/wissem/.composer/auth.json Loading config file ./composer.json (/Users/wissem/dev/packagist/cweagons-bug-no-patches/composer.json) Checked CA file /usr/local/etc/openssl@1.1/cert.pem: valid Failed to initialize global composer: Composer could not find the config file: /Users/wissem/.composer/composer.json Reading /Users/wissem/dev/packagist/cweagons-bug-no-patches/vendor/composer/installed.json Running 2.1.3 (2021-06-09 16:31:20) with PHP 7.4.14 on Darwin / 19.5.0 Reading ./composer.lock (/Users/wissem/dev/packagist/cweagons-bug-no-patches/composer.lock) Loading composer repositories with package information Downloading https://repo.magento.com/packages.json [401] https://repo.magento.com/packages.json Warning from repo.magento.com: You haven't provided your Magento authentication keys. For instructions, visit https://devdocs.magento.com/guides/v2.3/install-gde/prereq/connect-auth.html Authentication required (repo.magento.com): Username: Password: Using HTTP basic authentication with username "1fa82dd3e06d2e82f2ac0dff4e5cfbac" Downloading https://repo.magento.com/packages.json [200] https://repo.magento.com/packages.json Do you want to store credentials for repo.magento.com in /Users/wissem/.composer/auth.json ? [Yn] n Writing /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/packages.json into cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/p-provider-ce.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/provider-magento$data-migration-tool.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.magento.com/provider-magento$framework.json from cache Downloading https://repo.packagist.org/packages.json [200] https://repo.packagist.org/packages.json Writing /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/packages.json into cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-colinmollenhour~credis.json from cache Downloading https://repo.packagist.org/p2/colinmollenhour/credis.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-colinmollenhour~php-redis-session-abstract.json from cache Downloading https://repo.packagist.org/p2/colinmollenhour/php-redis-session-abstract.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~ca-bundle.json from cache Downloading https://repo.packagist.org/p2/composer/ca-bundle.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~composer.json from cache Downloading https://repo.packagist.org/p2/composer/composer.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~metadata-minifier.json from cache Downloading https://repo.packagist.org/p2/composer/metadata-minifier.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~semver.json from cache Downloading https://repo.packagist.org/p2/composer/semver.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~spdx-licenses.json from cache Downloading https://repo.packagist.org/p2/composer/spdx-licenses.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-composer~xdebug-handler.json from cache Downloading https://repo.packagist.org/p2/composer/xdebug-handler.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-container-interop~container-interop.json from cache Downloading https://repo.packagist.org/p2/container-interop/container-interop.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~guzzle.json from cache Downloading https://repo.packagist.org/p2/guzzlehttp/guzzle.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~promises.json from cache Downloading https://repo.packagist.org/p2/guzzlehttp/promises.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-guzzlehttp~psr7.json from cache Downloading https://repo.packagist.org/p2/guzzlehttp/psr7.json if modified Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-justinrainbow~json-schema.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-code.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-console.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-crypt.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-diactoros.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-escaper.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-eventmanager.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-filter.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-form.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-http.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-hydrator.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-inputfilter.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-loader.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mail.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-math.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mime.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-mvc.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-psr7bridge.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-servicemanager.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-stdlib.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-uri.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-validator.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-laminas~laminas-zendframework-bridge.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-magento~zendframework1.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-monolog~monolog.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-paragonie~random-compat.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~container.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~http-message.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-psr~log.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-ralouphie~getallheaders.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-ramsey~uuid.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-react~promise.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-seld~jsonlint.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-seld~phar-utils.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~console.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~filesystem.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~finder.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-ctype.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-idn.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-intl-normalizer.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-mbstring.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php72.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php73.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~polyfill-php80.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~process.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-symfony~service-contracts.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-tedivm~jshrink.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-true~punycode.json from cache Reading /Users/wissem/Library/Caches/composer/repo/https---repo.packagist.org/provider-wikimedia~less.php.json from cache [304] https://repo.packagist.org/p2/colinmollenhour/credis.json [304] https://repo.packagist.org/p2/colinmollenhour/php-redis-session-abstract.json [304] https://repo.packagist.org/p2/composer/ca-bundle.json Downloading https://repo.packagist.org/p2/justinrainbow/json-schema.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-code.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-console.json if modified [304] https://repo.packagist.org/p2/composer/composer.json [304] https://repo.packagist.org/p2/composer/metadata-minifier.json [304] https://repo.packagist.org/p2/composer/semver.json [304] https://repo.packagist.org/p2/composer/spdx-licenses.json [304] https://repo.packagist.org/p2/composer/xdebug-handler.json [304] https://repo.packagist.org/p2/container-interop/container-interop.json [304] https://repo.packagist.org/p2/guzzlehttp/guzzle.json [304] https://repo.packagist.org/p2/guzzlehttp/promises.json [304] https://repo.packagist.org/p2/guzzlehttp/psr7.json Downloading https://repo.packagist.org/p2/laminas/laminas-crypt.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-diactoros.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-escaper.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-eventmanager.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-filter.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-form.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-http.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-hydrator.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-inputfilter.json if modified [304] https://repo.packagist.org/p2/justinrainbow/json-schema.json [304] https://repo.packagist.org/p2/laminas/laminas-code.json [304] https://repo.packagist.org/p2/laminas/laminas-console.json Downloading https://repo.packagist.org/p2/laminas/laminas-loader.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-mail.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-math.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-crypt.json [304] https://repo.packagist.org/p2/laminas/laminas-diactoros.json [304] https://repo.packagist.org/p2/laminas/laminas-escaper.json [304] https://repo.packagist.org/p2/laminas/laminas-eventmanager.json [304] https://repo.packagist.org/p2/laminas/laminas-filter.json [304] https://repo.packagist.org/p2/laminas/laminas-form.json [304] https://repo.packagist.org/p2/laminas/laminas-http.json [304] https://repo.packagist.org/p2/laminas/laminas-hydrator.json [304] https://repo.packagist.org/p2/laminas/laminas-inputfilter.json Downloading https://repo.packagist.org/p2/laminas/laminas-mime.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-mvc.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-psr7bridge.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-servicemanager.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-stdlib.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-uri.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-validator.json if modified Downloading https://repo.packagist.org/p2/laminas/laminas-zendframework-bridge.json if modified Downloading https://repo.packagist.org/p2/magento/zendframework1.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-loader.json [304] https://repo.packagist.org/p2/laminas/laminas-mail.json [304] https://repo.packagist.org/p2/laminas/laminas-math.json Downloading https://repo.packagist.org/p2/monolog/monolog.json if modified Downloading https://repo.packagist.org/p2/paragonie/random_compat.json if modified Downloading https://repo.packagist.org/p2/psr/container.json if modified [304] https://repo.packagist.org/p2/laminas/laminas-mime.json [304] https://repo.packagist.org/p2/laminas/laminas-mvc.json [304] https://repo.packagist.org/p2/laminas/laminas-psr7bridge.json [304] https://repo.packagist.org/p2/laminas/laminas-servicemanager.json [304] https://repo.packagist.org/p2/laminas/laminas-stdlib.json [304] https://repo.packagist.org/p2/laminas/laminas-uri.json [304] https://repo.packagist.org/p2/laminas/laminas-validator.json [304] https://repo.packagist.org/p2/laminas/laminas-zendframework-bridge.json [304] https://repo.packagist.org/p2/magento/zendframework1.json Downloading https://repo.packagist.org/p2/psr/http-message.json if modified Downloading https://repo.packagist.org/p2/psr/log.json if modified Downloading https://repo.packagist.org/p2/ralouphie/getallheaders.json if modified Downloading https://repo.packagist.org/p2/ramsey/uuid.json if modified Downloading https://repo.packagist.org/p2/react/promise.json if modified Downloading https://repo.packagist.org/p2/seld/jsonlint.json if modified Downloading https://repo.packagist.org/p2/seld/phar-utils.json if modified Downloading https://repo.packagist.org/p2/symfony/console.json if modified Downloading https://repo.packagist.org/p2/symfony/filesystem.json if modified [304] https://repo.packagist.org/p2/monolog/monolog.json [304] https://repo.packagist.org/p2/paragonie/random_compat.json [304] https://repo.packagist.org/p2/psr/container.json Downloading https://repo.packagist.org/p2/symfony/finder.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-ctype.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-idn.json if modified [304] https://repo.packagist.org/p2/psr/http-message.json [304] https://repo.packagist.org/p2/psr/log.json [304] https://repo.packagist.org/p2/ralouphie/getallheaders.json [304] https://repo.packagist.org/p2/ramsey/uuid.json [304] https://repo.packagist.org/p2/react/promise.json [304] https://repo.packagist.org/p2/seld/jsonlint.json [304] https://repo.packagist.org/p2/seld/phar-utils.json [304] https://repo.packagist.org/p2/symfony/console.json [304] https://repo.packagist.org/p2/symfony/filesystem.json Downloading https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-mbstring.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-php72.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-php73.json if modified Downloading https://repo.packagist.org/p2/symfony/polyfill-php80.json if modified Downloading https://repo.packagist.org/p2/symfony/process.json if modified Downloading https://repo.packagist.org/p2/symfony/service-contracts.json if modified Downloading https://repo.packagist.org/p2/tedivm/jshrink.json if modified Downloading https://repo.packagist.org/p2/true/punycode.json if modified [304] https://repo.packagist.org/p2/symfony/finder.json [304] https://repo.packagist.org/p2/symfony/polyfill-ctype.json [304] https://repo.packagist.org/p2/symfony/polyfill-intl-idn.json Downloading https://repo.packagist.org/p2/wikimedia/less.php.json if modified [304] https://repo.packagist.org/p2/symfony/polyfill-intl-normalizer.json [304] https://repo.packagist.org/p2/symfony/polyfill-mbstring.json [304] https://repo.packagist.org/p2/symfony/polyfill-php72.json [304] https://repo.packagist.org/p2/symfony/polyfill-php73.json [304] https://repo.packagist.org/p2/symfony/polyfill-php80.json [304] https://repo.packagist.org/p2/symfony/process.json [304] https://repo.packagist.org/p2/symfony/service-contracts.json [304] https://repo.packagist.org/p2/tedivm/jshrink.json [304] https://repo.packagist.org/p2/true/punycode.json [304] https://repo.packagist.org/p2/wikimedia/less.php.json Updating dependencies Generating rules Resolving dependencies through SAT Looking at all rules. Dependency resolution completed in 0.000 seconds Analyzed 163 packages to resolve dependencies Analyzed 360 rules to resolve dependencies Nothing to modify in lock file Installing dependencies from lock file (including require-dev) Nothing to install, update or remove Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead. Package laminas/laminas-console is abandoned, you should avoid using it. Use laminas/laminas-cli instead. Generating autoload files 34 packages you are using are looking for funding. Use the `composer fund` command to find out more! ```

Looking at the plugin code, I can see both install and update events are using the same method. So maybe this also needs to be adjusted so it detects things like composer update nothing or composer update --lock.

cweagans commented 1 year ago

This doesn't happen in main anymore.