acquia / lightning-project

A Composer-based installer for the Lightning distribution of Drupal 8. Support ended on November 2, 2021 and this project is no longer maintained.
133 stars 60 forks source link

Trouble applying patches on Windows #113

Closed gurusonwheels closed 4 years ago

gurusonwheels commented 4 years ago

i have tried and tried to install . keep getting this

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [ --repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progr ess] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<pack age>] [] []

im on windows run command composer create-project acquia/lightning-project MY_PROJECT drupal 8.8.1

how do i get around this ?

phenaproxima commented 4 years ago

I gave this a shot on my machine (macOS 10.15, git 2.20.1), and did not run into this. Here's the output I got when drupal/core was installed:

Do you have any more output you can send? Maybe try running composer create-project with the -vvv flag?

gurusonwheels commented 4 years ago
 Extracting archiveNo patches found for symfony/class-loader.
Patches already gathered. Skipping
  - Installing drupal/core (8.8.1): Reading C:/Users/Administrator/AppData/Local/Composer/files/drupal/
core/1e1fbaef32ba2bcc0e6bf56ad32307123eecf91a.zip from cache
Loading from cache
 Extracting archive  - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch (2869592 - Disabled updat
e module shouldn't produce a status report warning)
Downloading https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch
patch "-p1" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e270c8
aabf39.patch"
Executing command (CWD): patch "-p1" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e270c8aabf39.patch"
'patch' is not recognized as an internal or external command,
operable program or batch file.

patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e270c8
aabf39.patch"
Executing command (CWD): patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e270c8aabf39.patch"
'patch' is not recognized as an internal or external command,
operable program or batch file.

patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e270c8
aabf39.patch"
Executing command (CWD): patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e270c8aabf39.patch"
'patch' is not recognized as an internal or external command,
operable program or batch file.

patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e270c8
aabf39.patch"
Executing command (CWD): patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e270c8aabf39.patch"
'patch' is not recognized as an internal or external command,
operable program or batch file.

   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issu
es/2869592-remove-update-warning-7.patch

  [Exception]
  Cannot apply patch 2869592 - Disabled update module shouldn't produce a status report warning (htt
  ps://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch)!

Exception trace:
 () at C:\guruonw\MY_PROJECT\vendor\cweagans\composer-patches\src\Patches.php:320
 cweagans\Composer\Patches->postInstall() at n/a:n/a
 call_user_func() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher
/EventDispatcher.php:176
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://C:/ProgramData/ComposerSetup/bin/comp
oser.phar/src/Composer/EventDispatcher/EventDispatcher.php:116
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar://C:/ProgramData/ComposerSetu
p/bin/composer.phar/src/Composer/Installer.php:622
 Composer\Installer->doInstall() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/
Installer.php:229
 Composer\Installer->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Comman
d/CreateProjectCommand.php:195
 Composer\Command\CreateProjectCommand->installProject() at phar://C:/ProgramData/ComposerSetup/bin/com
poser.phar/src/Composer/Command/CreateProjectCommand.php:145
 Composer\Command\CreateProjectCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/compo
ser.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.pha
r/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/
symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/
src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo
ser:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [
--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progr
ess] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<pack
age>] [<directory>] [<version>]
phenaproxima commented 4 years ago

Thanks, that's helpful. It looks like the error is that you do not have the "patch" program installed, or in your PATH:

patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e270c8 aabf39.patch" Executing command (CWD): patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App Data\Local\Temp\1/5e270c8aabf39.patch" 'patch' is not recognized as an internal or external command, operable program or batch file.

If you correct this (you should be able to run patch --version at the command line), I think you will have a different outcome.

phenaproxima commented 4 years ago

patch, for the record, is part of the patchutils suite, which is a GNU package. I know it has been ported to Windows, but I'm not a Windows user so I'm not sure what a reliable installer for it would be. If you're using Cygwin or the Linux subsystem for Windows 10, I believe either of these would include patch. Or at the very least, they would provide the appropriate infrastructure to install it.

