Commit 9d5696da authored by borenet's avatar borenet Committed by Commit bot

Make git recipe api add depot_tools to PATH

"git retry" assumes that depot_tools is in PATH; in some cases it isn't,
and there's currently no way to add it.

BUG=

Recipe-Tryjob-Bypass-Reason: Expectations known to change
Review-Url: https://codereview.chromium.org/2192163002
parent abb9b227
...@@ -208,11 +208,16 @@ class GitApi(recipe_api.RecipeApi): ...@@ -208,11 +208,16 @@ class GitApi(recipe_api.RecipeApi):
self.resource('git_setup.py'), self.resource('git_setup.py'),
git_setup_args) git_setup_args)
# Some of the commands below require depot_tools to be in PATH.
path = self.m.path.pathsep.join([
str(self.package_repo_resource()), '%(PATH)s'])
if use_git_cache: if use_git_cache:
self('retry', 'cache', 'fetch', '-c', self.m.path['git_cache'], self('retry', 'cache', 'fetch', '-c', self.m.path['git_cache'],
cwd=dir_path, cwd=dir_path,
name='fetch cache', name='fetch cache',
can_fail_build=can_fail_build) can_fail_build=can_fail_build,
env={'PATH': path})
# There are five kinds of refs we can be handed: # There are five kinds of refs we can be handed:
# 0) None. In this case, we default to properties['branch']. # 0) None. In this case, we default to properties['branch'].
...@@ -246,7 +251,7 @@ class GitApi(recipe_api.RecipeApi): ...@@ -246,7 +251,7 @@ class GitApi(recipe_api.RecipeApi):
if recursive: if recursive:
fetch_args.append('--recurse-submodules') fetch_args.append('--recurse-submodules')
fetch_env = {} fetch_env = {'PATH': path}
fetch_stderr = None fetch_stderr = None
if curl_trace_file: if curl_trace_file:
fetch_env['GIT_CURL_VERBOSE'] = '1' fetch_env['GIT_CURL_VERBOSE'] = '1'
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -20,6 +20,9 @@ ...@@ -20,6 +20,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -42,6 +42,9 @@ ...@@ -42,6 +42,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -22,7 +22,8 @@ ...@@ -22,7 +22,8 @@
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": { "env": {
"GIT_CURL_VERBOSE": "1" "GIT_CURL_VERBOSE": "1",
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
}, },
"name": "git fetch", "name": "git fetch",
"stderr": "[SLAVE_BUILD]/curl_trace.log" "stderr": "[SLAVE_BUILD]/curl_trace.log"
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"[GIT_CACHE]" "[GIT_CACHE]"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "fetch cache" "name": "fetch cache"
}, },
{ {
...@@ -33,6 +36,9 @@ ...@@ -33,6 +36,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -31,6 +31,9 @@ ...@@ -31,6 +31,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]\\src", "cwd": "[SLAVE_BUILD]\\src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools];%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -23,6 +23,9 @@ ...@@ -23,6 +23,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
...@@ -21,6 +21,9 @@ ...@@ -21,6 +21,9 @@
"--recurse-submodules" "--recurse-submodules"
], ],
"cwd": "[SLAVE_BUILD]/src", "cwd": "[SLAVE_BUILD]/src",
"env": {
"PATH": "RECIPE_PACKAGE_REPO[depot_tools]:%(PATH)s"
},
"name": "git fetch" "name": "git fetch"
}, },
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment