diff --git a/recipe_modules/gclient/api.py b/recipe_modules/gclient/api.py index e93de3661..1b705d5b3 100644 --- a/recipe_modules/gclient/api.py +++ b/recipe_modules/gclient/api.py @@ -90,6 +90,11 @@ class GclientApi(recipe_api.RecipeApi): if self.spec_alias: prefix = ('[spec: %s] ' % self.spec_alias) + prefix + kwargs.setdefault('env', {}) + kwargs['env'].setdefault('PATH', '%(PATH)s') + kwargs['env']['PATH'] = self.m.path.pathsep.join([ + kwargs['env']['PATH'], str(self._module.PACKAGE_DIRECTORY)]) + return self.m.python(prefix + name, self.package_resource('gclient.py'), cmd, diff --git a/recipe_modules/gclient/example.expected/basic.json b/recipe_modules/gclient/example.expected/basic.json index 15d9d2f40..46c74809d 100644 --- a/recipe_modules/gclient/example.expected/basic.json +++ b/recipe_modules/gclient/example.expected/basic.json @@ -9,6 +9,9 @@ "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient setup" }, { @@ -30,6 +33,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -54,6 +60,9 @@ "local_bot" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.name)" }, { @@ -68,6 +77,9 @@ "local_bot@example.com" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.email)" }, { @@ -80,6 +92,9 @@ "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient setup" }, { @@ -99,6 +114,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -147,6 +165,9 @@ "runhooks" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient runhooks" }, { diff --git a/recipe_modules/gclient/example.expected/revision.json b/recipe_modules/gclient/example.expected/revision.json index 3875852ab..f954fd9c1 100644 --- a/recipe_modules/gclient/example.expected/revision.json +++ b/recipe_modules/gclient/example.expected/revision.json @@ -9,6 +9,9 @@ "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient setup" }, { @@ -32,6 +35,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -56,6 +62,9 @@ "local_bot" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.name)" }, { @@ -70,6 +79,9 @@ "local_bot@example.com" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.email)" }, { @@ -82,6 +94,9 @@ "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient setup" }, { @@ -101,6 +116,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -149,6 +167,9 @@ "runhooks" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient runhooks" }, { diff --git a/recipe_modules/gclient/example.expected/tryserver.json b/recipe_modules/gclient/example.expected/tryserver.json index 35e983e84..c4959cd37 100644 --- a/recipe_modules/gclient/example.expected/tryserver.json +++ b/recipe_modules/gclient/example.expected/tryserver.json @@ -9,6 +9,9 @@ "cache_dir = '[ROOT]/git_cache'\nsolutions = [{'deps_file': '.DEPS.git', 'managed': True, 'name': 'src', 'url': 'https://chromium.googlesource.com/chromium/src.git'}]" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient setup" }, { @@ -32,6 +35,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -56,6 +62,9 @@ "local_bot" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.name)" }, { @@ -70,6 +79,9 @@ "local_bot@example.com" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient recurse (git config user.email)" }, { @@ -82,6 +94,9 @@ "cache_dir = None\nsolutions = [{'deps_file': 'DEPS', 'managed': True, 'name': 'WebKit', 'safesync_url': 'https://blink-status.appspot.com/lkgr', 'url': 'svn://svn.chromium.org/blink/trunk'}]" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient setup" }, { @@ -112,6 +127,9 @@ "/path/to/tmp/json" ], "cwd": "[SLAVE_BUILD]/src/third_party", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "[spec: WebKit] gclient sync", "~followup_annotations": [ "@@@STEP_LOG_LINE@json.output@{@@@", @@ -160,6 +178,9 @@ "runhooks" ], "cwd": "[SLAVE_BUILD]", + "env": { + "PATH": "%(PATH)s:RECIPE_PACKAGE[depot_tools]" + }, "name": "gclient runhooks" }, {