gurusonwheels commented 4 years ago

downloaded patch from https://sourceforge.net/projects/gnuwin32/files/patch/2.5.9-7/patch-2.5.9-7-setup.exe/download?use_mirror=ayera&download=

added to path

run again

got very different results with -vvv but same otherwise

Executing command (CWD): patch "-p1" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e27183d71915.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e27183
d71915.patch"
Executing command (CWD): patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e27183d71915.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e27183
d71915.patch"
Executing command (CWD): patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e27183d71915.patch"
patching file modules/system/system.install

Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e27183
d71915.patch"
Executing command (CWD): patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e27183d71915.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issu
es/2869592-remove-update-warning-7.patch

  [Exception]
  Cannot apply patch 2869592 - Disabled update module shouldn't produce a status report warning (htt
  ps://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch)!

Exception trace:
 () at C:\guruonw\MY_PROJECT\vendor\cweagans\composer-patches\src\Patches.php:320
 cweagans\Composer\Patches->postInstall() at n/a:n/a
 call_user_func() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher
/EventDispatcher.php:176
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://C:/ProgramData/ComposerSetup/bin/comp
oser.phar/src/Composer/EventDispatcher/EventDispatcher.php:116
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar://C:/ProgramData/ComposerSetu
p/bin/composer.phar/src/Composer/Installer.php:622
 Composer\Installer->doInstall() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/
Installer.php:229
 Composer\Installer->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Comman
d/CreateProjectCommand.php:195
 Composer\Command\CreateProjectCommand->installProject() at phar://C:/ProgramData/ComposerSetup/bin/com
poser.phar/src/Composer/Command/CreateProjectCommand.php:145
 Composer\Command\CreateProjectCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/compo
ser.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.pha
r/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/
symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/
src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo
ser:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [
--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progr
ess] [--no-secure-http] [--keep-vcs] [--remove-vcs] [--no-install] [--ignore-platform-reqs] [--] [<pack
age>] [<directory>] [<version>]
phenaproxima commented 4 years ago

Hmmm, that's unfortunate. Maybe these patches can only be applied with git apply. So we have two options here:

1) Ensure that git is installed, and in your PATH (testable with git --version). I believe, if it's installed, cweagans/composer-patches -- the thing that actually does the patching -- will use it instead of patch. 2) I could reformulate a new version of the broken patch that doesn't have the header, and then you could apply it to your project specifically with patches-ignore (see https://github.com/cweagans/composer-patches#ignoring-patches for more info about that).

gurusonwheels commented 4 years ago

git --version that returns git version 2.25.0.windows.

i notice the paths above look strange with a mixture or forward and backslashes ... could that be the problem . since your script is maybe formatted for linux/unix

C:\Users\ADMINI~1\AppData\Local\Temp\1/5e27183d71915.patch

not a programmer so im trying my best to follow you .

gurusonwheels commented 4 years ago

also on the patch for windows site it says

On MS-Windows, the patchfile must be a text file, i.e. CR-LF must be used as line endings. A file with LF may give the error: "Assertion failed, hunk, file patch.c, line 343," unless the option '--binary' is given.

phenaproxima commented 4 years ago

You're doing an admirable job :)

I'm not sure the paths are the problem, although it's certainly possible; I would imagine that, on Windows, git knows to convert forward slashes to backslahes when trying to resolve patch targets.

I do see an interesting thing on my end; although running composer create-project applies the patch without complaint, it fails when I try to apply the patch to Drupal core directly. So maybe the patch needs to be rerolled. I will need to investigate a little further!

gurusonwheels commented 4 years ago

ok

gurusonwheels commented 4 years ago

You're doing an admirable job :)

I'm not sure the paths are the problem, although it's certainly possible; I would imagine that, on Windows, git knows to convert forward slashes to backslahes when trying to resolve patch targets.

I do see an interesting thing on my end; although running composer create-project applies the patch without complaint, it fails when I try to apply the patch to Drupal core directly. So maybe the patch needs to be rerolled. I will need to investigate a little further!

seems according to this doc windows and git do have problems with forward and backslashes ...

https://brendanforster.com/notes/fixing-invalid-git-paths-on-windows/ maybe im reading into it too much . ill let you look into it ..

thanks for your help

gurusonwheels commented 4 years ago

old issue seems ..
https://github.com/squizlabs/PHP_CodeSniffer/issues/637

are there a way to add this --binary to the patch calls for windows to see if this is the problem .

gurusonwheels commented 4 years ago

any progress?

phenaproxima commented 4 years ago

None yet, but I unfortunately don't have a ton of time to devote to this. I don't think there is a way to use --binary, at least not directly; that might be a thing that should be added to cweagans/composer-patches.

phenaproxima commented 4 years ago

What I'm seeing here is that the patch does not apply to Drupal core 8.8.x or 8.8.1 (it needs to be rerolled). Yet, our CI builds are saying that the patch does apply against those versions. I'm calling in some help to see why this discrepancy exists.

phenaproxima commented 4 years ago

It's still not clear what's going on, but an interesting thing I'm seeing is that patch is being invoked with the -p1 option, and it seems to be unable to find the file to patch. Maybe try the following:

composer create-project acquia/lightning-project --no-install myproject
cd myproject

Then, merge the following into the composer.json file:

"extra": {
  "patchLevel": {
      "drupal/core": "-p2"
    }
  }
}

And then run composer install -vvv. What effect does that have?

gurusonwheels commented 4 years ago
C:\guruonw>composer create-project acquia/lightning-project --no-install myproject
Installing acquia/lightning-project (8.7.1)
  - Installing acquia/lightning-project (8.7.1): Loading from cache
Created project in myproject
> rm -r -f .travis.yml behat.yml .travis-ci
'rm' is not recognized as an internal or external command,
operable program or batch file.
Script rm -r -f .travis.yml behat.yml .travis-ci handling the post-create-project-cmd event returned wi
th error code 1

C:\guruonw>
phenaproxima commented 4 years ago

We don't officially support Windows, which is why you're running into that. Just go ahead and delete those files manually.

gurusonwheels commented 4 years ago
No patches found for symfony/console.
Patches already gathered. Skipping
  - Installing symfony/class-loader (v3.4.37): Reading C:/Users/Administrator/AppData/Local/Composer/fi
les/symfony/class-loader/6d7431b9452f31bfae251d0ffbf9852d7998e75c.zip from cache
Loading from cache
 Extracting archive    REASON: drupal/core 8.8.1 requires symfony/class-loader ~3.4.0 -> satisfiable by
 symfony/class-loader[3.4.x-dev, v3.4.0, v3.4.0-BETA1, v3.4.0-BETA2, v3.4.0-BETA3, v3.4.0-BETA4, v3.4.0
-RC1, v3.4.0-RC2, v3.4.1, v3.4.10, v3.4.11, v3.4.12, v3.4.13, v3.4.14, v3.4.15, v3.4.16, v3.4.17, v3.4.
18, v3.4.19, v3.4.2, v3.4.20, v3.4.21, v3.4.22, v3.4.23, v3.4.24, v3.4.25, v3.4.26, v3.4.27, v3.4.28, v
3.4.29, v3.4.3, v3.4.30, v3.4.31, v3.4.32, v3.4.33, v3.4.34, v3.4.35, v3.4.36, v3.4.37, v3.4.4, v3.4.5,
 v3.4.6, v3.4.7, v3.4.8, v3.4.9].

No patches found for symfony/class-loader.
Patches already gathered. Skipping
  - Installing drupal/core (8.8.1): Reading C:/Users/Administrator/AppData/Local/Composer/files/drupal/
core/1e1fbaef32ba2bcc0e6bf56ad32307123eecf91a.zip from cache
Loading from cache
 Extracting archive    REASON: acquia/lightning 4.1.1 requires drupal/core ~8.8.1 -> satisfiable by dru
pal/core[8.8.1, 8.8.x-dev].

  - Applying patches for drupal/core
    https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch (2869592 - Disabled updat
e module shouldn't produce a status report warning)
Downloading https://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch
patch "-p1" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e28728
6cdc80.patch"
Executing command (CWD): patch "-p1" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e287286cdc80.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e28728
6cdc80.patch"
Executing command (CWD): patch "-p0" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e287286cdc80.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e28728
6cdc80.patch"
Executing command (CWD): patch "-p2" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e287286cdc80.patch"
patching file modules/system/system.install

Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\AppData\Local\Temp\1/5e28728
6cdc80.patch"
Executing command (CWD): patch "-p4" --no-backup-if-mismatch -d "docroot/core" < "C:\Users\ADMINI~1\App
Data\Local\Temp\1/5e287286cdc80.patch"
can't find file to patch at input line 14
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|From c7b3da0db33803b01f3813797283821072288b94 Mon Sep 17 00:00:00 2001
|From: Jakob Perry <japerry@45640.no-reply.drupal.org>
|Date: Mon, 22 May 2017 14:04:49 -0400
|Subject: [PATCH] Issue 2869592
|
|---
| core/modules/system/system.install | 2 +-
| 1 file changed, 1 insertion(+), 1 deletion(-)
|
|diff --git a/core/modules/system/system.install b/core/modules/system/system.install
|index 56ce685..5daf6a8 100644
|--- a/core/modules/system/system.install
|+++ b/core/modules/system/system.install
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issu
es/2869592-remove-update-warning-7.patch

  [Exception]
  Cannot apply patch 2869592 - Disabled update module shouldn't produce a status report warning (htt
  ps://www.drupal.org/files/issues/2869592-remove-update-warning-7.patch)!

Exception trace:
 () at C:\guruonw\myproject\vendor\cweagans\composer-patches\src\Patches.php:320
 cweagans\Composer\Patches->postInstall() at n/a:n/a
 call_user_func() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher
/EventDispatcher.php:176
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://C:/ProgramData/ComposerSetup/bin/comp
oser.phar/src/Composer/EventDispatcher/EventDispatcher.php:116
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar://C:/ProgramData/ComposerSetu
p/bin/composer.phar/src/Composer/Installer.php:622
 Composer\Installer->doInstall() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/
Installer.php:229
 Composer\Installer->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Comman
d/InstallCommand.php:122
 Composer\Command\InstallCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/ve
ndor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/compo
ser.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.pha
r/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/
symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/
src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo
ser:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no
-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloa
der] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

C:\guruonw\myproject>

darn . was hoping it would work ......

gurusonwheels commented 4 years ago

maybe i did not merge correctly .

{
    "name": "acquia/lightning-project",
    "type": "project",
    "description": "Project template for Drupal 8 sites built with the Lightning distribution.",
    "license": "GPL-2.0-or-later",
    "require": {
        "acquia/lightning": "^4.0",
        "cweagans/composer-patches": "^1.6.0",
        "drupal-composer/drupal-scaffold": "^2.0.0"
    },
    "require-dev": {
        "drush/drush": "^9.0"
    },
    "config": {
        "process-timeout": 0
    },
    "extra": {
"patchLevel": [ 
"drupal/core",
"-p2"
],
        "composer-exit-on-patch-failure": true,
        "enable-patching": true,
        "installer-paths": {
            "docroot/core": [
                "type:drupal-core"
            ],
            "docroot/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "docroot/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "docroot/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "docroot/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ]
    },
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "assets": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "dev": {
            "type": "github",
            "url": "https://github.com/acquia/lightning-dev",
            "no-api": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-install-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-update-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-create-project-cmd": "rm -r -f .travis.yml behat.yml .travis-ci",
        "nuke": "rm -r -f docroot/modules/contrib docroot/profiles/contrib/lightning vendor composer.lock",
        "quick-start": [
            "composer install",
            "php docroot/core/scripts/drupal quick-start lightning --no-interaction"
        ]
    }
}
phenaproxima commented 4 years ago

I'm not sure how Composer didn't reject the file out of hand; that doesn't look like valid JSON to me. It should be like so:

"extra": {
  "patchLevel": {
    "drupal/core": "-p2"
  }
}

There is a big difference between square brackets ([]) and curly braces ({}) in JSON; for this piece of info, you need to use curly braces.

gurusonwheels commented 4 years ago

i get this ..

C:\guruonw\myproject>composer install -vvv

[Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 22: "composer-exit-on-pa... -------------------^ Expected one of: 'EOF', '}', ',', ']'

Exception trace: () at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Json/JsonFile.php:304 Composer\Json\JsonFile::validateSyntax() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/ Composer/Json/JsonFile.php:159 Composer\Json\JsonFile->validateSchema() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/ Composer/Factory.php:290 Composer\Factory->createComposer() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Compos er/Factory.php:576 Composer\Factory::create() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Conso le/Application.php:354 Composer\Console\Application->getComposer() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/s rc/Composer/Console/Application.php:471 Composer\Console\Application->getPluginCommands() at phar://C:/ProgramData/ComposerSetup/bin/composer. phar/src/Composer/Console/Application.php:169 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/ symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/ src/Composer/Console/Application.php:106 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo ser:61 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

C:\guruonw\myproject>

with this


{
    "name": "acquia/lightning-project",
    "type": "project",
    "description": "Project template for Drupal 8 sites built with the Lightning distribution.",
    "license": "GPL-2.0-or-later",
    "require": {
        "acquia/lightning": "^4.0",
        "cweagans/composer-patches": "^1.6.0",
        "drupal-composer/drupal-scaffold": "^2.0.0"
    },
    "require-dev": {
        "drush/drush": "^9.0"
    },
    "config": {
        "process-timeout": 0
    },
    "extra": {
"extra": {
  "patchLevel": {
    "drupal/core": "-p2"
  }
}
        "composer-exit-on-patch-failure": true,
        "enable-patching": true,
        "installer-paths": {
            "docroot/core": [
                "type:drupal-core"
            ],
            "docroot/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "docroot/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "docroot/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "docroot/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ]
    },
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "assets": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "dev": {
            "type": "github",
            "url": "https://github.com/acquia/lightning-dev",
            "no-api": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-install-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-update-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-create-project-cmd": "rm -r -f .travis.yml behat.yml .travis-ci",
        "nuke": "rm -r -f docroot/modules/contrib docroot/profiles/contrib/lightning vendor composer.lock",
        "quick-start": [
            "composer install",
            "php docroot/core/scripts/drupal quick-start lightning --no-interaction"
        ]
    }
}
phenaproxima commented 4 years ago

You have "extra", then "extra" again, nested within it. There should only be one "extra".

gurusonwheels commented 4 years ago

ok got this

C:\guruonw\myproject>composer install -vvv

[Seld\JsonLint\ParsingException] "./composer.json" does not contain valid JSON Parse error on line 21: "composer-exit-on-pa... -------------------^ Expected one of: 'EOF', '}', ',', ']'

Exception trace: () at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Json/JsonFile.php:304 Composer\Json\JsonFile::validateSyntax() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/ Composer/Json/JsonFile.php:159 Composer\Json\JsonFile->validateSchema() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/ Composer/Factory.php:290 Composer\Factory->createComposer() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Compos er/Factory.php:576 Composer\Factory::create() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Conso le/Application.php:354 Composer\Console\Application->getComposer() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/s rc/Composer/Console/Application.php:471 Composer\Console\Application->getPluginCommands() at phar://C:/ProgramData/ComposerSetup/bin/composer. phar/src/Composer/Console/Application.php:169 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/ symfony/console/Application.php:117 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/ src/Composer/Console/Application.php:106 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo ser:61 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

C:\guruonw\myproject>

with this one :

{
    "name": "acquia/lightning-project",
    "type": "project",
    "description": "Project template for Drupal 8 sites built with the Lightning distribution.",
    "license": "GPL-2.0-or-later",
    "require": {
        "acquia/lightning": "^4.0",
        "cweagans/composer-patches": "^1.6.0",
        "drupal-composer/drupal-scaffold": "^2.0.0"
    },
    "require-dev": {
        "drush/drush": "^9.0"
    },
    "config": {
        "process-timeout": 0
    },
    "extra": {
  "patchLevel": {
    "drupal/core": "-p2"
  }
}
        "composer-exit-on-patch-failure": true,
        "enable-patching": true,
        "installer-paths": {
            "docroot/core": [
                "type:drupal-core"
            ],
            "docroot/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "docroot/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "docroot/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "docroot/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ]
    },
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "assets": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "dev": {
            "type": "github",
            "url": "https://github.com/acquia/lightning-dev",
            "no-api": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-install-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-update-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-create-project-cmd": "rm -r -f .travis.yml behat.yml .travis-ci",
        "nuke": "rm -r -f docroot/modules/contrib docroot/profiles/contrib/lightning vendor composer.lock",
        "quick-start": [
            "composer install",
            "php docroot/core/scripts/drupal quick-start lightning --no-interaction"
        ]
    }
}
phenaproxima commented 4 years ago

