TYPO3 / CmsComposerInstallers

TYPO3 CMS Composer Installer
GNU General Public License v2.0
58 stars 39 forks source link

Trying to create symlink on Windows fails with RuntimeException #25

Closed InvisibleKind closed 9 years ago

InvisibleKind commented 9 years ago

Hi, I'm using PhpStorm with Composer to manage TYPO3.

With version 1.2.2 of typo3/cms-composer-installers the installation process was copying index.php from typo3_src to web directory, which was ok in my case.

After last "composer update" typo3/cms-composer-installers became of version 1.2.4 and now it fails with:

[RuntimeException]                                                           
  Symlinking target "C:\Projects code\project\www\index.php" to source "..\typo3  
  _src\index.php" ("C:\Projects code\project/typo3_src\index.php")  failed.      

Looks like this pull-request is the reason: #24, because it explicitly disallows to make a copies of files on symlink failure, which is exactly the case in my situation.

Is there any workaround for this?

helhum commented 9 years ago

Which TYPO3 version are you using?

InvisibleKind commented 9 years ago

It is 7.4.0

helhum commented 9 years ago

Can you elaborate on your project setup? Do you have a composer distribution for your project?

helhum commented 9 years ago

If so, you can explicitly require version 1.2.2 of the composer installers in your project composer.json

InvisibleKind commented 9 years ago

Sure, I can show my shortened version of composer.json.

{
  "name": "vendor/distribution",
  "description": "Distribution, based on TYPO3 7.x",
  "license": "GPL-2.0+",
  "minimum-stability": "stable",
  "repositories": [
    {
      "type": "composer",
      "url": "http://composer.typo3.org/"
    }
  ],
  "config": {
    "vendor-dir": "vendor",
    "bin-dir": "bin"
  },
  "require": {
    "php": "~5.5",
    "typo3/cms": "7.4.*",
    "fluidtypo3/flux": "7.2.*",
    "fluidtypo3/fluidpages": "3.3.*",
    "fluidtypo3/fluidcontent": "4.3.*",
    "fluidtypo3/vhs": "2.3.*",
    "typo3-ter/sf-register": "6.2.*",
    "guzzlehttp/guzzle": "~6.0"
  },
  "require-dev": {
    "phpunit/phpunit": "4.7.*"
  },
  "extra": {
    "typo3/cms": {
      "web-dir": "www"
    }
  },
  "autoload": {
    "psr-4": {
      "Vendor\\PxiaTemplates\\": "www/typo3conf/ext/pxia_templates/Classes/",
      "SJBR\\StaticInfoTables\\": "www/typo3conf/ext/static_info_tables/Classes/"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "TYPO3\\CMS\\Core\\Tests\\": "www/typo3/sysext/core/Tests/",
      "Vendor\\PxiaTemplates\\Tests\\": "www/typo3conf/ext/pxia_templates/Tests/",
    }
  }
}
helhum commented 9 years ago

And if you do so, I would be interested in the directory listing after a composer install

helhum commented 9 years ago

Ok, so how does your www directory exactly look like with composer installers 1.2.2?

InvisibleKind commented 9 years ago

I did it a bit different: I run cmd.exe "as administrator" and manually run composer update via: C:\Tools\php-5.6.13-nts-Win32-VC11-x86\php.exe "C:\Project s code\project\composer.phar" update - this made mklink() be able to run and crate link

And here is how my structure looks like image

With 1.2.2 it was same, except index.php and typo3 inside of www were not symlinks, but real copies.

InvisibleKind commented 9 years ago

Just to mention: structure with copies was not operatable. The real dev environment runs on remote Linux server, which obviously can make a symlinks. My local files from typo3conf/ext are synced to remote and I run my code on remote.

So, form this sight, an issue may be closed, because system is not operable with copies instead of symlinks. And for any other Windows warrior, approaching same issue, this will be kept as reminder: run your composer stuff with administrator rights.

helhum commented 9 years ago

we improved the error messages now with fa6a26c3a3dd6dc3acb5fc4d351bfc1b7fc3a1d7 and consider this issue resolved. If you disagree, feel free to add further suggestions