Help with gclient on Windows

1,143 views
Skip to first unread message

Rick Campbell

unread,
Jul 21, 2011, 8:25:02 AM7/21/11
to Chromium-dev
Yesterday and overnight I rebuilt a fresh windows dev environment with a fresh depot tools, avoiding *all* use of cmd -- everything was done with cygwin.

This morning I'm still seeing this strange gclient error message -- saying that a file does not exist, when it does:

$ pwd
/cygdrive/d/chrome/src
$ python -V
Python 2.6.2
$ ls -l /cygdrive/d/depot_tools/gclient.py
-rw-r--r--+ 1 rickcam Domain Users 52193 2011-07-20 15:59 /cygdrive/d/depot_tools/gclient.py
$ head -1 /cygdrive/d/depot_tools/gclient.py
#!/usr/bin/env python
$ ls -l /usr/bin/env
-rwxr-xr-x 1 rickcam root 47630 2010-06-25 05:41 /usr/bin/env*
$ which python
/cygdrive/d/chrome/src/third_party/python_26/python
$ gclient sync
D:\chrome\src\third_party\python_26\python.exe: can't open file '/cygdrive/d/depot_tools/gclient.py': [Errno 2] No such file or directory
$

Does this look familiar to anyone?  Any suggestions for resolution?

Rick

Timur Iskhodzhanov

unread,
Jul 21, 2011, 8:27:40 AM7/21/11
to ric...@google.com, Chromium-dev
Looks like something is passing a cygwin-style path to a windows-only
python.exe?

> --
> Chromium Developers mailing list: chromi...@chromium.org
> View archives, change email options, or unsubscribe:
> http://groups.google.com/a/chromium.org/group/chromium-dev
>

Marc-Antoine Ruel

unread,
Jul 21, 2011, 10:26:27 AM7/21/11
to timu...@chromium.org, ric...@google.com, Chromium-dev
Le 21 juillet 2011 08:27, Timur Iskhodzhanov <timu...@chromium.org> a écrit :
Looks like something is passing a cygwin-style path to a windows-only
python.exe?

On Thu, Jul 21, 2011 at 4:25 PM, Rick Campbell <ric...@google.com> wrote:
> Yesterday and overnight I rebuilt a fresh windows dev environment with a
> fresh depot tools, avoiding *all* use of cmd -- everything was done with
> cygwin.
> This morning I'm still seeing this strange gclient error message -- saying
> that a file does not exist, when it does:
>
> $ pwd
> /cygdrive/d/chrome/src
> $ python -V
> Python 2.6.2
> $ ls -l /cygdrive/d/depot_tools/gclient.py
> -rw-r--r--+ 1 rickcam Domain Users 52193 2011-07-20 15:59
> /cygdrive/d/depot_tools/gclient.py
> $ head -1 /cygdrive/d/depot_tools/gclient.py
> #!/usr/bin/env python
> $ ls -l /usr/bin/env
> -rwxr-xr-x 1 rickcam root 47630 2010-06-25 05:41 /usr/bin/env*
> $ which python
> /cygdrive/d/chrome/src/third_party/python_26/python

This is bad! Make sure you have python, svn, git installed in cygwin.

Elliot Poger

unread,
Jul 21, 2011, 10:58:46 AM7/21/11
to maruel...@google.com, timu...@chromium.org, ric...@google.com, Chromium-dev
On a related note... when building on Windows, is gyp expected to work on only Cygwin, only Windows Command Prompt, or both?

(I have been hesitant to run it in Cygwin because I figure it is not possible to trigger Visual Studio builds from Cygwin, whereas in Windows Command Prompt I can run gyp and then msbuild.exe .)

See related bug: http://code.google.com/p/chromium/issues/detail?id=89900 ('svn within depot_tools' svn_bin.zip fails for "svn --version" at Windows Command Prompt')

Marc-Antoine Ruel

unread,
Jul 21, 2011, 11:24:20 AM7/21/11
to Elliot Poger, timu...@chromium.org, ric...@google.com, Chromium-dev
I have updated the instructions at http://www.chromium.org/developers/how-tos/install-depot-tools a while ago to make this clearer.

I have 2 copies of depot_tools on my windows box, one for cmd and one for cygwin.

M-A

Scott Byer

unread,
Jul 21, 2011, 2:59:54 PM7/21/11
to epo...@google.com, maruel...@google.com, timu...@chromium.org, ric...@google.com, Chromium-dev

Cmd.exe? What's that? ;-)

Bash is the only shell you need. It's pretty easy to start up builds from there. I usually do:

time devenv.com chrome/chrome.sln "$@" | tee build.log | sed -f build/sanitize-win-build-log.sed

-Scott

Rick Campbell

unread,
Jul 22, 2011, 1:35:56 PM7/22/11
to scot...@chromium.org, epo...@google.com, maruel...@google.com, timu...@chromium.org, Chromium-dev
I think that the root cause of my problem was PATH.  I really don't use CMD unless something explicitly says to do so.

In any case, it looks like my windows env is a bit saner now.  Thanks for the help!

