Hi I am using Drush and Drush make on Win XP and I think I am having problem with the difference between Win paths with backslashes and Unix paths with forward slashes.

Geoff@davies-pc /cygdrive/c/server
$ drush make drush.build test123
Project information for drupal retrieved.                   ←[0;33;40m←[1m[ok]←[0m
Unable to download                                          ←[31;40m←[1m[error]←[0m

PROBLEM IN NEXT LINE
C:\DOCUME~1\Geoff\LOCALS~1\Temp\/drush_make_tmp_1257568189/drupal-6.14.tar.gz from
http://ftp.drupal.org/files/projects/drupal-6.14.tar.gz.

Any ideas?

Great module btw.
Regards
Geoff

Comments

dmitrig01’s picture

Yeah, drush make uses tons of forward slashes, so I don't know exactly what to do.

behindthepage’s picture

Thanks. I will try replacing all the slashes with a variable and then define that variable as '\' and see if that fixes the problem then if others have the same problem they can just change the variable value.

Regards
Geoff

behindthepage’s picture

After some experimenting a bit I found the problem was Windows XP default temp path which is C:\Documents and Settings\Username\Local Settings\Temp. In Cygwin this is abbreviated to C:\Docum~1\Username\Local~1\Temp and this what was causing the problems. Once I changed the Temp file in System->Advanced->Environment Variables then the problems was solved.

The next problem was that when wget wrote the downloaded Drupal file to the femp folder it assigned it user=Geoff UID=none which caused Access Denied.

I solved all my problems by installing Virtualbox and Mint 7 Linux with access to my PC folders so now I can Drush make without problems.

Thanks for this great module and your help.
Regards
Geoff

dmitrig01’s picture

Status: Active » Closed (won't fix)

ok, i'd say that at this point windoze support isn't a priority

matt v.’s picture

Status: Closed (won't fix) » Needs work
StatusFileSize
new792 bytes

I managed to get drush make working under Windows. I already had drush working, using various stand-alone Windows versions of the unix utilities such as wget and tar. To get drush make working, I had to also download mv, cp, and gawk from GNU utilities for Win32. I had to rename gawk.exe to awk.exe and make the minor change included in the patch file below.

hunmonk’s picture

we should look at addressing this before drush_make gets deployed on drupal.org, since we'd be asking profile maintainers (some of which are on windoze, i'm guessing) to use it.

dmitrig01’s picture

Matt, thanks so much for the patch. I committed it, but I'm leaving this issue as needs work because this needs documenting somewhere. would you be willing to take that up?

dmitrig01’s picture

Status: Needs work » Fixed

Actually I think this is standard Drush, so unneeded.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

matt v.’s picture

Version: 6.x-2.x-dev » 6.x-2.0-beta6
Status: Closed (fixed) » Active

Comment #7 says the patch was committed, but I just had to make the same change to get the latest version (6.x-2.0-beta6) to work under Windows. I'm not sure this got committed.

ribbles’s picture

After applying the above patch, I was still receiving problems with the temp folder on windows. It looks like the args passed into drush_shell_exec() are not being pre-formatted.

before:
arg[0] = [mv %s/%s %s]
[1] = [D:/temp/drush_make_tmp_1274394282]
[2] = [features]
[3] = [D:/temp/drush_make_tmp_1274394282/__build__/sites/all/modules]

results in:
mv "D:/temp/drush_make_tmp_1274394282"/"features" "D:/temp/drush_make_tmp_1274394282/__build__/sites/all/modules"

after widows.patch:
arg[0] = [mv -f %s %s]
[1] = [D:/temp/drush_make_tmp_1274397041/features]
[2] = [D:/temp/drush_make_tmp_1274397041/__build__/sites/all/modules]

results in: (notice the "/")
mv "D:/temp/drush_make_tmp_1274394282/features" "D:/temp/drush_make_tmp_1274394282/__build__/sites/all/modules"

ribbles’s picture

StatusFileSize
new8.16 KB
jarodms’s picture

Awesome help! Thanks!

After installing this patch, I had some additional issues with windows, including:
- the version of tar that came with the GnuWin32 package I installed prevented tar -tf from executing.
- my TEMP environment setting prevented the mv command from executing correctly.

I hope this helps someone http://jarodms-drupal.blogspot.com/2010/06/drush-make-on-windows.html

Jarod

dmitrig01’s picture

Hey, sorry I overlooked this patch. Next time you upload a patch please set the status to active.

Would you mind re-rolling your patch from the latest version of CVS? The code base has changed quite a bit, and I really really want to get this in, but in its current form, it doesn't apply - thanks!

mew_fla’s picture

Is there a possibility of getting this patch updated for the new release of Drush_Make? I am using Windows 7 and have the drush part working perfectly, I just can't seem to get the drush_make part working.

-thanks

I am only trying to do a simple dl of core, so my make file is:

core = 6.x

projects[] = drupal

I am getting an error message at function: drush_drush_make_make
c:\temp\/drush_make_tmp_12779487004/drupal-6.17.tar.gz

Again, thanks for any help

dmitrig01’s picture

Priority: Normal » Critical

This *will* go in at some point

jarodms’s picture

StatusFileSize
new5.76 KB

here's an updated patch

This works from what I can tell, but I get the following issues:
- "tar --strip" is not a valid option. The error message is: "Unable to find a strip option in your version of tar"
- "mkdir -p" is not a valid windows command. This creates a directory named "-p"

But my make files work. Looking into the issues though.

mew_fla’s picture

Thanks for the update!

I got the patch installed and now I am getting:

An error occurred at function : drush_drush_make_make

I notice that the paths are now correct to where the files/dirs are located and the Temp files are removed. The location of the new "site" is also empty except for an empty -p directory.

Thanks again.

mew_fla’s picture

I reinstalled everything, for the third time, using your directions as a guide this time and everything worked.

Your set of utils looks newer than the others. I did get a couple errors during the install, but all looks normal. The site works as expected and all is good!!

Thanks again for all your help.
-Mike

dmitrig01’s picture

Well we had a fill_path for -p, guess I will have to reintroduce. As for strip, we can use the mv technique I have discovered, but that's just more code. so I will do this at some point.

marcvangend’s picture

Subscribing. My output when trying to do a basic drupal install, using a make file like in #15:

D:\www>drush.bat make core.make makecore
Project information for drupal retrieved.                                   [ok]
drupal downloaded from                                                      [ok]
http://ftp.drupal.org/files/projects/drupal-6.17.tar.gz.
'man' is not recognized as an internal or external command,
operable program or batch file.
Unable to find a strip option in your version of tar                     [error]
An error occurred at function : drush_drush_make_make                    [error]
dmitrig01’s picture

This will be fixed in #641210: Can't find a strip option (now: Drush suggestion), though i still need to fix -p

dmitrig01’s picture

that part is fixed, now I need to desperately do this.

brightbold’s picture

Windows users worldwide will thank you if you can get this fixed!

smk-ka’s picture

Title: Win XP path problems » Windows compatibility
Version: 6.x-2.0-beta6 » 6.x-2.x-dev
StatusFileSize
new5.87 KB

I was able to get drush make to work on Windows. These were to the steps:

  1. Install the required GnuWin32 tools for drush as per the instructions.
  2. Additionally install the following two GnuWin32 packages specifically for drush make:
    http://gnuwin32.sourceforge.net/packages/coreutils.htm
    http://gnuwin32.sourceforge.net/packages/gawk.htm
    (Are these already documented somewhere?)
    It should be noted that I didn't manage to get it to work at all with Cygwin.
  3. Apply the patch. Basically it does two things:
    - replaces all direct system calls to mkdir -p with a PHP implementation
    - fixes the params to awk. Somebody with more knowledge in *nix shells needs to determine whether some sort of escaping is required due to double quotes.
dmitrig01’s picture

Status: Active » Needs work

That mkdir replacement function is cool. Two things - code style - || and && instead of and and or. Second, can you document (in readme or otherwise) how you got it working? Thanks!

marcvangend’s picture

Slightly beyond the scope of this this issue maybe, but drush_make is not the only drush component that needs to create directories once in a while. Isn't there a generic mkdir helper function in drush already? And if it isn't, shouldn't drush_make_mkdir() be added to drush core as drush_mkdir(), so others will not have to invent the same wheel?

dmitrig01’s picture

Status: Needs work » Fixed

marcvangend: #902052: drush_mkdir

fixed. but this still needs to be documented

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

lyd’s picture

Status: Closed (fixed) » Active

I appreciate these instructions. I have spent so many hours trying to get drush make to work on Windows XP.

Have made the additional gnu installations, however, applying the patch failed.

Is there a way of finding the files already patched the way you describe?

Thanks.

das-peter’s picture

Hi there,

Just struggled also over the lack of windows compatibility.
I decided to give it a try and enhance it.
The attached patch works for me in the git-bash and cygwin on Win7.

Requirements
drush extension drush_archiver, I wrote this one to enhance support of archive handling. Atm. this is not an official project but could become one if the feedback is positive.
Known Issues
  • Lack of patch command support. It's likely that it works in the git-bash since this one includes the native patch command
  • No support for drush_make_tar() (The --tar option). Shouldn't be a big deal to implement this - but my focus lies currently on executing make files. To implement this I've to extend the drush archiver extension.

I removed a leftover call to drush_make_libraries(). This seems a related issue: #1091510: Error: Call to undefined function drush_make_libraries() in
Another interesting thing is, that I had to replace the protocol http:// with git:// in the git download function - since the http:// was not working in cygwin. It seems to work in any scenario so far - but is definitely a candidate for another bug.

das-peter’s picture

StatusFileSize
new20.04 KB
new44.53 KB

*grml* I know think first, then click save.
Here is the patch and the archiver extension :)

Edit 9th May:
You can grab the archiver extension now from here: git://github.com/das-peter/drush_archiver.git
The latest version includes support for archive creation and unit testing.

bmcguire’s picture

I'm having troubles applying the patch from #625948-32: Windows compatibility for Drush make. I just pulled down the latest 6.x-2.x from git "git clone --branch 6.x-2.x http://git.drupal.org/project/drush_make.git" and having issues with patching files drush_make.project.inc, drush_make.drush.inc, and drush_make.download.inc.

Here is the exact error I get

Failed to apply patch for file drush_make.drush.inc: Context mismatch. Expected line:
// Merge the known data onto the project info.
Found line:
$md5 = '';

Please let me know if I'm pulling from the wrong place. I would really like to test this patch.

das-peter’s picture

Hi bmcguire,

sorry I forgot to mention that I used version "6.x-3.x".
Please let me know if the problem persists - or any other problems occur.

das-peter’s picture

Status: Active » Needs review
StatusFileSize
new20.94 KB

Updated the patch after feedback on this issue #1151476: unlink fails on windows if the file is read-only
The drush archiver is available here: https://github.com/das-peter/drush_archiver

Ellen Dee’s picture

subscribe

dmitrig01’s picture

StatusFileSize
new20.93 KB

I don't want to commit this yet, as it would create a dependency on drush 5.x. Once there's a 5.0 release, I'll commit this and release as well. For now, here's an updated version.

dmitrig01’s picture

Status: Needs review » Postponed
Issue tags: -drupal.org deployment blocker
ZuluWarrior’s picture

FYI,

Following the instructions here: http://drupal.org/node/1260084

I was able to get drush and drush_make working fine under Win7, just linking in case its any help to anyone! :)

ZuluWarrior’s picture

By using drush itself to install drush_make this should work on all windows that support drush, no?

The solution (abbriviated from my above link) is to install a bunch of unix commands for windows (all linked on #1260084: how to prepare mediafront_demo installation ) and then drush the command : 'drush dl drush_make-6.x-2.3' and it went in no problems, was then able to make some sites.

The above instruction involves installing a make file for mediafront_demo (which is currently in flux) so ignore the last USE MEDIAFRONT.MAKE step, but the steps A through D sorted drush_make out for me on windows 7.

The istructions worked without any patching or manual nstalling of anything (like drush_make into the bin folder!!).

I would say that if someone can verify the solution works for XP users too, that this issue should be considered reviewed and be closed/fixed, but its not my place to say!

helmo’s picture

Project: Drush Make » Drush
Version: 6.x-2.x-dev »
Component: Code » Make

[ Powered by #1115636: Issue Macros and Templates - Drush Make]

Drush make is being merged into drush core (discussed in issue:#1310130: Put drush make in drush core)
This means that the issue queue is also moving. The drush queue has a component 'Make' especially for drush_make.

More information will be posted on the drush_make and drush project pages.

greg.1.anderson’s picture

Title: Windows compatibility » Windows compatibility for Drush make
Status: Postponed » Needs work
Issue tags: +Windows

#38 will probably need to be reworked after Drush make is adjusted to use Drush's download mechanism.

moshe weitzman’s picture

Issue tags: +Release blocker

The current blocker with the unit tests is that make_md5() uses find command which means something else on Windows. Lets fix this issue, borrowing code from recent patches as needed.

moshe weitzman’s picture

that make_md5() issue is being discussed at #1428480: Use hash_file() when computing MD5 for a drush_make build - Windows compatility. We'll come back to this issue for later Windows work.

jhedstrom’s picture

Status: Needs work » Fixed

AFAIK, this is resolved by other issues. Closing for now.

Status: Fixed » Closed (fixed)
Issue tags: -Windows, -Release blocker

Automatically closed -- issue fixed for 2 weeks with no activity.