0

When building Commerce Kickstart on Windows, using Drush Make, a customer has this problem:

copy(C:\Users\User\AppData\Local\Temp\make_tmp_1449319094_5662dab66a8f0
\__build__\profiles\commerce_kickstart\modules\contrib/commerce_discoun
t/modules/commerce_discount_usage/includes/views/handlers/commerce_disc
ount_usage_handler_field_commerce_discount_analytics.inc): failed to
open stream: Invalid argument filesystem.inc:267

It results in the Drush error "Project commerce_discount (7.x-1.0-alpha6) could not be downloaded".

The build works on non-Windows platforms.

I notice that the file path is 264 characters long, and I suspect this is a problem of the Windows MAX_PATH constant (variously quoted on the web as being 255, 256, or 260 characters).

Is there a way to get around this?

I should note: I have read the drupal.org issue about Kickstart on Windows (https://www.drupal.org/node/1648992)

3 Answers 3

1

The Drush temporary directory can be set manually in the environment variable TEMP. So something like:

mkdir -p /c/drushtmp
TEMP=/c/drushtmp drush make [...]

can neatly solve the MAX_PATH problem for the temporary directory.

1

What about temporarily changing the TMP and/or TEMP variable to C:\tmp (in stead of C:\Users\User\AppData\Local\Temp)? It might be just enough ;-)

1
  • Thanks, I answered with that myself about 2 minutes before you :) see below
    – pjcdawkins
    Dec 8, 2015 at 16:38
0

It appears there is an MSDN article that has a solution:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx#maxpath

To specify an extended-length path, use the "\?\" prefix. For example, "\?\D:\very long path".

So, perhaps you can modify the install script to use this prefix before trying to install?

3
  • Thanks, I had hoped there might be some kind of way to do this at the OS level, because patching Drush is a little bit out of scope although probably worth trying...
    – pjcdawkins
    Dec 8, 2015 at 0:06
  • It turns out PHP can't use that prefix, it prevents it deliberately according to Pierre Joye in this php-internals thread: serverphorums.com/read.php?7,627200
    – pjcdawkins
    Dec 8, 2015 at 16:37
  • Blerg! (facepalm)
    – joshmiller
    Dec 8, 2015 at 16:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.