You also need a comma after that curly brace, just before the composer-exit-on-patch-failure thing.

phenaproxima commented 4 years ago

If this doesn't work, by the way, I'm afraid I will be at an impasse here. We can maybe arrange a time to hack on this over a phone call, if you're still stuck; writing JSON in comment ping-pong is pretty hard. :)

gurusonwheels commented 4 years ago

done like this 👍 running now

{
    "name": "acquia/lightning-project",
    "type": "project",
    "description": "Project template for Drupal 8 sites built with the Lightning distribution.",
    "license": "GPL-2.0-or-later",
    "require": {
        "acquia/lightning": "^4.0",
        "cweagans/composer-patches": "^1.6.0",
        "drupal-composer/drupal-scaffold": "^2.0.0"
    },
    "require-dev": {
        "drush/drush": "^9.0"
    },
    "config": {
        "process-timeout": 0
    },
    "extra": {
  "patchLevel": {
    "drupal/core": "-p2"
},
        "composer-exit-on-patch-failure": true,
        "enable-patching": true,
        "installer-paths": {
            "docroot/core": [
                "type:drupal-core"
            ],
            "docroot/libraries/{$name}": [
                "type:drupal-library",
                "type:bower-asset",
                "type:npm-asset"
            ],
            "docroot/modules/contrib/{$name}": [
                "type:drupal-module"
            ],
            "docroot/profiles/contrib/{$name}": [
                "type:drupal-profile"
            ],
            "docroot/themes/contrib/{$name}": [
                "type:drupal-theme"
            ],
            "drush/contrib/{$name}": [
                "type:drupal-drush"
            ]
        },
        "installer-types": [
            "bower-asset",
            "npm-asset"
        ]
    },
    "repositories": {
        "drupal": {
            "type": "composer",
            "url": "https://packages.drupal.org/8"
        },
        "assets": {
            "type": "composer",
            "url": "https://asset-packagist.org"
        },
        "dev": {
            "type": "github",
            "url": "https://github.com/acquia/lightning-dev",
            "no-api": true
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-install-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-update-cmd": "DrupalComposer\\DrupalScaffold\\Plugin::scaffold",
        "post-create-project-cmd": "rm -r -f .travis.yml behat.yml .travis-ci",
        "nuke": "rm -r -f docroot/modules/contrib docroot/profiles/contrib/lightning vendor composer.lock",
        "quick-start": [
            "composer install",
            "php docroot/core/scripts/drupal quick-start lightning --no-interaction"
        ]
    }
}
gurusonwheels commented 4 years ago
No patches found for drupal/page_manager.
Patches already gathered. Skipping
  - Installing drupal/panels (4.4.0): Reading C:/Users/Administrator/AppData/Local/Composer/files/drupa
l/panels/0d67364eaa6ee28ff0b3ec8b32768bd918ab1b06.zip from cache
Loading from cache
 Extracting archive    REASON: drupal/lightning_layout 2.5.0 requires drupal/panels 4.4 -> satisfiable
by drupal/panels[4.4.0].

  - Applying patches for drupal/panels
    https://www.drupal.org/files/issues/2019-02-06/initial.patch (3030976 - Panels should check if ther
e is an icon map before setting the no preview icon)
Downloading https://www.drupal.org/files/issues/2019-02-06/initial.patch
patch "-p1" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\Users\ADMINI~1\AppData\Lo
cal\Temp\1/5e2877184cca6.patch"
Executing command (CWD): patch "-p1" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\
Users\ADMINI~1\AppData\Local\Temp\1/5e2877184cca6.patch"
patching file panels.module

Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 354

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

