New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 714920 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Apr 2017
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

cipd.ps1 fails on first run due to git.bat not being present

Project Member Reported by brucedaw...@chromium.org, Apr 25 2017

Issue description

When running gclient for the first time after downloading depot_tools (from the depot_tools directory, with depot_tools added to the path) the cipd.ps1 script fails because git.bat does not yet exist:

C:\src\depot_tools>gclient
Installing python 2.7.6...
Fetching from https://storage.googleapis.com/chrome-infra/python276_bin.zip
& : The term 'git' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At C:\src\depot_tools\cipd.ps1:31 char:25
+ $depot_tools_version = &git -C $myPath rev-parse HEAD 2>&1
+                         ~~~
    + CategoryInfo          : ObjectNotFound: (git:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException

Bootstrapping cipd client for windows-amd64...
From https://chrome-infra-packages.appspot.com/client?platform=windows-amd64&version=git_revision:76eadcd75c5ad2638e1fc098f81748aad150c7c0
[P2992 00:33:02.852 client.go:879 I] cipd: updating client to infra/tools/cipd/windows-amd64:a72a1d0a858f2b22f87d168a60b32a8dd020b346 (git_revision:76eadcd75c5ad2638e1fc098f81748aad150c7c0)
[P1096 00:33:03.298 client.go:261 I] In root:
[P1096 00:33:03.299 client.go:267 I]   to install:
[P1096 00:33:03.299 client.go:269 I]     infra/depot_tools/git_installer/windows-amd64:bb697cfdd8032992546a85f35f4e57a1ece28e70
[P1096 00:33:03.301 client.go:1216 I] cipd: resolving fetch URL for infra/depot_tools/git_installer/windows-amd64:bb697cfdd8032992546a85f35f4e57a1ece28e70
[P1096 00:33:03.412 storage.go:248 I] cipd: initiating the fetch
[P1096 00:33:04.398 storage.go:215 I] cipd: about to fetch 29.4 Mb
[P1096 00:33:04.624 storage.go:206 I] cipd: fetching - 0%
[P1096 00:33:05.176 storage.go:206 I] cipd: fetching - 100%
[P1096 00:33:05.178 storage.go:206 I] cipd: fetching - 100%
[P1096 00:33:05.178 client.go:1212 I] cipd: successfully fetched infra/depot_tools/git_installer/windows-amd64:bb697cfdd8032992546a85f35f4e57a1ece28e70
[P1096 00:33:05.179 deployer.go:156 I] Deploying infra/depot_tools/git_installer/windows-amd64:bb697cfdd8032992546a85f35f4e57a1ece28e70 into c:\users\bruced~1\appdata\local\temp\2\tmpzlqqlh(/)
[P1096 00:33:05.234 reader.go:273 I] cipd: about to extract 29.4 Mb (2 files)
[P1096 00:33:07.405 reader.go:310 I] cipd: extracting - 99%
[P1096 00:33:07.422 reader.go:310 I] cipd: extracting - 100%
[P1096 00:33:07.479 deployer.go:260 I] Successfully deployed infra/depot_tools/git_installer/windows-amd64:bb697cfdd8032992546a85f35f4e57a1ece28e70
[P1096 00:33:07.487 client.go:1356 I] All changes applied.
                                                                                                     Usage: gclient.py <command> [options]

It appears that git.bat is downloaded slightly later in the setup process - by cipd.ps1. There doesn't seem to be any harm but this is causing confusion for new Chrome developers when they try to set up depot_tools for the first time. A git.bat existence check should be run before trying to invoke it in order to suppress these error and handle it more gracefully.

 

Comment 2 by iannu...@google.com, Apr 25 2017

Ah, yeah, that's not so good. I'll work up a patch to make that git invocation optional (it's just used to change the user agent when running cipd).

Comment 3 by iannu...@google.com, Apr 25 2017

If you have a windows machine handy, https://chromium-review.googlesource.com/486085 should (hopefully) fix it. I'll be able to check it in an hour or so if not.

Comment 4 by iannu...@google.com, Apr 25 2017

Yes this seems to work correctly on windows 10

Comment 5 by iannu...@google.com, Apr 25 2017

on win7 as well
Project Member

Comment 6 by bugdroid1@chromium.org, Apr 25 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/tools/depot_tools/+/78628da995e92c2cc371de65a90142f8a91b62bf

commit 78628da995e92c2cc371de65a90142f8a91b62bf
Author: Robert Iannucci <iannucci@chromium.org>
Date: Tue Apr 25 17:59:04 2017

[cipd.ps1] catch CommandNotFoundException if git is not available yet

R=brucedawson@chromium.org

Bug:  714920 
Change-Id: I6a0ea81e1d87fa2604e9f614a89ff48619cbffd0
Reviewed-on: https://chromium-review.googlesource.com/486085
Commit-Queue: Robbie Iannucci <iannucci@chromium.org>
Reviewed-by: Vadim Shtayura <vadimsh@chromium.org>

[modify] https://crrev.com/78628da995e92c2cc371de65a90142f8a91b62bf/cipd.ps1

Comment 7 by iannu...@google.com, Apr 25 2017

Status: Fixed (was: Assigned)
I declare this fixed

Sign in to add a comment