drupal-composer / preserve-paths

A composer plugin for keeping specified files and directories when installing/updating new composer packages. Can be used to supported nested packages.
28 stars 28 forks source link

Allowed memory size error when running composer update #9

Closed HVSoftware closed 8 years ago

HVSoftware commented 8 years ago

I'm trying the following: https://www.drupal.org/node/2471553

I'm getting an Allowed memory size error when running composer update

Fatal error: Allowed memory size of 1073741824 bytes exhausted (tried to allocat e 36 bytes) in D:\web\UUtrecht\DrupalComposer\vendor\derhasi\composer-preserve-p aths\src\PathPreserver.php on line 240

The method file_exists in the file PathPreserver causes an infinitive loop.

static public function file_exists($path) 
    // Get all parent directories.
    $folders = array();
    $reset_perms = array();
    $folder = $path;
    while ($folder = dirname($folder)) {
      //      It always handling the same folder
      if ($folder === '.' || $folder === '/') {
        break;
      }
      elseif ($folder === '') {
        continue;
      }
      $folders[] = $folder;
//      I called a break in order to fixed this. 
//      if  ($folders[count($folders) - 1] === $folder) {
//        break;
//      }
    }
derhasi commented 8 years ago

@HVSoftware , did you test the latest dev-master? The changes from #8 should have fixed that issue.

HVSoftware commented 8 years ago

I have to check this.

2016-03-14 20:39 GMT+01:00 Johannes Haseitl notifications@github.com:

@HVSoftware https://github.com/HVSoftware , did you test the latest dev-master? The changes from #8 https://github.com/derhasi/composer-preserve-paths/pull/8 should have fixed that issue.

— Reply to this email directly or view it on GitHub https://github.com/derhasi/composer-preserve-paths/issues/9#issuecomment-196489971 .

Met vriendelijke groet

Harry van der Valk HV Software

"Een Web ontwikkelaar die staat voor het team verband, documentatie en overdracht van de code. Als je een verbetering wil hebben in je ontwikkel en deploy proces, neem dan contact met me op"

Web Applicaties | PHP | Symfony2 | WordPress www.hvsoftware.nl info@hvsoftware.nl

Twitter http://twitter.com/#!/HVSoftware LinkedIn http://www.linkedin.com/in/hvsoftware 06-18780025

generalredneck commented 8 years ago

I required
"derhasi/composer-preserve-paths": "dev-master#e10d7acbc84df0d58faf2470049f53c97a4a1503",

My results were the same as 0.1.*

See below: SCreenshot

generalredneck commented 8 years ago

Ok, here's the deal. When upgrading, you must delete the old package. Otherwise the code in the old package will be run before the update happens.

so... remove vendor/derhasi/composer-preserve-paths, and then composer update.

derhasi commented 8 years ago

@generalredneck, thanks for testing that.

So in the case you stumble upon this issue, you should:

rm -r remove vendor/derhasi/composer-preserve-paths
composer update derhasi/composer-preserve-paths

I tagged a new release 0.1.3, so at least new users should not run in that error anymore.

Closing this for now. Feel free to reopen, if any problem still occurs.