apigee / apigee-devportal-kickstart-drupal

A fast demo and starting point for Apigee Developer Portals for Drupal
https://www.drupal.org/project/apigee_devportal_kickstart
GNU General Public License v2.0
26 stars 34 forks source link

Composer skipping patches #353

Closed ugintl closed 4 years ago

ugintl commented 4 years ago

I know that it is not a bug in your distribution, but I am very frustrated with this error. It has been many months since I am having this problem. I have searched a lot, but did not get any solution.

Whenever I try to download a drupal 8 distribution which has patches, the patches do not apply and composer skips them with error "Could not apply patch! Skipping"

I am using Composer 1.10.1 PHP 7.2

cnovak commented 4 years ago

This could be because some patches are already installed into the codebase, so they fail to be patched again. Can you give the output on what patches are failing? It could be our fault by having outdated patches in our project, so could be a bug on our side! I just ran through an install using composer create-project apigee/devportal-kickstart-project:8.x-dev MY_PROJECT in a temp dir, and I did not see any patches being applied, or failing.

Also, we upgraded our Kickstart Composer template which is updated to use the latest Drupal 8 Composer project recommendations. See our docs for information on how to move to our latest Kickstart Composer template.

ugintl commented 4 years ago

This is the whole thing

D:\drupal\distributions>composer create-project apigee/devportal-kickstart-project:8.x-dev Apigee --no-interaction
Installing apigee/devportal-kickstart-project (8.x-dev 6266932b07abe4c23a746a7e9414c2fcf536bee9)
  - Installing apigee/devportal-kickstart-project (8.x-dev 6266932): Cloning 6266932b07 from cache
Created project in Apigee
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 132 installs, 0 updates, 0 removals
  - Installing composer/installers (v1.9.0): Downloading (100%)
  - Installing cweagans/composer-patches (1.6.7): Loading from cache