patch "-p0" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\Users\ADMINI~1\AppData\Lo
cal\Temp\1/5e2877184cca6.patch"
Executing command (CWD): patch "-p0" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\
Users\ADMINI~1\AppData\Local\Temp\1/5e2877184cca6.patch"
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/panels.module b/panels.module
|index 31de5f5..910d205 100644
|--- a/panels.module
|+++ b/panels.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p2" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\Users\ADMINI~1\AppData\Lo
cal\Temp\1/5e2877184cca6.patch"
Executing command (CWD): patch "-p2" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\
Users\ADMINI~1\AppData\Local\Temp\1/5e2877184cca6.patch"
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/panels.module b/panels.module
|index 31de5f5..910d205 100644
|--- a/panels.module
|+++ b/panels.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

patch "-p4" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\Users\ADMINI~1\AppData\Lo
cal\Temp\1/5e2877184cca6.patch"
Executing command (CWD): patch "-p4" --no-backup-if-mismatch -d "docroot/modules/contrib/panels" < "C:\
Users\ADMINI~1\AppData\Local\Temp\1/5e2877184cca6.patch"
missing header for unified diff at line 5 of patch
can't find file to patch at input line 5
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
--------------------------
|diff --git a/panels.module b/panels.module
|index 31de5f5..910d205 100644
|--- a/panels.module
|+++ b/panels.module
--------------------------
File to patch:
Skip this patch? [y]
Skipping patch.
1 out of 1 hunk ignored

   Could not apply patch! Skipping. The error was: Cannot apply patch https://www.drupal.org/files/issu
es/2019-02-06/initial.patch

  [Exception]
  Cannot apply patch 3030976 - Panels should check if there is an icon map before setting the no pre
  view icon (https://www.drupal.org/files/issues/2019-02-06/initial.patch)!

Exception trace:
 () at C:\guruonw\myproject\vendor\cweagans\composer-patches\src\Patches.php:320
 cweagans\Composer\Patches->postInstall() at n/a:n/a
 call_user_func() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher
/EventDispatcher.php:176
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://C:/ProgramData/ComposerSetup/bin/comp
oser.phar/src/Composer/EventDispatcher/EventDispatcher.php:116
 Composer\EventDispatcher\EventDispatcher->dispatchPackageEvent() at phar://C:/ProgramData/ComposerSetu
p/bin/composer.phar/src/Composer/Installer.php:622
 Composer\Installer->doInstall() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/
Installer.php:229
 Composer\Installer->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Comman
d/InstallCommand.php:122
 Composer\Command\InstallCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/ve
ndor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.p
har/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/compo
ser.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.pha
r/src/Composer/Console/Application.php:267
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/
symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/
src/Composer/Console/Application.php:106
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/compo
ser:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no
-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloa
der] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

C:\guruonw\myproject>
phenaproxima commented 4 years ago

I'm sorry...I don't know why that's happening. It's all kinda mysterious for me too.

That said, I don't think I can keep providing support in this thread; it's going on a bit too long and the problem seems to be system-specific, as I have not had this complaint from others (not yet, anyway).

Should we discuss over a Zoom or something else that can do a screen share? I'm on Drupal Slack as phenaproxima; please find me in the #lightning channel if you still want to keep working on this. I think it will be a more efficient way of debugging the problem.