Scott, that devenv.com command line looks pretty interesting.  Does it avoid popping up the Visual Studio gui?  Where does devenv.com live?

Rick

Scott Byer

unread,
Jul 22, 2011, 1:39:37 PM7/22/11
to Rick Campbell, epo...@google.com, maruel...@google.com, timu...@chromium.org, Chromium-dev
It lives right next to devenv.exe in "/c/Program Files (x86)/Microsoft Visual Studio 9.0/Common7/IDE" (I've edited cygwin's /etc/fstab to use / instead of /cygwin/ as the drive lead, so it's more consistent when I work on msysGit using msys bash). Just make sure that's along your PATH.

Launched that way, it doesn't buffer build output, so you can actually see the build progressing. It's what the build bots use.

-Scott

Rick Campbell

unread,
Jul 22, 2011, 5:13:57 PM7/22/11
to scot...@chromium.org, epo...@google.com, maruel...@google.com, timu...@chromium.org, Chromium-dev
Hmm.  I don't seem to have that:
  /cygdrive/c/Program Files/Microsoft Visual Studio 9.0/Common7/IDE:
  total 1001
  drwx------+ 1 SYSTEM   4096 Aug 19  2010 ./
  drwx------+ 1 SYSTEM      0 Aug 19  2010 ../
  drwx------+ 1 SYSTEM      0 Aug 19  2010 Remote Debugger/
  -rwx------+ 1 SYSTEM 834552 Oct 15  2007 WDE.dll*
  drwx------+ 1 SYSTEM      0 Aug 19  2010 Xml/
  -rwx------+ 1 SYSTEM 142336 Nov  7  2007 rdbgwiz.exe*
  -rwx------+ 1 SYSTEM  37896 Nov  7  2007 vsdiag_regwcf.exe*
  -rwx------+ 1 SYSTEM    136 Jul 24  2007 vsdiag_regwcf.exe.config*

Is there a setup/install option that I missed?  An extra package that I can install?  I'd *love* to stop firing up that IDE!

Rick

Scott Byer

unread,
Jul 25, 2011, 1:15:12 PM7/25/11
to Rick Campbell, epo...@google.com, maruel...@google.com, timu...@chromium.org, Chromium-dev
You missed the (x86) part - there are two Program Files directories, you need the 32-bit one. Visual Studio has both 32-bit and 64-bit components, the IDE is only 32-bits.

-Scott

Gregg Tavares (wrk)

unread,
Jul 25, 2011, 5:53:55 PM7/25/11
to ric...@google.com, Chromium-dev
gclient doesn't work with cygwin, at least not for me. I saw in the docs (http://dev.chromium.org/developers/how-tos/build-instructions-windows

that I should run it like this from cygwin

cmd /c gclient <args>


Peter Kasting

unread,
Jul 25, 2011, 5:55:22 PM7/25/11
to gm...@google.com, ric...@google.com, Chromium-dev
On Mon, Jul 25, 2011 at 2:53 PM, Gregg Tavares (wrk) <gm...@google.com> wrote:
gclient doesn't work with cygwin, at least not for me. I saw in the docs (http://dev.chromium.org/developers/how-tos/build-instructions-windows

that I should run it like this from cygwin

cmd /c gclient <args>

Eh???

gclient works just fine from cygwin and if you're going to use cygwin for other stuff you should invoke gclient from it directly, not via cmd.

PK

Gregg Tavares (wrk)

unread,
Jul 25, 2011, 6:07:52 PM7/25/11
to Peter Kasting, ric...@google.com, Chromium-dev
Well it's in the docs on that page that it doesn't work so I'm not the only one that has run into this. Search for 'cmd' on that page.

I get a similar problem as mentioned above where a cygwin path is being passed to a non-cygwin program.  depot_tools is the first thing in my path. I'll try installing a separate copy of depot_tools.

 

PK

Peter Kasting

unread,
Jul 25, 2011, 6:18:31 PM7/25/11
to Gregg Tavares (wrk), ric...@google.com, Chromium-dev
On Mon, Jul 25, 2011 at 3:07 PM, Gregg Tavares (wrk) <gm...@google.com> wrote:
Well it's in the docs on that page that it doesn't work so I'm not the only one that has run into this. Search for 'cmd' on that page.

I have removed this instruction since it can cause other things to go wrong.  Having to run something via cmd from inside cygwin is a sign something else is wrong.

The instructions on https://sites.google.com/a/chromium.org/dev/developers/how-tos/cygwin are pretty explicit about always using the same underlying svn (whether that's invoked directly, via gclient, or whatever) to access the checkout.  The sample setup included in the "Notes", which is what I use to successfully use cygwin, conflicts somewhat with maruel's instructions in http://www.chromium.org/developers/how-tos/install-depot-tools , which I find to be rather unclear.

PK

Marc-Antoine Ruel

unread,
Jul 25, 2011, 8:18:37 PM7/25/11
to pkas...@google.com, Gregg Tavares (wrk), ric...@google.com, Chromium-dev
What is unclear? 

Peter Kasting

unread,
Jul 25, 2011, 8:36:49 PM7/25/11
to Marc-Antoine Ruel, Gregg Tavares (wrk), ric...@google.com, Chromium-dev
It says you should set up two depot_tools installs and that making this work is a matter of modifying your PATH, but doesn't give precise details about how to accomplish all this.

Compare this to the paragraph in the Notes of the Cygwin page which gives steps and an order.

PK

Marc-Antoine Ruel

unread,
Jul 25, 2011, 8:38:06 PM7/25/11
to Peter Kasting, Gregg Tavares (wrk), ric...@google.com, Chromium-dev
Can you update it and link to the relevant subsection?

Thanks

M-A 

Peter Kasting

unread,
Jul 25, 2011, 9:00:42 PM7/25/11
to Marc-Antoine Ruel, Gregg Tavares (wrk), ric...@google.com, Chromium-dev
On Mon, Jul 25, 2011 at 5:38 PM, Marc-Antoine Ruel <mar...@chromium.org> wrote:
Can you update it and link to the relevant subsection?

Not sure which "it" you meant, but I tried just now to hoist the instructions from the "installing Cygwin" page to the depot_tools install page, and updated both pages.

PK

Gregg Tavares (wrk)

unread,
Jul 25, 2011, 9:12:56 PM7/25/11
to Marc-Antoine Ruel, Peter Kasting, ric...@google.com, Chromium-dev
As of 6:10pm PST (sorry I'm in TKO so I wanted to make sure)

This page

Is apparently wrong. 

It as Linux and OSX at the top and Windows and Cygwin at the bottom

It should have Linux, OSX, and Cygwin at the top and Windows (non-cygwin) at the bottom 

right?

(I just followed the instructions at the top and my cygwin gclient started working)

Peter Kasting

unread,
Jul 25, 2011, 9:16:06 PM7/25/11
to Gregg Tavares (wrk), Marc-Antoine Ruel, ric...@google.com, Chromium-dev
On Mon, Jul 25, 2011 at 6:12 PM, Gregg Tavares (wrk) <gm...@google.com> wrote:
As of 6:10pm PST (sorry I'm in TKO so I wanted to make sure)

This page
Is apparently wrong. 

It as Linux and OSX at the top and Windows and Cygwin at the bottom

It should have Linux, OSX, and Cygwin at the top and Windows (non-cygwin) at the bottom 

right?

(I just followed the instructions at the top and my cygwin gclient started working)

I changed both top and bottom at 6 (as I previously posted).  The top was changed to put the depot_tools last on the PATH instead of first.  The bottom was changed to include more detailed instructions for Cygwin users that match what used to appear on the Cygwin page.

So no, it's not wrong, or at least it's not wrong in my view.

It's possible that my change to the top to put depot_tools last on the path was the only thing you needed to do -- for now -- to make your checkout work.

PK

Gregg Tavares (wrk)

unread,
Jul 25, 2011, 9:35:59 PM7/25/11
to Peter Kasting, Marc-Antoine Ruel, ric...@google.com, Chromium-dev
On Tue, Jul 26, 2011 at 10:16 AM, Peter Kasting <pkas...@google.com> wrote:
On Mon, Jul 25, 2011 at 6:12 PM, Gregg Tavares (wrk) <gm...@google.com> wrote:
As of 6:10pm PST (sorry I'm in TKO so I wanted to make sure)

This page
Is apparently wrong. 

It as Linux and OSX at the top and Windows and Cygwin at the bottom

It should have Linux, OSX, and Cygwin at the top and Windows (non-cygwin) at the bottom 

right?

(I just followed the instructions at the top and my cygwin gclient started working)

I changed both top and bottom at 6 (as I previously posted).  The top was changed to put the depot_tools last on the PATH instead of first.

That was my problem. Doh!  Now that I moved to to the end everything is working. Thanks

Marc-Antoine Ruel

unread,
Jul 25, 2011, 9:37:57 PM7/25/11
to Gregg Tavares (wrk), Peter Kasting, ric...@google.com, Chromium-dev
But Greg was right, cygwin users should use the same instruction than linux and mac users. I've made the wording clearer.

M-A

Peter Kasting

unread,
Jul 26, 2011, 1:57:33 PM7/26/11
to Marc-Antoine Ruel, Gregg Tavares (wrk), ric...@google.com, Chromium-dev
On Mon, Jul 25, 2011 at 6:37 PM, Marc-Antoine Ruel <mar...@chromium.org> wrote:
But Greg was right, cygwin users should use the same instruction than linux and mac users.

maruel and I argued about this more and now the instructions are somewhere between the two states :)

The issue (if anyone cares) is that we have had cases before where particular build steps forcibly invoke the depot_tools version of something even for Cygwin, which breaks Cygwin users unless they've installed the depot_tools in such a way as to work for cmd shells as well.  Perhaps in principle this should never happen, but since our build infrastructure is cmd-based rather than Cygwin-based, we're not verifying this.  I don't know if we currently have any such issues, but hopefully the instructions as they stand now should keep Cygwin users functional even if we do.

PK 
Reply all
Reply to author
Forward
0 new messages