No patches supplied.
Gathering patches for dependencies. This might take a minute.
  - Installing composer/semver (1.5.1): Downloading (100%)
  - Installing drupal-composer/drupal-scaffold (2.6.1): Loading from cache
  - Installing psr/http-message (1.0.1): Loading from cache
  - Installing pear/pear_exception (v1.0.1): Loading from cache
  - Installing pear/console_getopt (v1.4.3): Loading from cache
  - Installing pear/pear-core-minimal (v1.10.10): Loading from cache
  - Installing pear/archive_tar (1.4.9): Loading from cache
  - Installing psr/log (1.1.3): Downloading (100%)
  - Installing symfony/polyfill-ctype (v1.15.0): Downloading (100%)
  - Installing symfony/polyfill-mbstring (v1.15.0): Downloading (100%)
  - Installing symfony/polyfill-php72 (v1.15.0): Downloading (100%)
  - Installing symfony/polyfill-intl-idn (v1.15.0): Downloading (100%)
  - Installing symfony/var-dumper (v4.4.7): Downloading (100%)
  - Installing symfony/debug (v4.4.7): Downloading (100%)
  - Installing psr/container (1.0.0): Loading from cache
  - Installing symfony/polyfill-util (v1.15.0): Downloading (100%)
  - Installing symfony/polyfill-php56 (v1.15.0): Downloading (100%)
  - Installing paragonie/random_compat (v9.99.99): Loading from cache
  - Installing symfony/polyfill-php70 (v1.15.0): Downloading (100%)
  - Installing symfony/http-foundation (v3.4.39): Downloading (100%)
  - Installing symfony/event-dispatcher (v3.4.39): Downloading (100%)
  - Installing symfony/http-kernel (v3.4.39): Downloading (100%)
  - Installing asm89/stack-cors (1.3.0): Downloading (100%)
  - Installing symfony/psr-http-message-bridge (v1.2.0): Loading from cache
  - Installing masterminds/html5 (2.7.0): Loading from cache
  - Installing doctrine/lexer (1.0.2): Loading from cache
  - Installing egulias/email-validator (2.1.17): Downloading (100%)
  - Installing stack/builder (v1.0.5): Loading from cache
  - Installing easyrdf/easyrdf (0.9.1): Loading from cache
  - Installing symfony/routing (v3.4.39): Downloading (100%)
  - Installing symfony-cmf/routing (1.4.1): Loading from cache
  - Installing ralouphie/getallheaders (3.0.3): Loading from cache
  - Installing guzzlehttp/psr7 (1.6.1): Loading from cache
  - Installing guzzlehttp/promises (v1.3.1): Loading from cache
  - Installing guzzlehttp/guzzle (6.5.2): Downloading (100%)
  - Installing doctrine/annotations (1.10.1): Downloading (100%)
  - Installing doctrine/reflection (1.2.1): Downloading (100%)
  - Installing doctrine/event-manager (1.1.0): Loading from cache
  - Installing doctrine/collections (1.6.4): Loading from cache
  - Installing doctrine/cache (1.10.0): Loading from cache
  - Installing doctrine/persistence (1.3.7): Downloading (100%)
  - Installing doctrine/inflector (1.3.1): Downloading (100%)
  - Installing doctrine/common (2.12.0): Downloading (100%)
  - Installing twig/twig (v1.42.5): Downloading (100%)
  - Installing typo3/phar-stream-wrapper (v3.1.4): Downloading (100%)
  - Installing symfony/yaml (v3.4.39): Downloading (100%)
  - Installing symfony/polyfill-iconv (v1.15.0): Downloading (100%)
  - Installing symfony/process (v3.4.39): Downloading (100%)
  - Installing symfony/translation (v3.4.39): Downloading (100%)
  - Installing symfony/validator (v3.4.39): Downloading (100%)
  - Installing symfony/serializer (v3.4.39): Downloading (100%)
  - Installing symfony/dependency-injection (v3.4.39): Downloading (100%)
  - Installing symfony/console (v3.4.39): Downloading (100%)
  - Installing symfony/class-loader (v3.4.39): Downloading (100%)
  - Installing zendframework/zend-diactoros (1.8.7): Loading from cache
  - Installing zendframework/zend-stdlib (3.2.1): Loading from cache
  - Installing zendframework/zend-escaper (2.6.1): Loading from cache
  - Installing zendframework/zend-feed (2.12.0): Loading from cache
  - Installing drupal/core (8.8.5): Downloading (100%)
  - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2018-07-05/2943172-kernel-test-base-3.patch (https://www.drupal.org/project/drupal/issues/2943172)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2018-07-05/2943172-kernel-test-base-3.patch

  - Installing webmozart/assert (1.7.0): Downloading (100%)
  - Installing phpdocumentor/reflection-common (2.0.0): Loading from cache
  - Installing phpdocumentor/type-resolver (1.0.1): Loading from cache
  - Installing phpdocumentor/reflection-docblock (4.3.4): Downloading (100%)
  - Installing drupal/components (1.1.0): Downloading (100%)
  - Installing drupal/radix (4.8.0): Downloading (100%)
  - Installing drupal/token (1.6.0): Downloading (100%)
  - Installing drupal/ctools (3.4.0): Downloading (100%)
  - Installing drupal/pathauto (1.6.0): Downloading (100%)
  - Installing drupal/entity_reference_revisions (1.8.0): Downloading (100%)
  - Installing drupal/paragraphs (1.11.0): Downloading (100%)
  - Installing drupal/fontawesome (2.15.0): Downloading (100%)
  - Installing drupal/email_registration (1.0.0): Downloading (100%)
  - Installing drupal/default_content (1.0.0-alpha8): Downloading (100%)
  - Installing drupal/better_exposed_filters (3.0.0-alpha6): Loading from cache
  - Applying patches for drupal/better_exposed_filters
    https://www.drupal.org/files/issues/2018-10-05/bef-summary-attributes-3001967-4.patch (Fix issue with #summary_details introduced in Drupal 8.6.x)
   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issues/2018-10-05/bef-summary-attributes-3001967-4.patch

  - Installing php-http/promise (v1.0.0): Loading from cache
  - Installing php-http/httplug (v1.1.0): Loading from cache
  - Installing php-http/guzzle6-adapter (v1.1.1): Downloading (100%)
  - Installing firebase/php-jwt (v5.2.0): Downloading (100%)
  - Installing symfony/options-resolver (v4.4.7): Downloading (100%)
  - Installing clue/stream-filter (v1.4.1): Loading from cache
  - Installing php-http/message-factory (v1.0.2): Loading from cache
  - Installing php-http/message (1.8.0): Loading from cache
  - Installing php-http/client-common (1.10.0): Downloading (100%)
  - Installing symfony/inflector (v4.4.7): Downloading (100%)
  - Installing symfony/property-info (v4.4.7): Downloading (100%)
  - Installing symfony/property-access (v4.4.7): Downloading (100%)
  - Installing php-http/discovery (1.7.4): Downloading (100%)
  - Installing league/period (3.4.0): Downloading (100%)
  - Installing fightbulc/moment (1.32.1): Downloading (100%)
  - Installing apigee/apigee-client-php (2.0.4): Downloading (100%)
  - Installing drupal/key (1.12.0): Downloading (100%)
  - Installing drupal/entity (1.0.0): Downloading (100%)
  - Installing drupal/apigee_edge (1.8.0): Downloading (100%)
  - Installing drupal/file_link (1.7.0): Downloading (failed)
Downloading (100%)
  - Installing drupal/apigee_api_catalog (1.1.0): Downloading (100%)
  - Installing drupal/admin_toolbar (2.2.0): Downloading (100%)
  - Installing drupal/adminimal_admin_toolbar (1.10.0): Downloading (100%)
  - Installing apigee/apigee_devportal_kickstart (1.11.0): Downloading (100%)
  - Installing commerceguys/intl (v1.0.5): Downloading (100%)
  - Installing drupal/requirement (1.0.0): Downloading (100%)
  - Installing drupal/apigee_m10n (1.4.0): Downloading (100%)
  - Installing drupal/state_machine (1.0.0): Downloading (100%)
  - Installing drupal/profile (1.1.0): Downloading (100%)
  - Installing drupal/inline_entity_form (1.0.0-rc3): Downloading (100%)
  - Installing commerceguys/addressing (v1.0.7): Downloading (100%)
  - Installing drupal/address (1.8.0): Downloading (100%)
  - Installing drupal/commerce (2.17.0): Downloading (100%)
  - Installing webmozart/path-util (2.3.0): Loading from cache
  - Installing webflo/drupal-finder (1.2.0): Loading from cache
  - Installing symfony/finder (v4.4.7): Downloading (100%)
  - Installing nikic/php-parser (v4.3.0): Loading from cache
  - Installing dnoegel/php-xdg-base-dir (v0.1.1): Loading from cache
  - Installing psy/psysh (v0.10.3): Downloading (100%)
  - Installing container-interop/container-interop (1.2.0): Loading from cache
  - Installing league/container (2.4.1): Loading from cache
  - Installing dflydev/dot-access-data (v1.1.0): Loading from cache
  - Installing grasmash/yaml-expander (1.4.0): Loading from cache
  - Installing grasmash/expander (1.0.0): Loading from cache
  - Installing consolidation/config (1.2.1): Loading from cache
  - Installing consolidation/site-alias (3.0.0): Loading from cache
  - Installing consolidation/site-process (2.1.0): Loading from cache
  - Installing symfony/filesystem (v4.4.7): Downloading (100%)
  - Installing consolidation/self-update (1.1.5): Loading from cache
  - Installing consolidation/output-formatters (3.5.0): Loading from cache
  - Installing consolidation/log (1.1.1): Loading from cache
  - Installing consolidation/annotated-command (2.12.0): Loading from cache
  - Installing consolidation/robo (1.4.12): Downloading (100%)
  - Installing consolidation/filter-via-dot-access-data (1.0.0): Loading from cache
  - Installing chi-teck/drupal-code-generator (1.31.0): Loading from cache
  - Installing drush/drush (9.7.2): Downloading (100%)
pear/archive_tar suggests installing ext-xz (Lzma2 compression support.)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.)
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
easyrdf/easyrdf suggests installing ml/json-ld (~1.0)
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
guzzlehttp/psr7 suggests installing zendframework/zend-httphandlerrunner (Emit PSR-7 responses)
guzzlehttp/guzzle suggests installing ext-intl (Required for Internationalized Domain Name (IDN) support)
doctrine/cache suggests installing alcaeus/mongo-php-adapter (Required to use legacy MongoDB driver)
symfony/translation suggests installing symfony/config
symfony/validator suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/validator suggests installing symfony/intl
symfony/validator suggests installing symfony/config
symfony/validator suggests installing symfony/expression-language (For using the Expression validator)
symfony/serializer suggests installing psr/cache-implementation (For using the metadata cache.)
symfony/serializer suggests installing symfony/config (For using the XML mapping loader.)
symfony/dependency-injection suggests installing symfony/config
symfony/dependency-injection suggests installing symfony/expression-language (For using expressions in service container configuration)
symfony/dependency-injection suggests installing symfony/proxy-manager-bridge (Generate service proxies to lazy load them)
symfony/console suggests installing symfony/lock
symfony/class-loader suggests installing symfony/polyfill-apcu (For using ApcClassLoader on HHVM)
zendframework/zend-feed suggests installing zendframework/zend-cache (Zend\Cache component, for optionally caching feeds between requests)
zendframework/zend-feed suggests installing zendframework/zend-db (Zend\Db component, for use with PubSubHubbub)
zendframework/zend-feed suggests installing zendframework/zend-http (Zend\Http for PubSubHubbub, and optionally for use with Zend\Feed\Reader)
zendframework/zend-feed suggests installing zendframework/zend-servicemanager (Zend\ServiceManager component, for easily extending ExtensionManager implementations)
zendframework/zend-feed suggests installing zendframework/zend-validator (Zend\Validator component, for validating email addresses used in Atom feeds and entries when using the Writer subcomponent)
drupal/paragraphs suggests installing drupal/entity_browser (Recommended for an improved user experience when using the Paragraphs library module)
php-http/message suggests installing slim/slim (Used with Slim Framework PSR-7 implementation)
php-http/client-common suggests installing php-http/logger-plugin (PSR-3 Logger plugin)
php-http/client-common suggests installing php-http/cache-plugin (PSR-6 Cache plugin)
php-http/client-common suggests installing php-http/stopwatch-plugin (Symfony Stopwatch plugin)
symfony/property-info suggests installing psr/cache-implementation (To cache results)
symfony/property-info suggests installing symfony/doctrine-bridge (To use Doctrine metadata)
symfony/property-access suggests installing psr/cache-implementation (To cache access methods.)
php-http/discovery suggests installing puli/composer-plugin (Sets up Puli which is recommended for Discovery to work. Check http://docs.php-http.org/en/latest/discovery.html for more details.)
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
consolidation/robo suggests installing henrikbjorn/lurker (For monitoring filesystem changes in taskWatch)
consolidation/robo suggests installing patchwork/jsqueeze (For minifying JS files in taskMinify)
consolidation/robo suggests installing natxet/CssMin (For minifying CSS files in taskMinify)
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package zendframework/zend-stdlib is abandoned, you should avoid using it. Use laminas/laminas-stdlib instead.
Package zendframework/zend-escaper is abandoned, you should avoid using it. Use laminas/laminas-escaper instead.
Package zendframework/zend-feed is abandoned, you should avoid using it. Use laminas/laminas-feed instead.
Package container-interop/container-interop is abandoned, you should avoid using it. Use psr/container instead.
Writing lock file
Generating autoload files
  - .csslintrc (https://git.drupalcode.org/project/drupal/raw/8.8.5/.csslintrc): Downloading (100%)
  - .editorconfig (https://git.drupalcode.org/project/drupal/raw/8.8.5/.editorconfig): Downloading (100%)
  - .eslintignore (https://git.drupalcode.org/project/drupal/raw/8.8.5/.eslintignore): Downloading (100%)
  - .eslintrc.json (https://git.drupalcode.org/project/drupal/raw/8.8.5/.eslintrc.json): Downloading (100%)
  - .gitattributes (https://git.drupalcode.org/project/drupal/raw/8.8.5/.gitattributes): Downloading (100%)
  - .ht.router.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/.ht.router.php): Downloading (100%)
  - .htaccess (https://git.drupalcode.org/project/drupal/raw/8.8.5/.htaccess): Downloading (100%)
  - index.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/index.php): Downloading (100%)
  - robots.txt (https://git.drupalcode.org/project/drupal/raw/8.8.5/robots.txt): Downloading (100%)
  - sites/default/default.services.yml (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/default/default.services.yml): Downloading (100%)
  - sites/default/default.settings.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/default/default.settings.php): Downloading (100%)
  - sites/development.services.yml (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/development.services.yml): Downloading (100%)
  - sites/example.settings.local.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/example.settings.local.php): Downloading (100%)
  - sites/example.sites.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/example.sites.php): Downloading (Downloading (100%)
  - update.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/update.php): Downloading (100%)
  - web.config (https://git.drupalcode.org/project/drupal/raw/8.8.5/web.config): Downloading (100%)
> DrupalComposer\DrupalScaffold\Plugin::scaffold
  - .csslintrc (https://git.drupalcode.org/project/drupal/raw/8.8.5/.csslintrc): Downloading (100%)
  - .editorconfig (https://git.drupalcode.org/project/drupal/raw/8.8.5/.editorconfig): Downloading (100%)
  - .eslintignore (https://git.drupalcode.org/project/drupal/raw/8.8.5/.eslintignore): Downloading (100%)
  - .eslintrc.json (https://git.drupalcode.org/project/drupal/raw/8.8.5/.eslintrc.json): Downloading (100%)
  - .gitattributes (https://git.drupalcode.org/project/drupal/raw/8.8.5/.gitattributes): Downloading (100%)
  - .ht.router.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/.ht.router.php): Downloading (100%)
  - .htaccess (https://git.drupalcode.org/project/drupal/raw/8.8.5/.htaccess): Downloading (100%)
  - index.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/index.php): Downloading (100%)
  - robots.txt (https://git.drupalcode.org/project/drupal/raw/8.8.5/robots.txt): Downloading (100%)
  - sites/default/default.services.yml (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/default/default.services.yml): Downloading (100%)
  - sites/default/default.settings.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/default/default.settings.php): Downloading (100%)
  - sites/development.services.yml (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/development.services.yml): Downloading (100%)
  - sites/example.settings.local.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/example.settings.local.php): Downloading (100%)
  - sites/example.sites.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/sites/example.sites.php): Downloading (Downloading (100%)
  - update.php (https://git.drupalcode.org/project/drupal/raw/8.8.5/update.php): Downloading (100%)
  - web.config (https://git.drupalcode.org/project/drupal/raw/8.8.5/web.config): Downloading (100%)
ugintl commented 4 years ago

by the way I am having this problem in other distributions as well like Varbase etc

cnovak commented 4 years ago

I did a composer run and I do see patches do apply fine for me:

- Installing drupal/better_exposed_filters (3.0.0-alpha6): Loading from cache
  - Applying patches for drupal/better_exposed_filters
    https://www.drupal.org/files/issues/2018-10-05/bef-summary-attributes-3001967-4.patch (Fix issue with #summary_details introduced in Drupal 8.6.x)

It may be that you don't have patch installed? Try running composer install -vvv to see any problems.

I will close this since I am not sure how else we can help besides above but feel free to comment back. You could try adding an issue to https://github.com/cweagans/composer-patches project.

cnovak commented 4 years ago

@ugintl wanted to let you know that we released a new composer project template which you may want to use, check out our docs about the new composer template.

ugintl commented 4 years ago

@cnovak The problem was on my side. My problem is solved finally. I did 2 things. 1. Added C:\Program Files\Git\usr\bin to my system path. 2. Used cmd as a normal user. Previously I was using it as administrator.

cnovak commented 4 years ago

Great to hear you found the issue! I noticed that missing command line tools were being hidden on normal output so can be tricky to figure out.

Prekshapatel commented 4 years ago

Hi all,

I have a Could not apply patch! Skipping. issue while trying to update the drupal core. That patch is mentioned in GOVCMS installation profile composer.json. Issue is patch is already applied for panelizer module and auto generated in (modules/contrib/panelizer/PATCHES.txt) . And there is a project composer file which is outside docroot using which I am trying to update drupal core. There is another patch mentioned in project's composer.json file for the panelizer module. So whenever I try to update the drupal core, panelizer module is getting deleted and trying to apply both the patches one mentioned in GOVCMS composer.json and one mentioned in project's composer.json file. I tried to remove the patch mentioned in GOVCMS composer.json file but still the issue is ther. Can any one tell me how could I remove the patch completely from GOVCMS composer.json, auto generated by cweagans/composer-patches in modules/contrib/panelizer/PATCHES.txt etc?